Index: /trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/SupportVectorRegression/SupportVectorRegressionSolution.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/SupportVectorRegression/SupportVectorRegressionSolution.cs	(revision 3932)
+++ /trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/SupportVectorRegression/SupportVectorRegressionSolution.cs	(revision 3933)
@@ -65,12 +65,12 @@
     private Dataset CalculateSupportVectors() {
       if (Model.Model.SupportVectorIndizes.Length == 0)
-        return new Dataset();
+        return new Dataset(new List<string>(),new double[0,0]);
 
-      Dataset dataset = new Dataset(ProblemData.Dataset.VariableNames, new double[Model.Model.SupportVectorCount, ProblemData.Dataset.Columns]);
+      double[,] data = new double[Model.Model.SupportVectorIndizes.Length, ProblemData.Dataset.Columns];
       for (int i = 0; i < Model.Model.SupportVectorIndizes.Length; i++) {
         for (int column = 0; column < ProblemData.Dataset.Columns; column++)
-          dataset[i, column] = ProblemData.Dataset[Model.Model.SupportVectorIndizes[i], column];
+          data[i, column] = ProblemData.Dataset[Model.Model.SupportVectorIndizes[i], column];
       }
-      return dataset;
+      return new Dataset(ProblemData.Dataset.VariableNames, data);
     }
 
Index: /trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.3/EstimatedValuesView.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.3/EstimatedValuesView.cs	(revision 3932)
+++ /trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.3/EstimatedValuesView.cs	(revision 3933)
@@ -91,5 +91,5 @@
         double[,] values =
         MatrixExtensions<double>.Create(
-          Content.ProblemData.Dataset[Content.ProblemData.TargetVariable.Value],
+          Content.ProblemData.Dataset.GetVariableValues(Content.ProblemData.TargetVariable.Value),
           Content.EstimatedValues.ToArray());
         var content = new DoubleMatrix(values);
Index: /trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.3/LineChartView.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.3/LineChartView.cs	(revision 3932)
+++ /trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.3/LineChartView.cs	(revision 3933)
@@ -64,5 +64,5 @@
       this.chart.Series[TARGETVARIABLE_SERIES_NAME].LegendText = Content.ProblemData.TargetVariable.Value;
       this.chart.Series[TARGETVARIABLE_SERIES_NAME].ChartType = SeriesChartType.FastLine;
-      this.chart.Series[TARGETVARIABLE_SERIES_NAME].Points.DataBindY(Content.ProblemData.Dataset[Content.ProblemData.TargetVariable.Value]);
+      this.chart.Series[TARGETVARIABLE_SERIES_NAME].Points.DataBindY(Content.ProblemData.Dataset.GetVariableValues(Content.ProblemData.TargetVariable.Value));
       this.UpdateStripLines();
 
Index: /trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.3/ScatterPlotView.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.3/ScatterPlotView.cs	(revision 3932)
+++ /trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.3/ScatterPlotView.cs	(revision 3933)
@@ -137,16 +137,16 @@
         int testStart = Content.ProblemData.TestSamplesStart.Value;
         int testEnd = Content.ProblemData.TestSamplesEnd.Value;
-        if(this.chart.Series[ALL_SERIES].Points.Count > 0)
-        this.chart.Series[ALL_SERIES].Points.DataBindXY(Content.EstimatedValues.ToArray(), "",
-          dataset[targetVariableName], "");
+        if (this.chart.Series[ALL_SERIES].Points.Count > 0)
+          this.chart.Series[ALL_SERIES].Points.DataBindXY(Content.EstimatedValues.ToArray(), "",
+            dataset.GetVariableValues(targetVariableName), "");
         if (this.chart.Series[TRAINING_SERIES].Points.Count > 0)
-        this.chart.Series[TRAINING_SERIES].Points.DataBindXY(Content.EstimatedTrainingValues.ToArray(), "",
-          dataset.GetVariableValues(targetVariableName, trainingStart, trainingEnd), "");
+          this.chart.Series[TRAINING_SERIES].Points.DataBindXY(Content.EstimatedTrainingValues.ToArray(), "",
+            dataset.GetVariableValues(targetVariableName, trainingStart, trainingEnd), "");
         if (this.chart.Series[TEST_SERIES].Points.Count > 0)
