#region License Information
/* HeuristicLab
 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
 *
 * This file is part of HeuristicLab.
 *
 * HeuristicLab is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * HeuristicLab is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
 */
#endregion

using System;
using System.Collections.Generic;
using HeuristicLab.Common;
using HeuristicLab.Core;
using HeuristicLab.Data;
using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;

namespace HeuristicLab.Problems.PFSP {
  [Item("JobMatrix", "Represents a matrix of a PFSP.")]
  [StorableClass]
  public sealed class JobMatrix : DoubleMatrix {
    [StorableConstructor]
    private JobMatrix(bool deserializing) : base(deserializing) { }
    private JobMatrix(JobMatrix original, Cloner cloner) {
      throw new NotSupportedException("Distance matrices cannot be cloned.");
    }
    public JobMatrix() : base() { }
    public JobMatrix(int rows, int columns) : base(rows, columns) { }
    public JobMatrix(int rows, int columns, IEnumerable<string> columnNames) : base(rows, columns, columnNames) { }
    public JobMatrix(int rows, int columns, IEnumerable<string> columnNames, IEnumerable<string> rowNames) : base(rows, columns, columnNames, rowNames) { }
    public JobMatrix(double[,] elements) : base(elements) { }
    public JobMatrix(double[,] elements, IEnumerable<string> columnNames) : base(elements, columnNames) { }
    public JobMatrix(double[,] elements, IEnumerable<string> columnNames, IEnumerable<string> rowNames) : base(elements, columnNames, rowNames) { }

    public override IDeepCloneable Clone(Cloner cloner) {
      // distance matrices are not cloned for performance reasons
      cloner.RegisterClonedObject(this, this);
      return this;
    }
  }
}
