Ignore:
Timestamp:
12/19/17 11:10:14 (2 years ago)
Author:
fholzing
Message:

#2864: CleanUp of old code, added LOP benchmark instances

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2864_PermutationProblems/HeuristicLab.Problems.PFSP/3.3/JobMatrix.cs

    r15521 r15541  
    2727using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2828
    29 namespace HeuristicLab.Problems.PFSP {
    30   [Item("JobMatrix", "Represents a matrix of a PFSP.")]
    31   [StorableClass]
    32   public sealed class JobMatrix : DoubleMatrix {
    33     [StorableConstructor]
    34     private JobMatrix(bool deserializing) : base(deserializing) { }
    35     private JobMatrix(JobMatrix original, Cloner cloner) {
    36       throw new NotSupportedException("Distance matrices cannot be cloned.");
     29namespace HeuristicLab.Problems.PFSP
     30{
     31    [Item("JobMatrix", "Represents a matrix of a PFSP.")]
     32    [StorableClass]
     33    public sealed class JobMatrix : DoubleMatrix
     34    {
     35        [StorableConstructor]
     36        private JobMatrix(bool deserializing) : base(deserializing) { }
     37        private JobMatrix(JobMatrix original, Cloner cloner)
     38        {
     39            throw new NotSupportedException("Job matrices cannot be cloned.");
     40        }
     41
     42        public JobMatrix() : base() { }
     43        public JobMatrix(int rows, int columns) : base(rows, columns) { }
     44        public JobMatrix(int rows, int columns, IEnumerable<string> columnNames) : base(rows, columns, columnNames) { }
     45        public JobMatrix(int rows, int columns, IEnumerable<string> columnNames, IEnumerable<string> rowNames) : base(rows, columns, columnNames, rowNames) { }
     46        public JobMatrix(double[,] elements) : base(elements) { }
     47        public JobMatrix(double[,] elements, IEnumerable<string> columnNames) : base(elements, columnNames) { }
     48        public JobMatrix(double[,] elements, IEnumerable<string> columnNames, IEnumerable<string> rowNames) : base(elements, columnNames, rowNames) { }
     49
     50        public override IDeepCloneable Clone(Cloner cloner)
     51        {
     52            // job matrices are not cloned for performance reasons
     53            cloner.RegisterClonedObject(this, this);
     54            return this;
     55        }
    3756    }
    38     public JobMatrix() : base() { }
    39     public JobMatrix(int rows, int columns) : base(rows, columns) { }
    40     public JobMatrix(int rows, int columns, IEnumerable<string> columnNames) : base(rows, columns, columnNames) { }
    41     public JobMatrix(int rows, int columns, IEnumerable<string> columnNames, IEnumerable<string> rowNames) : base(rows, columns, columnNames, rowNames) { }
    42     public JobMatrix(double[,] elements) : base(elements) { }
    43     public JobMatrix(double[,] elements, IEnumerable<string> columnNames) : base(elements, columnNames) { }
    44     public JobMatrix(double[,] elements, IEnumerable<string> columnNames, IEnumerable<string> rowNames) : base(elements, columnNames, rowNames) { }
    45 
    46     public override IDeepCloneable Clone(Cloner cloner) {
    47       // distance matrices are not cloned for performance reasons
    48       cloner.RegisterClonedObject(this, this);
    49       return this;
    50     }
    51   }
    5257}
Note: See TracChangeset for help on using the changeset viewer.