Free cookie consent management tool by TermsFeed Policy Generator

source: branches/2864_PermutationProblems/HeuristicLab.Problems.PFSP/3.3/JobMatrix.cs @ 15529

Last change on this file since 15529 was 15521, checked in by fholzing, 7 years ago

#2864: First commit of new branch of Permutation based benchmark problems.

File size: 2.3 KB
Line 
1#region License Information
2/* HeuristicLab
3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
4 *
5 * This file is part of HeuristicLab.
6 *
7 * HeuristicLab is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * HeuristicLab is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
19 */
20#endregion
21
22using System;
23using System.Collections.Generic;
24using HeuristicLab.Common;
25using HeuristicLab.Core;
26using HeuristicLab.Data;
27using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
28
29namespace 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.");
37    }
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  }
52}
Note: See TracBrowser for help on using the repository browser.