Changeset 3054 for trunk/sources/HeuristicLab.Data/3.3/DoubleMatrix.cs
- Timestamp:
- 03/16/10 04:24:01 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Data/3.3/DoubleMatrix.cs
r3048 r3054 28 28 [Creatable("Test")] 29 29 [StorableClass] 30 public sealedclass DoubleMatrix : ValueTypeMatrix<double>, IStringConvertibleMatrix {30 public class DoubleMatrix : ValueTypeMatrix<double>, IStringConvertibleMatrix { 31 31 public DoubleMatrix() : base() { } 32 32 public DoubleMatrix(int rows, int columns) : base(rows, columns) { } 33 33 public DoubleMatrix(double[,] elements) : base(elements) { } 34 private DoubleMatrix(DoubleMatrix elements) : base(elements) { }35 34 36 35 public override IDeepCloneable Clone(Cloner cloner) { 37 DoubleMatrix clone = new DoubleMatrix( this);36 DoubleMatrix clone = new DoubleMatrix(matrix); 38 37 cloner.RegisterClonedObject(this, clone); 39 38 return clone; 40 39 } 41 40 42 #region IStringConvertibleMatrix Members 43 int IStringConvertibleMatrix.Rows { 44 get { return Rows; } 45 set { Rows = value; } 46 } 47 int IStringConvertibleMatrix.Columns { 48 get { return Columns; } 49 set { Columns = value; } 50 } 51 52 bool IStringConvertibleMatrix.Validate(string value, out string errorMessage) { 41 protected virtual bool Validate(string value, out string errorMessage) { 53 42 double val; 54 43 bool valid = double.TryParse(value, out val); … … 63 52 return valid; 64 53 } 65 string IStringConvertibleMatrix.GetValue(int rowIndex, int columIndex) {54 protected virtual string GetValue(int rowIndex, int columIndex) { 66 55 return this[rowIndex, columIndex].ToString(); 67 56 } 68 bool IStringConvertibleMatrix.SetValue(string value, int rowIndex, int columnIndex) {57 protected virtual bool SetValue(string value, int rowIndex, int columnIndex) { 69 58 double val; 70 59 if (double.TryParse(value, out val)) { … … 75 64 } 76 65 } 66 67 #region IStringConvertibleMatrix Members 68 int IStringConvertibleMatrix.Rows { 69 get { return Rows; } 70 set { Rows = value; } 71 } 72 int IStringConvertibleMatrix.Columns { 73 get { return Columns; } 74 set { Columns = value; } 75 } 76 bool IStringConvertibleMatrix.Validate(string value, out string errorMessage) { 77 return Validate(value, out errorMessage); 78 } 79 string IStringConvertibleMatrix.GetValue(int rowIndex, int columIndex) { 80 return GetValue(rowIndex, columIndex); 81 } 82 bool IStringConvertibleMatrix.SetValue(string value, int rowIndex, int columnIndex) { 83 return SetValue(value, rowIndex, columnIndex); 84 } 77 85 #endregion 78 86 }
Note: See TracChangeset
for help on using the changeset viewer.