-        this.chart.Series[TEST_SERIES].Points.DataBindXY(Content.EstimatedTestValues.ToArray(), "",
-          dataset.GetVariableValues(targetVariableName, testStart, testEnd), "");
-
-        double max = Math.Max(Content.EstimatedValues.Max(), dataset.GetMax(targetVariableName));
-        double min = Math.Min(Content.EstimatedValues.Min(), dataset.GetMin(targetVariableName));
+          this.chart.Series[TEST_SERIES].Points.DataBindXY(Content.EstimatedTestValues.ToArray(), "",
+            dataset.GetVariableValues(targetVariableName, testStart, testEnd), "");
+
+        double max = Math.Max(Content.EstimatedValues.Max(), dataset.GetVariableValues(targetVariableName).Max());
+        double min = Math.Min(Content.EstimatedValues.Min(), dataset.GetVariableValues(targetVariableName).Min());
 
         max = Math.Ceiling(max) * 1.2;
@@ -185,5 +185,5 @@
           case ALL_SERIES:
             predictedValues = Content.EstimatedValues;
-            targetValues = dataset[targetVariableName];
+            targetValues = dataset.GetVariableValues(targetVariableName);
             break;
           case TRAINING_SERIES:
Index: /trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/DataAnalysisProblemData.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/DataAnalysisProblemData.cs	(revision 3932)
+++ /trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/DataAnalysisProblemData.cs	(revision 3933)
@@ -100,5 +100,4 @@
         if (value != Dataset) {
           if (value == null) throw new ArgumentNullException();
-          if (Dataset != null) DeregisterDatasetEventHandlers();
           DatasetParameter.Value = value;
         }
@@ -216,5 +215,4 @@
 
     private void RegisterParameterValueEventHandlers() {
-      RegisterDatasetEventHandlers();
       RegisterInputVariablesEventHandlers();
       if (TargetVariable != null) RegisterStringValueEventHandlers(TargetVariable);
@@ -228,5 +226,4 @@
     #region parameter value changed event handlers
     void DatasetParameter_ValueChanged(object sender, EventArgs e) {
-      RegisterDatasetEventHandlers();
       OnProblemDataChanged(EventArgs.Empty);
     }
@@ -258,29 +255,4 @@
     }
     #endregion
