Changeset 3308 for trunk/sources/HeuristicLab.Data/3.3/ValueTypeMatrix.cs
- Timestamp:
- 04/12/10 14:14:39 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Data/3.3/ValueTypeMatrix.cs
r3306 r3308 22 22 using System; 23 23 using System.Collections; 24 using System.Collections.Generic; 24 25 using System.Drawing; 26 using System.Linq; 25 27 using System.Text; 26 28 using HeuristicLab.Common; … … 38 40 [Storable] 39 41 protected T[,] matrix; 42 43 [Storable] 44 protected List<string> columnNames; 45 public IEnumerable<string> ColumnNames { 46 get { return this.columnNames; } 47 set { 48 if (value == null || value.Count() == 0) 49 columnNames = new List<string>(); 50 else if (value.Count() != Columns) 51 throw new ArgumentException("A columnName must be for each column specified."); 52 else 53 columnNames = new List<string>(value); 54 } 55 } 40 56 41 57 public virtual int Rows { … … 74 90 protected ValueTypeMatrix() { 75 91 matrix = new T[0, 0]; 92 columnNames = new List<string>(); 76 93 } 77 94 protected ValueTypeMatrix(int rows, int columns) { 78 95 matrix = new T[rows, columns]; 96 columnNames = new List<string>(); 97 } 98 protected ValueTypeMatrix(int rows, int columns, IEnumerable<string> columnNames) 99 : this(rows, columns) { 100 ColumnNames = columnNames; 79 101 } 80 102 protected ValueTypeMatrix(T[,] elements) { 81 103 if (elements == null) throw new ArgumentNullException(); 82 104 matrix = (T[,])elements.Clone(); 105 columnNames = new List<string>(); 106 } 107 protected ValueTypeMatrix(T[,] elements, IEnumerable<string> columnNames) 108 : this(elements) { 109 ColumnNames = columnNames; 83 110 } 84 111
Note: See TracChangeset
for help on using the changeset viewer.