- Timestamp:
- 08/18/09 18:17:04 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.CEDMA.Charting/3.3/VisualMatrix.cs
r2289 r2295 11 11 private Matrix matrix; 12 12 13 public VisualMatrix(Matrix matrix, string[] categoricalVariables, string[] ordinalVariables, 14 string[] multiDimensionalCategoricalVariables,string[] multiDimensionalOrdinalVariables) { 13 public VisualMatrix() { 14 this.rows = new List<VisualMatrixRow>(); 15 this.categoricalVariables = new List<string>(); 16 this.ordinalVariables = new List<string>(); 17 this.multiDimensionalCategoricalVariables = new List<string>(); 18 this.multiDimensionalOrdinalVariables = new List<string>(); 19 this.categoricalValueIndices = new Dictionary<string, Dictionary<object, double>>(); } 20 21 public VisualMatrix(Matrix matrix, IEnumerable<string> categoricalVariables, IEnumerable<string> ordinalVariables, 22 IEnumerable<string> multiDimensionalCategoricalVariables, IEnumerable<string> multiDimensionalOrdinalVariables) 23 : this() { 15 24 this.matrix = matrix; 16 this.rows = new List<VisualMatrixRow>(); 17 foreach(MatrixRow row in matrix.GetRows()) 25 this.matrix.Changed += new EventHandler(MatrixChanged); 26 27 foreach (MatrixRow row in matrix.GetRows()) 18 28 rows.Add(new VisualMatrixRow(row)); 19 29 20 this.categoricalVariables = categoricalVariables; 21 this.ordinalVariables = ordinalVariables; 22 this.multiDimensionalOrdinalVariables = multiDimensionalOrdinalVariables; 23 this.multiDimensionalCategoricalVariables = multiDimensionalCategoricalVariables; 24 this.categoricalValueIndices = new Dictionary<string, Dictionary<object, double>>(); 25 26 matrix.Changed += new EventHandler(MatrixChanged); 30 this.categoricalVariables.AddRange(categoricalVariables); 31 this.ordinalVariables.AddRange(ordinalVariables); 32 this.multiDimensionalCategoricalVariables.AddRange(multiDimensionalCategoricalVariables); 33 this.multiDimensionalOrdinalVariables.AddRange(multiDimensionalOrdinalVariables); 27 34 } 28 35 … … 34 41 } 35 42 36 private string[] categoricalVariables; 37 public string[] CategoricalVariables { 43 public void AddRow(VisualMatrixRow row) { 44 this.rows.Add(row); 45 } 46 47 public void RemoveRow(VisualMatrixRow row) { 48 this.rows.Remove(row); 49 } 50 51 public void ClearAllRows(VisualMatrixRow row) { 52 this.rows.Clear(); 53 } 54 55 private List<string> categoricalVariables; 56 public IEnumerable<string> CategoricalVariables { 38 57 get { return categoricalVariables; } 39 58 } 40 59 41 private string[] ordinalVariables; 42 public string[] OrdinalVariables { 60 public void AddCategoricalVariable(string name) { 61 this.categoricalVariables.Add(name); 62 } 63 64 public void RemoveCategoricalVariable(string name) { 65 this.categoricalVariables.Remove(name); 66 } 67 68 public void ClearCategoricalVariables() { 69 this.categoricalVariables.Clear(); 70 } 71 72 private List<string> ordinalVariables; 73 public IEnumerable<string> OrdinalVariables { 43 74 get { return ordinalVariables; } 44 75 } 45 76 46 private string[] multiDimensionalOrdinalVariables; 47 public string[] MultiDimensionalOrdinalVariables { 77 public void AddOrdinalVariable(string name) { 78 this.ordinalVariables.Add(name); 79 } 80 81 public void RemoveOrdinalVariable(string name) { 82 this.ordinalVariables.Remove(name); 83 } 84 85 public void ClearOrdinalVariables() { 86 this.ordinalVariables.Clear(); 87 } 88 89 private List<string> multiDimensionalOrdinalVariables; 90 public IEnumerable<string> MultiDimensionalOrdinalVariables { 48 91 get { return multiDimensionalOrdinalVariables; } 49 92 } 50 93 51 private string[] multiDimensionalCategoricalVariables; 52 public string[] MultiDimensionalCategoricalVariables { 94 public void AddMultiDimensionalOrdinalVariable(string name) { 95 this.multiDimensionalOrdinalVariables.Add(name); 96 } 97 98 public void RemoveMultiDimensionalOrdinalVariable(string name) { 99 this.multiDimensionalOrdinalVariables.Remove(name); 100 } 101 102 public void ClearMultiDimensionalOrdinalVariables() { 103 this.multiDimensionalOrdinalVariables.Clear(); 104 } 105 106 private List<string> multiDimensionalCategoricalVariables; 107 public IEnumerable<string> MultiDimensionalCategoricalVariables { 53 108 get { return multiDimensionalCategoricalVariables; } 54 109 } 55 110 111 public void AddMultiDimensionalCategoricalVariable(string name) { 112 this.multiDimensionalCategoricalVariables.Add(name); 113 } 114 115 public void RemoveMultiDimensionalCategoricalVariable(string name) { 116 this.multiDimensionalCategoricalVariables.Remove(name); 117 } 118 119 public void ClearMultiDimensionalCategoricalVariables() { 120 this.multiDimensionalCategoricalVariables.Clear(); 121 } 122 56 123 public double IndexOfCategoricalValue(string variable, object value) { 57 124 if (value == null) return double.NaN; … … 74 141 } 75 142 76 77 get { return CategoricalVariables.Concat(OrdinalVariables);}143 public IEnumerable<string> Attributes { 144 get { return CategoricalVariables.Concat(OrdinalVariables); } 78 145 } 79 146 }
Note: See TracChangeset
for help on using the changeset viewer.