-
-
-    private void RegisterDatasetEventHandlers() {
-      Dataset.DataChanged += new EventHandler<EventArgs<int, int>>(Dataset_DataChanged);
-      Dataset.Reset += new EventHandler(Dataset_Reset);
-      Dataset.ColumnNamesChanged += new EventHandler(Dataset_ColumnNamesChanged);
-    }
-
-    private void DeregisterDatasetEventHandlers() {
-      Dataset.DataChanged -= new EventHandler<EventArgs<int, int>>(Dataset_DataChanged);
-      Dataset.Reset -= new EventHandler(Dataset_Reset);
-      Dataset.ColumnNamesChanged -= new EventHandler(Dataset_ColumnNamesChanged);
-    }
-
-    void Dataset_ColumnNamesChanged(object sender, EventArgs e) {
-      OnProblemDataChanged(e);
-    }
-
-    void Dataset_Reset(object sender, EventArgs e) {
-      OnProblemDataChanged(e);
-    }
-
-    void Dataset_DataChanged(object sender, EventArgs<int, int> e) {
-      OnProblemDataChanged(e);
-    }
 
     private void RegisterInputVariablesEventHandlers() {
Index: /trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/DataAnalysisSolution.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/DataAnalysisSolution.cs	(revision 3932)
+++ /trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/DataAnalysisSolution.cs	(revision 3933)
@@ -154,6 +154,5 @@
     public override IDeepCloneable Clone(Cloner cloner) {
       DataAnalysisSolution clone = (DataAnalysisSolution)base.Clone(cloner);
-      // don't clone the problem data!
-      clone.problemData = problemData;
+      clone.problemData = (DataAnalysisProblemData)cloner.Clone(problemData);
       clone.model = (IDataAnalysisModel)cloner.Clone(model);
       clone.lowerEstimationLimit = lowerEstimationLimit;
Index: /trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/Dataset.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/Dataset.cs	(revision 3932)
+++ /trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/Dataset.cs	(revision 3933)
@@ -35,19 +35,16 @@
   [StorableClass]
   public sealed class Dataset : NamedItem, IStringConvertibleMatrix {
-    public Dataset()
-      : base() {
-      this.Name = string.Empty;
-      this.data = new double[0, 0];
-      this.variableNames = new string[0];
-      this.SortableView = false;
+    [StorableConstructor]
+    protected Dataset(bool deserializing)
+      : base(deserializing) {
     }
 
     public Dataset(IEnumerable<string> variableNames, double[,] data)
-      : this() {
+      : base() {
       Name = "-";
       if (variableNames.Count() != data.GetLength(1)) {
         throw new ArgumentException("Number of variable names doesn't match the number of columns of data");
       }
-      this.data = data;
+      this.data = (double[,])data.Clone();
       this.variableNames = variableNames.ToArray();
     }
@@ -57,10 +54,4 @@
     public IEnumerable<string> VariableNames {
       get { return variableNames; }
-      private set {
-        if (variableNames != value) {
-          variableNames = value.ToArray();
-          OnColumnNamesChanged();
-        }
-      }
     }
 
@@ -69,11 +60,4 @@
     private double[,] Data {
       get { return data; }
-      set {
-        if (data != value) {
-          if (value == null) throw new ArgumentNullException();
-          this.data = value;
-          OnReset(EventArgs.Empty);
-        }
-      }
     }
 
@@ -81,12 +65,6 @@
     public double this[int rowIndex, int columnIndex] {
       get { return data[rowIndex, columnIndex]; }
-      set {
-        if (!value.Equals(data[rowIndex, columnIndex])) {
-          data[rowIndex, columnIndex] = value;
-          OnDataChanged(new EventArgs<int, int>(rowIndex, columnIndex));
-          OnItemChanged(rowIndex, columnIndex);
-        }
-      }
     }
+
     public double this[string variableName, int rowIndex] {
       get {
@@ -94,16 +72,8 @@
         return data[rowIndex, columnIndex];
       }
-      set {
-        int columnIndex = GetVariableIndex(variableName);
-        if (!value.Equals(data[rowIndex, columnIndex])) {
-          data[rowIndex, columnIndex] = value;
-          OnDataChanged(new EventArgs<int, int>(rowIndex, columnIndex));
-          OnItemChanged(rowIndex, columnIndex);
-        }
-      }
     }
-    // access to full columns
-    public double[] this[string variableName] {
-      get { return GetVariableValues(GetVariableIndex(variableName), 0, Rows); }
+
+    public double[] GetVariableValues(int variableIndex) {
+      return GetVariableValues(variableIndex, 0, Rows);
     }
 
@@ -118,4 +88,8 @@
         values[i] = data[i + start, variableIndex];
       return values;
+    }
+
+    public double[] GetVariableValues(string variableName) {
+      return GetVariableValues(GetVariableIndex(variableName), 0, Rows);
     }
 
@@ -135,111 +109,14 @@
       throw new ArgumentException("The variable name " + variableName + " was not found.");
     }
+    #endregion
 
-    public void SetVariableName(int variableIndex, string name) {
-      if (name == null) throw new ArgumentNullException("Cannot set variable name to null for variable at index " + variableIndex + " variableIndex");
-      if (variableNames.Contains(name)) throw new ArgumentException("The data set already contains a variable with name " + name + ".");
-      if (variableIndex < 0 || variableIndex >= variableNames.Length) throw new ArgumentException(" Cannot set name of not existent variable at index " + variableIndex + ".");
-      variableNames[variableIndex] = name;
-      OnColumnNamesChanged();
+    public double[,] GetClonedData() {
+      return (double[,])data.Clone();
     }
 
-    #endregion
-
-    #region variable statistics
-    public double GetMean(string variableName) {
-      return GetMean(GetVariableIndex(variableName));
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return this;
     }
 
-    public double GetMean(string variableName, int start, int end) {
-      return GetMean(GetVariableIndex(variableName), start, end);
-    }
-
-    public double GetMean(int variableIndex) {
-      return GetMean(variableIndex, 0, Rows);
-    }
-
-    public double GetMean(int variableIndex, int start, int end) {
-      return GetVariableValues(variableIndex, start, end).Average();
-    }
-
-    public double GetRange(string variableName) {
-      return GetRange(GetVariableIndex(variableName));
-    }
-
-    public double GetRange(int variableIndex) {
-      return GetRange(variableIndex, 0, Rows);
-    }
-
-    public double GetRange(string variableName, int start, int end) {
-      return GetRange(GetVariableIndex(variableName), start, end);
-    }
-
-    public double GetRange(int variableIndex, int start, int end) {
-      var values = GetVariableValues(variableIndex, start, end);
-      return values.Max() - values.Min();
-    }
-
-    public double GetMax(string variableName) {
-      return GetMax(GetVariableIndex(variableName));
-    }
-
-    public double GetMax(int variableIndex) {
-      return GetMax(variableIndex, 0, Rows);
-    }
-
-    public double GetMax(string variableName, int start, int end) {
-      return GetMax(GetVariableIndex(variableName), start, end);
-    }
-
-    public double GetMax(int variableIndex, int start, int end) {
-      return GetVariableValues(variableIndex, start, end).Max();
-    }
-
-    public double GetMin(string variableName) {
-      return GetMin(GetVariableIndex(variableName));
-    }
-
-    public double GetMin(int variableIndex) {
-      return GetMin(variableIndex, 0, Rows);
-    }
-
-    public double GetMin(string variableName, int start, int end) {
-      return GetMin(GetVariableIndex(variableName), start, end);
-    }
-
-    public double GetMin(int variableIndex, int start, int end) {
-      return GetVariableValues(variableIndex, start, end).Min();
-    }
-
-    public int GetMissingValues(string variableName) {
-      return GetMissingValues(GetVariableIndex(variableName));
-    }
-    public int GetMissingValues(int variableIndex) {
-      return GetMissingValues(variableIndex, 0, Rows);
-    }
-
-    public int GetMissingValues(string variableName, int start, int end) {
-      return GetMissingValues(GetVariableIndex(variableName), start, end);
-    }
-
-    public int GetMissingValues(int variableIndex, int start, int end) {
-      return GetVariableValues(variableIndex, start, end).Count(x => double.IsNaN(x));
-    }
-
-    #endregion
-
-    public override IDeepCloneable Clone(Cloner cloner) {
-      Dataset clone = (Dataset)base.Clone(cloner);
-      clone.data = (double[,])data.Clone();
-      clone.variableNames = (string[])variableNames.Clone();
-      return clone;
-    }
-
-    #region events
-    public event EventHandler<EventArgs<int, int>> DataChanged;
-    private void OnDataChanged(EventArgs<int, int> e) {
-      var listeners = DataChanged;
-      if (listeners != null) listeners(this, e);
-    }
     public event EventHandler Reset;
     private void OnReset(EventArgs e) {
@@ -247,97 +124,38 @@
       if (listeners != null) listeners(this, e);
     }
-    #endregion
 
     #region IStringConvertibleMatrix Members
 
     public int Rows {
-      get {
-        return data.GetLength(0);
-      }
-      set {
-        if (value == 0) throw new ArgumentException("Number of rows must be at least one (for variable names)");
-        if (value != Rows) {
-          var newValues = new double[value, Columns];
-          for (int row = 0; row < Math.Min(Rows, value); row++) {
-            for (int column = 0; column < Columns; column++) {
-              newValues[row, column] = data[row, column];
-            }
-          }
-          Data = newValues;
-        }
-      }
+      get { return data.GetLength(0); }
+      set { throw new NotSupportedException(); }
     }
 
     public int Columns {
-      get {
-        return data.GetLength(1);
-      }
-      set {
-        if (value != Columns) {
-          var newValues = new double[Rows, value];
-          var newVariableNames = new string[value];
-          for (int row = 0; row < Rows; row++) {
-            for (int column = 0; column < Math.Min(value, Columns); column++) {
-              newValues[row, column] = data[row, column];
-            }
-          }
-          string formatString = new StringBuilder().Append('0', (int)Math.Log10(value) + 1).ToString(); // >= 100 variables => ###
-          for (int column = 0; column < value; column++) {
-            if (column < Columns)
-              newVariableNames[column] = variableNames[column];
-            else
-              newVariableNames[column] = "Var" + column.ToString(formatString);
-          }
-          VariableNames = newVariableNames;
-          Data = newValues;
-        }
-      }
+      get { return data.GetLength(1); }
+      set { throw new NotSupportedException(); }
     }
 
-    [Storable]
-    private bool sortableView;
     public bool SortableView {
-      get { return sortableView; }
-      set {
-        if (value != sortableView) {
-          sortableView = value;
-          OnSortableViewChanged();
-        }
-      }
+      get { return false; }
+      set { throw new NotSupportedException(); }
     }
 
     public bool ReadOnly {
-      get { return false; }
+      get { return true; }
     }
 
     IEnumerable<string> IStringConvertibleMatrix.ColumnNames {
       get { return this.VariableNames; }
-      set {
-        int i = 0;
-        foreach (string variableName in value) {
-          SetVariableName(i, variableName);
-          i++;
-        }
-        OnColumnNamesChanged();
-      }
+      set { throw new NotSupportedException(); }
     }
 
     IEnumerable<string> IStringConvertibleMatrix.RowNames {
       get { return new List<string>(); }
-      set { throw new NotImplementedException(); }
+      set { throw new NotSupportedException(); }
     }
 
     public bool Validate(string value, out string errorMessage) {
-      double val;
-      bool valid = double.TryParse(value, out val);
-      errorMessage = string.Empty;
-      if (!valid) {
-        StringBuilder sb = new StringBuilder();
-        sb.Append("Invalid Value (Valid Value Format: \"");
-        sb.Append(FormatPatterns.GetDoubleFormatPattern());
-        sb.Append("\")");
-        errorMessage = sb.ToString();
-      }
-      return valid;
+      throw new NotSupportedException();
     }
 
@@ -347,11 +165,5 @@
 
     public bool SetValue(string value, int rowIndex, int columnIndex) {
-      double v;
-      if (double.TryParse(value, out v)) {
-        data[rowIndex, columnIndex] = v;
-        OnDataChanged(new EventArgs<int, int>(rowIndex, columnIndex));
-        OnItemChanged(rowIndex, columnIndex);
-        return true;
-      } else return false;
+      throw new NotSupportedException();
     }
 
@@ -381,6 +193,4 @@
     }
     #endregion
-
-
   }
 }
Index: /trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/SupportVectorMachine/SupportVectorMachineCrossValidationEvaluator.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/SupportVectorMachine/SupportVectorMachineCrossValidationEvaluator.cs	(revision 3932)
+++ /trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/SupportVectorMachine/SupportVectorMachineCrossValidationEvaluator.cs	(revision 3933)
@@ -152,6 +152,6 @@
 
       int reducedRows = (int)((SamplesEnd.Value - SamplesStart.Value) * reductionRatio);
-      var reducedProblemData = (DataAnalysisProblemData)DataAnalysisProblemData.Clone();
-      ShuffleRows(RandomParameter.ActualValue, reducedProblemData.Dataset, SamplesStart.Value, SamplesEnd.Value);
+      DataAnalysisProblemData reducedProblemData = (DataAnalysisProblemData)DataAnalysisProblemData.Clone();
+      reducedProblemData.Dataset = CreateReducedDataset(RandomParameter.ActualValue, reducedProblemData.Dataset, reductionRatio, SamplesStart.Value, SamplesEnd.Value);
 
       double quality = PerformCrossValidation(reducedProblemData,
@@ -164,13 +164,15 @@
     }
 
-    private void ShuffleRows(IRandom random, Dataset dataset, int start, int end) {
-      for (int row = end - 1; row > start ; row--) {
-        int otherRow = random.Next(start, row);
-        for (int column = 0; column < dataset.Columns; column++) {
-          double tmp = dataset[otherRow, column];
-          dataset[otherRow, column] = dataset[row, column];
-          dataset[row, column] = tmp;
-        }
+    private Dataset CreateReducedDataset(IRandom random, Dataset dataset, double reductionRatio, int start, int end) {
+      int reducedRows = (int)((end - start) * reductionRatio);
+      double[,] reducedData = dataset.GetClonedData();
+      HashSet<int> leftRows = new HashSet<int>(Enumerable.Range(0, end - start));
+      for (int row = 0; row < reducedRows; row++) {
+        int rowIndex = random.Next(0, leftRows.Count);
+        leftRows.Remove(rowIndex);
+        for (int column = 0; column < dataset.Columns; column++)
+          reducedData[row, column] = dataset[rowIndex, column];
       }
+      return new Dataset(dataset.VariableNames, reducedData);
     }
 
