Index: trunk/sources/HeuristicLab.CEDMA.Charting/3.3/VisualMatrix.cs
===================================================================
--- trunk/sources/HeuristicLab.CEDMA.Charting/3.3/VisualMatrix.cs	(revision 2289)
+++ trunk/sources/HeuristicLab.CEDMA.Charting/3.3/VisualMatrix.cs	(revision 2295)
@@ -11,18 +11,25 @@
     private Matrix matrix;
 
-    public VisualMatrix(Matrix matrix, string[] categoricalVariables, string[] ordinalVariables,
-      string[] multiDimensionalCategoricalVariables,string[] multiDimensionalOrdinalVariables) {
+    public VisualMatrix() {
+      this.rows = new List<VisualMatrixRow>();
+      this.categoricalVariables = new List<string>();
+      this.ordinalVariables = new List<string>();
+      this.multiDimensionalCategoricalVariables = new List<string>();
+      this.multiDimensionalOrdinalVariables = new List<string>();
+      this.categoricalValueIndices = new Dictionary<string, Dictionary<object, double>>();    }
+
+    public VisualMatrix(Matrix matrix, IEnumerable<string> categoricalVariables, IEnumerable<string> ordinalVariables,
+      IEnumerable<string> multiDimensionalCategoricalVariables, IEnumerable<string> multiDimensionalOrdinalVariables)
+      : this() {
       this.matrix = matrix;
-      this.rows = new List<VisualMatrixRow>();
-      foreach(MatrixRow row in matrix.GetRows())
+      this.matrix.Changed += new EventHandler(MatrixChanged);
+
+      foreach (MatrixRow row in matrix.GetRows())
         rows.Add(new VisualMatrixRow(row));
 
-      this.categoricalVariables = categoricalVariables;
-      this.ordinalVariables = ordinalVariables;
-      this.multiDimensionalOrdinalVariables = multiDimensionalOrdinalVariables;
-      this.multiDimensionalCategoricalVariables = multiDimensionalCategoricalVariables;
-      this.categoricalValueIndices = new Dictionary<string, Dictionary<object, double>>();
-
-      matrix.Changed += new EventHandler(MatrixChanged);
+      this.categoricalVariables.AddRange(categoricalVariables);
+      this.ordinalVariables.AddRange(ordinalVariables);
+      this.multiDimensionalCategoricalVariables.AddRange(multiDimensionalCategoricalVariables);
+      this.multiDimensionalOrdinalVariables.AddRange(multiDimensionalOrdinalVariables);
     }
 
@@ -34,24 +41,84 @@
     }
 
-    private string[] categoricalVariables;
-    public string[] CategoricalVariables {
+    public void AddRow(VisualMatrixRow row) {
+      this.rows.Add(row);
+    }
+
+    public void RemoveRow(VisualMatrixRow row) {
+      this.rows.Remove(row);
+    }
+
+    public void ClearAllRows(VisualMatrixRow row) {
+      this.rows.Clear();
+    }
+
+    private List<string> categoricalVariables;
+    public IEnumerable<string> CategoricalVariables {
       get { return categoricalVariables; }
     }
 
-    private string[] ordinalVariables;
-    public string[] OrdinalVariables {
+    public void AddCategoricalVariable(string name) {      
+      this.categoricalVariables.Add(name);
+    }
+
+    public void RemoveCategoricalVariable(string name) {
+      this.categoricalVariables.Remove(name);
+    }
+
+    public void ClearCategoricalVariables() {
+      this.categoricalVariables.Clear();
+    }
+
+    private List<string> ordinalVariables;
+    public IEnumerable<string> OrdinalVariables {
       get { return ordinalVariables; }
     }
 
-    private string[] multiDimensionalOrdinalVariables;
-    public string[] MultiDimensionalOrdinalVariables {
+    public void AddOrdinalVariable(string name) {
+      this.ordinalVariables.Add(name);
+    }
+
+    public void RemoveOrdinalVariable(string name) {
+      this.ordinalVariables.Remove(name);
+    }
+
+    public void ClearOrdinalVariables() {
+      this.ordinalVariables.Clear();
+    }
+
+    private List<string> multiDimensionalOrdinalVariables;
+    public IEnumerable<string> MultiDimensionalOrdinalVariables {
       get { return multiDimensionalOrdinalVariables; }
     }
 
-    private string[] multiDimensionalCategoricalVariables;
-    public string[] MultiDimensionalCategoricalVariables {
+    public void AddMultiDimensionalOrdinalVariable(string name) {
+      this.multiDimensionalOrdinalVariables.Add(name);
+    }
+
+    public void RemoveMultiDimensionalOrdinalVariable(string name) {
+      this.multiDimensionalOrdinalVariables.Remove(name);
+    }
+
+    public void ClearMultiDimensionalOrdinalVariables() {
+      this.multiDimensionalOrdinalVariables.Clear();
+    }
+
+    private List<string> multiDimensionalCategoricalVariables;
+    public IEnumerable<string> MultiDimensionalCategoricalVariables {
       get { return multiDimensionalCategoricalVariables; }
     }
-    
+
+    public void AddMultiDimensionalCategoricalVariable(string name) {
+      this.multiDimensionalCategoricalVariables.Add(name);
+    }
+
+    public void RemoveMultiDimensionalCategoricalVariable(string name) {
+      this.multiDimensionalCategoricalVariables.Remove(name);
+    }
+
+    public void ClearMultiDimensionalCategoricalVariables() {
+      this.multiDimensionalCategoricalVariables.Clear();
+    }
+
     public double IndexOfCategoricalValue(string variable, object value) {
       if (value == null) return double.NaN;
@@ -74,6 +141,6 @@
     }
 
-     public IEnumerable<string> Attributes {
-      get {return CategoricalVariables.Concat(OrdinalVariables);}
+    public IEnumerable<string> Attributes {
+      get { return CategoricalVariables.Concat(OrdinalVariables); }
     }
   }
