Changeset 3264 for trunk/sources/HeuristicLab.Problems.DataAnalysis
- Timestamp:
- 04/04/10 18:53:55 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/Dataset.cs
r3253 r3264 40 40 41 41 public Dataset() 42 : this(new double[,] { { 0.0 } }) {43 } 44 45 public Dataset( double[,] data)42 : this(new string[] { "x" }, new double[,] { { 0.0 } }) { 43 } 44 45 public Dataset(IEnumerable<string> variableNames, double[,] data) 46 46 : base() { 47 47 Name = "-"; 48 if (variableNames.Count() != data.GetLength(1)) { 49 throw new ArgumentException("Number of variable names doesn't match the number of columns of data"); 50 } 48 51 Data = new DoubleMatrix(data); 49 string formatString = new StringBuilder().Append('#', (int)Math.Log10(this.data.Columns) + 1).ToString(); // >= 100 variables => ### 50 this.variableNames = new StringArray((from col in Enumerable.Range(1, this.data.Columns) 51 select "Var" + col.ToString(formatString)).ToArray()); 52 this.variableNames = new StringArray(variableNames.ToArray()); 52 53 } 53 54
Note: See TracChangeset
for help on using the changeset viewer.