Index: /trunk/sources/HeuristicLab.Data.Views/3.3/StringConvertibleMatrixColumnVisibilityDialog.cs
===================================================================
--- /trunk/sources/HeuristicLab.Data.Views/3.3/StringConvertibleMatrixColumnVisibilityDialog.cs	(revision 8873)
+++ /trunk/sources/HeuristicLab.Data.Views/3.3/StringConvertibleMatrixColumnVisibilityDialog.cs	(revision 8874)
@@ -36,5 +36,5 @@
     protected override void UpdateCheckBoxes() {
       this.checkedListBox.Items.Clear();
-      foreach (DataGridViewColumn column in bands) {
+      foreach (DataGridViewColumn column in Bands) {
         checkedListBox.Items.Add(column.HeaderText, column.Visible);
       }
Index: /trunk/sources/HeuristicLab.Data.Views/3.3/StringConvertibleMatrixRowVisibilityDialog.cs
===================================================================
--- /trunk/sources/HeuristicLab.Data.Views/3.3/StringConvertibleMatrixRowVisibilityDialog.cs	(revision 8873)
+++ /trunk/sources/HeuristicLab.Data.Views/3.3/StringConvertibleMatrixRowVisibilityDialog.cs	(revision 8874)
@@ -36,5 +36,5 @@
     protected override void UpdateCheckBoxes() {
       this.checkedListBox.Items.Clear();
-      foreach (DataGridViewRow row in bands) {
+      foreach (DataGridViewRow row in Bands) {
         checkedListBox.Items.Add(row.HeaderCell.Value, row.Visible);
       }
Index: /trunk/sources/HeuristicLab.Data.Views/3.3/StringConvertibleMatrixVisibilityDialog.cs
===================================================================
--- /trunk/sources/HeuristicLab.Data.Views/3.3/StringConvertibleMatrixVisibilityDialog.cs	(revision 8873)
+++ /trunk/sources/HeuristicLab.Data.Views/3.3/StringConvertibleMatrixVisibilityDialog.cs	(revision 8874)
@@ -37,6 +37,6 @@
     }
 
-    protected List<T> bands;
-    private IEnumerable<T> Bands {
+    private List<T> bands;
+    public IEnumerable<T> Bands {
       get { return this.bands; }
       set { this.bands = new List<T>(value); }
Index: /trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/FeatureCorrelation/AbstractFeatureCorrelationView.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/FeatureCorrelation/AbstractFeatureCorrelationView.cs	(revision 8873)
+++ /trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/FeatureCorrelation/AbstractFeatureCorrelationView.cs	(revision 8874)
@@ -33,5 +33,4 @@
   public abstract partial class AbstractFeatureCorrelationView : AsynchronousContentView {
     protected FeatureCorrelationCalculator fcc;
-    protected DoubleMatrix currentCorrelation;
 
     public new DataAnalysisProblemData Content {
@@ -99,13 +98,13 @@
     protected abstract void Content_CorrelationCalculationFinished(object sender, FeatureCorrelationCalculator.CorrelationCalculationFinishedArgs e);
 
-    protected void UpdateDataView() {
+    protected void UpdateDataView(DoubleMatrix correlation) {
       IDependencyCalculator calc = (IDependencyCalculator)CorrelationCalcComboBox.SelectedValue;
       maximumLabel.Text = calc.Maximum.ToString();
       minimumLabel.Text = calc.Minimum.ToString();
 
-      currentCorrelation.SortableView = true;
+      correlation.SortableView = true;
       dataView.Maximum = calc.Maximum;
       dataView.Minimum = calc.Minimum;
-      dataView.Content = currentCorrelation;
+      dataView.Content = correlation;
       dataView.Enabled = true;
     }
Index: /trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/FeatureCorrelation/EnhancedStringConvertibleMatrixView.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/FeatureCorrelation/EnhancedStringConvertibleMatrixView.cs	(revision 8873)
+++ /trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/FeatureCorrelation/EnhancedStringConvertibleMatrixView.cs	(revision 8874)
@@ -31,11 +31,16 @@
 namespace HeuristicLab.Problems.DataAnalysis.Views {
   public partial class EnhancedStringConvertibleMatrixView : StringConvertibleMatrixView {
-
-    protected IEnumerable<bool> columnVisibility, rowVisibility;
+    private bool[] columnVisibility, rowVisibility;
 
     // sets the visibility of its columns for the next time it is updated
-    public IEnumerable<bool> ColumnVisibility { set { columnVisibility = value; } }
+    public IEnumerable<bool> ColumnVisibility {
+      get { return columnVisibility; }
+      set { columnVisibility = value.ToArray(); }
+    }
     // sets the visibility of its rows for the next time it is updated
-    public IEnumerable<bool> RowVisibility { set { rowVisibility = value; } }
+    public IEnumerable<bool> RowVisibility {
+      get { return rowVisibility; }
+      set { rowVisibility = value.ToArray(); }
+    }
 
     public double Maximum { get; set; }
@@ -82,5 +87,5 @@
       var dialog = new StringConvertibleMatrixRowVisibilityDialog(this.dataGridView.Rows.Cast<DataGridViewRow>());
       dialog.ShowDialog();
-      rowVisibility = dialog.Visibility;
+      RowVisibility = dialog.Visibility;
     }
 
@@ -88,5 +93,5 @@
       var dialog = new StringConvertibleMatrixColumnVisibilityDialog(this.dataGridView.Columns.Cast<DataGridViewColumn>());
       dialog.ShowDialog();
-      columnVisibility = dialog.Visibility;
+      ColumnVisibility = dialog.Visibility;
     }
 
Index: /trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/FeatureCorrelation/FeatureCorrelationCalculator.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/FeatureCorrelation/FeatureCorrelationCalculator.cs	(revision 8873)
+++ /trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/FeatureCorrelation/FeatureCorrelationCalculator.cs	(revision 8874)
@@ -70,14 +70,4 @@
         bw.CancelAsync();
       }
-    }
-
-    private double[,] GetElementsOfCorrelation(double[,] corr, int frames) {
-      double[,] elements = new double[corr.GetLength(0), frames + 1];
-      for (int i = 0; i < corr.GetLength(0); i++) {
-        for (int j = 0; j <= frames; j++) {
-          elements[i, j] = corr[i, j];
-        }
-      }
-      return elements;
     }
 
@@ -204,10 +194,10 @@
 
     private IEnumerable<double> GetRelevantValues(IDataAnalysisProblemData problemData, string partition, string variable) {
-      IEnumerable<double> var = problemData.Dataset.GetDoubleValues(variable);
-      if (partition.Equals(FeatureCorrelationPartitions.TRAININGSAMPLES)) {
-        var = var.Skip(problemData.TrainingPartition.Start).Take(problemData.TrainingPartition.End - problemData.TrainingPartition.Start);
-      } else if (partition.Equals(FeatureCorrelationPartitions.TESTSAMPLES)) {
-        var = var.Skip(problemData.TestPartition.Start).Take(problemData.TestPartition.End - problemData.TestPartition.Start);
-      }
+      IEnumerable<double> var;
+      if (partition.Equals(FeatureCorrelationPartitions.TRAININGSAMPLES))
+        var = problemData.Dataset.GetDoubleValues(variable, problemData.TrainingIndices);
+      else if (partition.Equals(FeatureCorrelationPartitions.TESTSAMPLES))
+        var = problemData.Dataset.GetDoubleValues(variable, problemData.TestIndices);
+      else var = problemData.Dataset.GetDoubleValues(variable);
       return var;
     }
@@ -216,5 +206,5 @@
       BackgroundWorker worker = sender as BackgroundWorker;
       if (!e.Cancelled && !worker.CancellationPending) {
-        if (!(e.Error == null)) {
+        if (e.Error != null) {
           ErrorHandling.ShowErrorDialog(e.Error);
         } else {
Index: /trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/FeatureCorrelation/FeatureCorrelationView.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/FeatureCorrelation/FeatureCorrelationView.cs	(revision 8873)
+++ /trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/FeatureCorrelation/FeatureCorrelationView.cs	(revision 8874)
@@ -43,6 +43,5 @@
     protected override void OnContentChanged() {
       if (Content != null) {
-        dataView.RowVisibility = SetInitialVariableVisibility();
-        dataView.ColumnVisibility = SetInitialVariableVisibility();
+        dataView.ColumnVisibility = dataView.RowVisibility = SetInitialVariableVisibility();
       }
       correlationCache.Reset();
@@ -51,33 +50,30 @@
 
     protected override void CalculateCorrelation() {
-      if (CorrelationCalcComboBox.SelectedItem != null && PartitionComboBox.SelectedItem != null) {
-        IDependencyCalculator calc = (IDependencyCalculator)CorrelationCalcComboBox.SelectedValue;
-        string partition = (string)PartitionComboBox.SelectedValue;
-        dataView.Enabled = false;
-        double[,] corr = correlationCache.GetCorrelation(calc, partition);
-        if (corr == null) {
-          fcc.CalculateElements(calc, partition);
-        } else {
-          fcc.TryCancelCalculation();
-          SetNewCorrelation(corr);
-          UpdateDataView();
-        }
+      if (CorrelationCalcComboBox.SelectedItem == null) return;
+      if (PartitionComboBox.SelectedItem == null) return;
+
+      IDependencyCalculator calc = (IDependencyCalculator)CorrelationCalcComboBox.SelectedValue;
+      string partition = (string)PartitionComboBox.SelectedValue;
+      dataView.Enabled = false;
+      double[,] corr = correlationCache.GetCorrelation(calc, partition);
+      if (corr == null) {
+        fcc.CalculateElements(calc, partition);
+      } else {
+        fcc.TryCancelCalculation();
+        var correlation = new DoubleMatrix(corr, Content.Dataset.DoubleVariables, Content.Dataset.DoubleVariables);
+        UpdateDataView(correlation);
       }
     }
 
-    private void SetNewCorrelation(double[,] elements) {
-      currentCorrelation = new DoubleMatrix(elements,
-                                            Content.Dataset.DoubleVariables,
-                                            Content.Dataset.DoubleVariables);
-    }
+
 
     protected override void Content_CorrelationCalculationFinished(object sender, FeatureCorrelationCalculator.CorrelationCalculationFinishedArgs e) {
       if (InvokeRequired) {
         Invoke(new FeatureCorrelationCalculator.CorrelationCalculationFinishedHandler(Content_CorrelationCalculationFinished), sender, e);
-      } else {
-        correlationCache.SetCorrelation(e.Calculcator, e.Partition, e.Correlation);
-        SetNewCorrelation(e.Correlation);
-        UpdateDataView();
+        return;
       }
+      correlationCache.SetCorrelation(e.Calculcator, e.Partition, e.Correlation);
+      var correlation = new DoubleMatrix(e.Correlation, Content.Dataset.DoubleVariables, Content.Dataset.DoubleVariables);
+      UpdateDataView(correlation);
     }
 
Index: /trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/FeatureCorrelation/TimeframeFeatureCorrelationView.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/FeatureCorrelation/TimeframeFeatureCorrelationView.cs	(revision 8873)
+++ /trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/FeatureCorrelation/TimeframeFeatureCorrelationView.cs	(revision 8874)
@@ -49,8 +49,9 @@
     }
 
-    protected void VariableSelectionComboBox_SelectedChangeCommitted(object sender, EventArgs e) {
+    private void VariableSelectionComboBox_SelectedChangeCommitted(object sender, EventArgs e) {
       CalculateCorrelation();
     }
-    protected void TimeframeTextbox_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e) {
+
+    private void TimeframeTextbox_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e) {
       if (e.KeyCode == Keys.Enter) {
         CalculateCorrelation();
@@ -74,11 +75,13 @@
         } else {
           fcc.TryCancelCalculation();
-          SetNewCorrelation(corr, calc, frames);
-          UpdateDataView();
+          var columnNames = Enumerable.Range(0, corr.GetLength(1)).Select(x => x.ToString());
+          var correlation = new DoubleMatrix(corr, columnNames, Content.Dataset.DoubleVariables);
+          ((IStringConvertibleMatrix)correlation).Columns = frames + 1;
+          UpdateDataView(correlation);
         }
       }
     }
 
-    protected bool ValidateTimeframeTextbox() {
+    private bool ValidateTimeframeTextbox() {
       int help;
       if (!int.TryParse(TimeframeTextbox.Text, out help)) {
@@ -95,17 +98,4 @@
     }
 
-    private void SetNewCorrelation(double[,] elements, IDependencyCalculator calc, int frames) {
-      double[,] neededValues = new double[elements.GetLength(0), frames + 1];
-      for (int i = 0; i < elements.GetLength(0); i++) {
-        Array.Copy(elements, i * elements.GetLength(1), neededValues, i * neededValues.GetLength(1), frames + 1);
-      }
-      SetNewCorrelation(neededValues);
-    }
-
-    private void SetNewCorrelation(double[,] elements) {
-      currentCorrelation = new DoubleMatrix(elements,
-                                            Enumerable.Range(0, elements.GetLength(1)).Select(x => x.ToString()),
-                                            Content.Dataset.DoubleVariables);
-    }
 
     protected override void Content_CorrelationCalculationFinished(object sender, FeatureCorrelationCalculator.CorrelationCalculationFinishedArgs e) {
@@ -114,6 +104,7 @@
       } else {
         correlationTimeframCache.SetTimeframeCorrelation(e.Calculcator, e.Partition, e.Variable, e.Correlation);
-        SetNewCorrelation(e.Correlation);
-        UpdateDataView();
+        var columnNames = Enumerable.Range(0, e.Correlation.GetLength(1)).Select(x => x.ToString());
+        var correlation = new DoubleMatrix(e.Correlation, columnNames, Content.Dataset.DoubleVariables);
+        UpdateDataView(correlation);
       }
     }
