Index: /trunk/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/ClassificationMeanSquaredErrorEvaluator.cs
===================================================================
--- /trunk/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/ClassificationMeanSquaredErrorEvaluator.cs	(revision 2577)
+++ /trunk/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/ClassificationMeanSquaredErrorEvaluator.cs	(revision 2578)
@@ -24,4 +24,7 @@
 using HeuristicLab.Data;
 using HeuristicLab.Common;
+using HeuristicLab.GP.Interfaces;
+using System.Linq;
+using HeuristicLab.DataAnalysis;
 
 namespace HeuristicLab.GP.StructureIdentification.Classification {
@@ -40,11 +43,11 @@
     }
 
-    public override void Evaluate(IScope scope, ITreeEvaluator evaluator, HeuristicLab.DataAnalysis.Dataset dataset, int targetVariable, double[] classes, double[] thresholds, int start, int end) {
+    public override void Evaluate(IScope scope, IFunctionTree tree, ITreeEvaluator evaluator, Dataset dataset, int targetVariable, double[] classes, double[] thresholds, int start, int end) {
       double errorsSquaredSum = 0;
+      double[] estimatedValues = evaluator.Evaluate(dataset, tree, Enumerable.Range(start, end - start)).ToArray();
       for (int sample = start; sample < end; sample++) {
-        double estimated = evaluator.Evaluate(sample);
         double original = dataset.GetValue(sample, targetVariable);
         if (!double.IsNaN(original) && !double.IsInfinity(original)) {
-          double error = estimated - original;
+          double error = estimatedValues[sample - start] - original;
           // between classes use squared error
           // on the lower end and upper end only add linear error if the absolute error is larger than 1
@@ -57,4 +60,5 @@
           }
         }
+
       }
 
Index: /trunk/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/GPClassificationEvaluatorBase.cs
===================================================================
--- /trunk/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/GPClassificationEvaluatorBase.cs	(revision 2577)
+++ /trunk/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/GPClassificationEvaluatorBase.cs	(revision 2578)
@@ -24,4 +24,5 @@
 using HeuristicLab.Data;
 using HeuristicLab.DataAnalysis;
+using HeuristicLab.GP.Interfaces;
 
 namespace HeuristicLab.GP.StructureIdentification.Classification {
@@ -33,19 +34,19 @@
     }
 
-    public override void Evaluate(IScope scope, ITreeEvaluator evaluator, Dataset dataset, int targetVariable, int start, int end) {
+    public override void Evaluate(IScope scope, IFunctionTree tree, ITreeEvaluator evaluator, Dataset dataset, int targetVariable, int start, int end) {
 
       ItemList<DoubleData> classes = GetVariableValue<ItemList<DoubleData>>("TargetClassValues", scope, true);
       double[] classesArr = new double[classes.Count];
-      for(int i = 0; i < classesArr.Length; i++) classesArr[i] = classes[i].Data;
+      for (int i = 0; i < classesArr.Length; i++) classesArr[i] = classes[i].Data;
       Array.Sort(classesArr);
       double[] thresholds = new double[classes.Count - 1];
-      for(int i = 0; i < classesArr.Length - 1; i++) {
+      for (int i = 0; i < classesArr.Length - 1; i++) {
         thresholds[i] = (classesArr[i] + classesArr[i + 1]) / 2.0;
       }
 
-      Evaluate(scope, evaluator, dataset, targetVariable, classesArr, thresholds, start, end);
+      Evaluate(scope, tree, evaluator, dataset, targetVariable, classesArr, thresholds, start, end);
     }
 
-    public abstract void Evaluate(IScope scope, ITreeEvaluator evaluator, Dataset dataset, int targetVariable, double[] classes, double[] thresholds, int start, int end);
+    public abstract void Evaluate(IScope scope, IFunctionTree tree, ITreeEvaluator evaluator, Dataset dataset, int targetVariable, double[] classes, double[] thresholds, int start, int end);
   }
 }
Index: /trunk/sources/HeuristicLab.GP.StructureIdentification.ConditionalEvaluation/3.3/ConditionalEvaluatorBase.cs
===================================================================
--- /trunk/sources/HeuristicLab.GP.StructureIdentification.ConditionalEvaluation/3.3/ConditionalEvaluatorBase.cs	(revision 2577)
+++ /trunk/sources/HeuristicLab.GP.StructureIdentification.ConditionalEvaluation/3.3/ConditionalEvaluatorBase.cs	(revision 2578)
@@ -27,4 +27,6 @@
 using HeuristicLab.Data;
 using HeuristicLab.DataAnalysis;
+using HeuristicLab.GP.Interfaces;
+using HeuristicLab.Modeling;
 
 namespace HeuristicLab.GP.StructureIdentification.ConditionalEvaluation {
@@ -40,32 +42,22 @@
     }
 
-    public override void Evaluate(IScope scope, ITreeEvaluator evaluator, Dataset dataset, int targetVariable, int start, int end) {
+    public override void Evaluate(IScope scope, IFunctionTree tree, ITreeEvaluator evaluator, Dataset dataset, int targetVariable, int start, int end) {
       int maxTimeOffset = GetVariableValue<IntData>("MaxTimeOffset", scope, true).Data;
       int minTimeOffset = GetVariableValue<IntData>("MinTimeOffset", scope, true).Data;
       int conditionVariable = GetVariableValue<IntData>("ConditionVariable", scope, true).Data;
 
-      int skippedSampels = 0;
+      var rows = from row in Enumerable.Range(start, end - start)
+                 // check if condition variable is true between sample - minTimeOffset and sample - maxTimeOffset
+                 // => select rows where the value of the condition variable is different from zero in the whole range
+                 where (from neighbour in Enumerable.Range(row + minTimeOffset, maxTimeOffset - minTimeOffset)
+                        let value = dataset.GetValue(neighbour, conditionVariable)
+                        where value == 0
+                        select neighbour).Any() == false
+                 select row;
+
       // store original and estimated values in a double array
-      double[,] values = new double[end - start, 2];
-      for (int sample = start; sample < end; sample++) {
-        // check if condition variable is true between sample - minTimeOffset and sample - maxTimeOffset
-        bool skip = false;
-        for (int checkIndex = sample + minTimeOffset; checkIndex <= sample + maxTimeOffset && !skip; checkIndex++) {
-          if (dataset.GetValue(checkIndex, conditionVariable) == 0) {
-            skip = true;
-            skippedSampels++;
-          }
-        }
-        if (!skip) {
-          double original = dataset.GetValue(sample, targetVariable);
-          double estimated = evaluator.Evaluate(sample);
-          
-          values[sample - start - skippedSampels, 0] = estimated;
-          values[sample - start - skippedSampels, 1] = original;
-        }
-      }
-      //needed because otherwise the array is too large and therefore the sample count is incorrect during calculation
-      ResizeArray(ref values, 2, end - start - skippedSampels);
-
+      double[,] values = Matrix<double>.Create(
+        evaluator.Evaluate(dataset, tree, rows).ToArray(),
+        (from row in rows select dataset.GetValue(row, targetVariable)).ToArray());
 
       // calculate quality value
@@ -78,12 +70,5 @@
       }
       qualityData.Data = quality;
-      scope.GetVariableValue<DoubleData>("TotalEvaluatedNodes", true).Data -= skippedSampels;
-    }
-
-
-    private void ResizeArray(ref double[,] original, int cols, int rows) {
-      double[,] newArray = new double[rows, cols];
-      Array.Copy(original, newArray, cols * rows);
-      original = newArray;
+      scope.GetVariableValue<DoubleData>("TotalEvaluatedNodes", true).Data -= (end - start) - rows.Count();
     }
 
Index: /trunk/sources/HeuristicLab.GP.StructureIdentification.ConditionalEvaluation/3.3/ConditionalSimpleEvaluator.cs
===================================================================
--- /trunk/sources/HeuristicLab.GP.StructureIdentification.ConditionalEvaluation/3.3/ConditionalSimpleEvaluator.cs	(revision 2577)
+++ /trunk/sources/HeuristicLab.GP.StructureIdentification.ConditionalEvaluation/3.3/ConditionalSimpleEvaluator.cs	(revision 2578)
@@ -27,4 +27,5 @@
 using HeuristicLab.Data;
 using HeuristicLab.DataAnalysis;
+using HeuristicLab.GP.Interfaces;
 
 namespace HeuristicLab.GP.StructureIdentification.ConditionalEvaluation {
@@ -38,5 +39,5 @@
     }
 
-    public override void Evaluate(IScope scope, ITreeEvaluator evaluator, Dataset dataset, int targetVariable, int start, int end) {
+    public override void Evaluate(IScope scope, IFunctionTree tree, ITreeEvaluator evaluator, Dataset dataset, int targetVariable, int start, int end) {
       ItemList values = GetVariableValue<ItemList>("Values", scope, false, false);
       if (values == null) {
@@ -53,26 +54,25 @@
       int minTimeOffset = GetVariableValue<IntData>("MinTimeOffset", scope, true).Data;
       int conditionVariable = GetVariableValue<IntData>("ConditionVariable", scope, true).Data;
-      int skippedSampels = 0;
 
-      for (int sample = start; sample < end; sample++) {
-        // check if condition variable is true between sample - minTimeOffset and sample - maxTimeOffset
-        bool skip = false;
-        for (int checkIndex = sample + minTimeOffset; checkIndex <= sample + maxTimeOffset && !skip ; checkIndex++) {
-          if (dataset.GetValue(checkIndex, conditionVariable) == 0) {
-            skip = true;
-            skippedSampels++;
-          }
-        }
-        if (!skip) {
-          ItemList row = new ItemList();
-          double estimated = evaluator.Evaluate(sample);
-          double original = dataset.GetValue(sample, targetVariable);
-         
-          row.Add(new DoubleData(estimated));
-          row.Add(new DoubleData(original));
-          values.Add(row);
-        }
+      var rows = from row in Enumerable.Range(start, end - start)
+                 // check if condition variable is true between sample - minTimeOffset and sample - maxTimeOffset
+                 // => select rows where the value of the condition variable is different from zero in the whole range
+                 where (from neighbour in Enumerable.Range(row + minTimeOffset, maxTimeOffset - minTimeOffset)
+                        let value = dataset.GetValue(neighbour, conditionVariable)
+                        where value == 0
+                        select neighbour).Any() == false
+                 select row;
+
+
+      double[] estimatedValues = evaluator.Evaluate(dataset, tree, rows).ToArray();
+      double[] originalValues = (from row in rows select dataset.GetValue(row, targetVariable)).ToArray();
+      for (int i = 0; i < rows.Count(); i++) {
+        ItemList row = new ItemList();
+        row.Add(new DoubleData(estimatedValues[i]));
+        row.Add(new DoubleData(originalValues[i]));
+        values.Add(row);
       }
-      scope.GetVariableValue<DoubleData>("TotalEvaluatedNodes", true).Data -= skippedSampels; 
+
+      scope.GetVariableValue<DoubleData>("TotalEvaluatedNodes", true).Data -= (end - start) - rows.Count();
     }
   }
Index: /trunk/sources/HeuristicLab.GP.StructureIdentification.TimeSeries/3.3/AveragePercentageChangeEvaluator.cs
===================================================================
--- /trunk/sources/HeuristicLab.GP.StructureIdentification.TimeSeries/3.3/AveragePercentageChangeEvaluator.cs	(revision 2577)
+++ /trunk/sources/HeuristicLab.GP.StructureIdentification.TimeSeries/3.3/AveragePercentageChangeEvaluator.cs	(revision 2578)
@@ -23,4 +23,7 @@
 using HeuristicLab.Core;
 using HeuristicLab.Data;
+using HeuristicLab.GP.Interfaces;
+using HeuristicLab.DataAnalysis;
+using System.Linq;
 
 namespace HeuristicLab.GP.StructureIdentification.TimeSeries {
@@ -38,5 +41,5 @@
     }
 
-    public override void Evaluate(IScope scope, ITreeEvaluator evaluator, HeuristicLab.DataAnalysis.Dataset dataset, int targetVariable, int start, int end) {
+    public override void Evaluate(IScope scope, IFunctionTree tree, ITreeEvaluator evaluator, Dataset dataset, int targetVariable, int start, int end) {
       bool differential = GetVariableValue<BoolData>("Differential", scope, true).Data;
       DoubleData apc = GetVariableValue<DoubleData>("APC", scope, false, false);
@@ -47,17 +50,19 @@
 
       double percentageSum = 0;
-      for (int sample = start; sample < end; sample++) {
+      double[] estimatedValues = evaluator.Evaluate(dataset, tree, Enumerable.Range(start, end - start)).ToArray();
+      double[] originalValues = dataset.GetVariableValues(targetVariable, start - 1, end);
+      for (int i = 0; i < estimatedValues.Length; i++) {
         double prevOriginal;
         double originalPercentageChange;
         double estimatedPercentageChange;
         if (differential) {
-          prevOriginal = dataset.GetValue(sample - 1, targetVariable);
-          originalPercentageChange = (dataset.GetValue(sample, targetVariable) - prevOriginal) / prevOriginal;
-          estimatedPercentageChange = (evaluator.Evaluate(sample) - prevOriginal) / prevOriginal;
-          
+          prevOriginal = originalValues[i];
+          originalPercentageChange = (originalValues[i + 1] - prevOriginal) / prevOriginal;
+          estimatedPercentageChange = (estimatedValues[i] - prevOriginal) / prevOriginal;
+
         } else {
-          originalPercentageChange = dataset.GetValue(sample, targetVariable);
-          estimatedPercentageChange = evaluator.Evaluate(sample);
-          
+          originalPercentageChange = originalValues[i + 1];
+          estimatedPercentageChange = estimatedValues[i];
+
         }
         if (!double.IsNaN(originalPercentageChange) && !double.IsInfinity(originalPercentageChange)) {
Index: /trunk/sources/HeuristicLab.GP.StructureIdentification.TimeSeries/3.3/ProfitEvaluator.cs
===================================================================
--- /trunk/sources/HeuristicLab.GP.StructureIdentification.TimeSeries/3.3/ProfitEvaluator.cs	(revision 2577)
+++ /trunk/sources/HeuristicLab.GP.StructureIdentification.TimeSeries/3.3/ProfitEvaluator.cs	(revision 2578)
@@ -22,4 +22,7 @@
 using HeuristicLab.Core;
 using HeuristicLab.Data;
+using HeuristicLab.GP.Interfaces;
+using HeuristicLab.DataAnalysis;
+using System.Linq;
 
 namespace HeuristicLab.GP.StructureIdentification.TimeSeries {
@@ -38,5 +41,5 @@
     }
 
-    public override void Evaluate(IScope scope, ITreeEvaluator evaluator, HeuristicLab.DataAnalysis.Dataset dataset, int targetVariable, int start, int end) {
+    public override void Evaluate(IScope scope, IFunctionTree tree, ITreeEvaluator evaluator, Dataset dataset, int targetVariable, int start, int end) {
       int exchangeRateVarIndex = GetVariableValue<IntData>("ExchangeRate", scope, true).Data;
       double transactionCost = GetVariableValue<DoubleData>("TransactionCost", scope, true).Data;
@@ -50,9 +53,12 @@
       double cB = 0;
       double exchangeRate = double.MaxValue;
-      for (int sample = start; sample < end; sample++) {
-        exchangeRate = dataset.GetValue(sample, exchangeRateVarIndex);
-        double originalPercentageChange = dataset.GetValue(sample, targetVariable);
-        double estimatedPercentageChange = evaluator.Evaluate(sample);
-        
+      double[] estimatedValues = evaluator.Evaluate(dataset, tree, Enumerable.Range(start, end - start)).ToArray();
+      double[] originalValues = dataset.GetVariableValues(targetVariable, start, end);
+      double[] exchangeRateValues = dataset.GetVariableValues(exchangeRateVarIndex, start, end);
+      for (int i = 0; i < estimatedValues.Length; i++) {
+        exchangeRate = exchangeRateValues[i];
+        double originalPercentageChange = originalValues[i];
+        double estimatedPercentageChange = estimatedValues[i];
+
         if (!double.IsNaN(originalPercentageChange) && !double.IsInfinity(originalPercentageChange)) {
           if (estimatedPercentageChange > 0) {
Index: /trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/BaseClasses/TreeEvaluatorBase.cs
===================================================================
--- /trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/BaseClasses/TreeEvaluatorBase.cs	(revision 2577)
+++ /trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/BaseClasses/TreeEvaluatorBase.cs	(revision 2578)
@@ -60,5 +60,6 @@
     }
 
-    public void PrepareForEvaluation(Dataset dataset, IFunctionTree functionTree) {
+    [Obsolete]
+    public virtual void PrepareForEvaluation(Dataset dataset, IFunctionTree functionTree) {
       this.dataset = dataset;
       codeArr = new Instr[functionTree.GetSize()];
@@ -94,5 +95,6 @@
     }
 
-    public double Evaluate(int sampleIndex) {
+    [Obsolete]
+    public virtual double Evaluate(int sampleIndex) {
       PC = 0;
       this.sampleIndex = sampleIndex;
@@ -101,4 +103,10 @@
       if (double.IsNaN(estimated)) estimated = UpperEvaluationLimit;
       return estimated;
+    }
+
+    public virtual IEnumerable<double> Evaluate(Dataset dataset, IFunctionTree tree, IEnumerable<int> rows) {
+      PrepareForEvaluation(dataset, tree);
+      foreach (int row in rows)
+        yield return Evaluate(row);
     }
 
Index: /trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Evaluators/EarlyStoppingMeanSquaredErrorEvaluator.cs
===================================================================
--- /trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Evaluators/EarlyStoppingMeanSquaredErrorEvaluator.cs	(revision 2577)
+++ /trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Evaluators/EarlyStoppingMeanSquaredErrorEvaluator.cs	(revision 2578)
@@ -22,4 +22,10 @@
 using HeuristicLab.Core;
 using HeuristicLab.Data;
+using System;
+using HeuristicLab.GP.Interfaces;
+using HeuristicLab.DataAnalysis;
+using System.Collections;
+using System.Collections.Generic;
+using System.Linq;
 
 namespace HeuristicLab.GP.StructureIdentification {
@@ -39,5 +45,5 @@
 
     // evaluates the function-tree for the given target-variable and the whole dataset and returns the MSE
-    public override void Evaluate(IScope scope, ITreeEvaluator evaluator, HeuristicLab.DataAnalysis.Dataset dataset, int targetVariable, int start, int end) {
+    public override void Evaluate(IScope scope, IFunctionTree tree, ITreeEvaluator evaluator, Dataset dataset, int targetVariable, int start, int end) {
       double qualityLimit = GetVariableValue<DoubleData>("QualityLimit", scope, true).Data;
       DoubleData mse = GetVariableValue<DoubleData>("MSE", scope, false, false);
@@ -46,22 +52,22 @@
         scope.AddVariable(new HeuristicLab.Core.Variable(scope.TranslateName("MSE"), mse));
       }
-
       double errorsSquaredSum = 0;
       int rows = end - start;
       int n = 0;
-      for (int sample = start; sample < end; sample++) {
-        double estimated = evaluator.Evaluate(sample);
+      int sample = start;
+      foreach (var estimatedValue in evaluator.Evaluate(dataset, tree, Enumerable.Range(start, end - start))) {
         double original = dataset.GetValue(sample, targetVariable);
-        
+
         if (!double.IsNaN(original) && !double.IsInfinity(original)) {
-          double error = estimated - original;
+          double error = estimatedValue - original;
           errorsSquaredSum += error * error;
           n++;
         }
-        // check the limit and stop as soon as we hit the limit
-        if (errorsSquaredSum / rows >= qualityLimit) {
+        // check the limit every 30 samples and stop as soon as we hit the limit
+        if (n % 30 == 29 && errorsSquaredSum / rows >= qualityLimit) {
           mse.Data = errorsSquaredSum / (n + 1); // return estimated MSE (when the remaining errors are on average the same)
           return;
         }
+        sample++;
       }
       errorsSquaredSum /= n;
Index: /trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Evaluators/GPEvaluatorBase.cs
===================================================================
--- /trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Evaluators/GPEvaluatorBase.cs	(revision 2577)
+++ /trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Evaluators/GPEvaluatorBase.cs	(revision 2578)
@@ -46,8 +46,7 @@
       int start = GetVariableValue<IntData>("SamplesStart", scope, true).Data;
       int end = GetVariableValue<IntData>("SamplesEnd", scope, true).Data;
+
       ITreeEvaluator evaluator = GetVariableValue<ITreeEvaluator>("TreeEvaluator", scope, true);
-      
-      evaluator.PrepareForEvaluation(dataset, gpModel.FunctionTree);
-      Evaluate(scope, evaluator, dataset, targetVariable, start, end);
+      Evaluate(scope, gpModel.FunctionTree, evaluator, dataset, targetVariable, start, end);
 
       // update the value of total evaluated nodes
@@ -56,5 +55,5 @@
     }
 
-    public abstract void Evaluate(IScope scope, ITreeEvaluator evaluator, Dataset dataset, int targetVariable, int start, int end);
+    public abstract void Evaluate(IScope scope, IFunctionTree tree, ITreeEvaluator evaluator, Dataset dataset, int targetVariable, int start, int end);
   }
 }
Index: /trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Evaluators/NodeBasedVariableImpactCalculator.cs
===================================================================
--- /trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Evaluators/NodeBasedVariableImpactCalculator.cs	(revision 2577)
+++ /trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Evaluators/NodeBasedVariableImpactCalculator.cs	(revision 2578)
@@ -138,10 +138,8 @@
 
     private static double CalculateMSE(Dataset dataset, ITreeEvaluator evaluator, IFunctionTree tree, int targetVariable, int start, int end) {
-      double[,] values = new double[end - start, 2];
-      evaluator.PrepareForEvaluation(dataset, tree);
-      for (int i = start; i < end; i++) {
-        values[i - start, 0] = dataset.GetValue(i, targetVariable);
-        values[i - start, 1] = evaluator.Evaluate(i);
-      }
+
+      double[,] values = Matrix<double>.Create(
+        dataset.GetVariableValues(targetVariable, start, end),
+        evaluator.Evaluate(dataset, tree, Enumerable.Range(start, end - start)).ToArray());
       return SimpleMSEEvaluator.Calculate(values);
     }
@@ -155,10 +153,5 @@
 
     private static double CalculateReplacementValue(Dataset dataset, ITreeEvaluator evaluator, IFunctionTree tree, int targetVariable, int start, int end) {
-      double[] values = new double[end - start];
-      evaluator.PrepareForEvaluation(dataset, tree);
-      for (int i = start; i < end; i++) {
-        values[i - start] = evaluator.Evaluate(i);
-      }
-      return Statistics.Median(values);
+      return Statistics.Median(evaluator.Evaluate(dataset, tree, Enumerable.Range(start, end - start)).ToArray());
     }
 
Index: /trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Evaluators/SimpleEvaluator.cs
===================================================================
--- /trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Evaluators/SimpleEvaluator.cs	(revision 2577)
+++ /trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Evaluators/SimpleEvaluator.cs	(revision 2578)
@@ -23,4 +23,7 @@
 using HeuristicLab.Data;
 using HeuristicLab.DataAnalysis;
+using HeuristicLab.GP.Interfaces;
+using HeuristicLab.Modeling;
+using System.Linq;
 
 namespace HeuristicLab.GP.StructureIdentification {
@@ -31,5 +34,5 @@
     }
 
-    public override void Evaluate(IScope scope, ITreeEvaluator evaluator, Dataset dataset, int targetVariable, int start, int end) {
+    public override void Evaluate(IScope scope, IFunctionTree tree, ITreeEvaluator evaluator, Dataset dataset, int targetVariable, int start, int end) {
       DoubleMatrixData values = GetVariableValue<DoubleMatrixData>("Values", scope, false, false);
       if (values == null) {
@@ -42,13 +45,7 @@
       }
 
-      double[,] v = new double[end - start, 2];
-
-      for (int sample = start; sample < end; sample++) {
-        double estimated = evaluator.Evaluate(sample);
-        double original = dataset.GetValue(sample, targetVariable);
-        
-        v[sample - start, 0] = original;
-        v[sample - start, 1] = estimated;
-      }
+      double[,] v = Matrix<double>.Create(
+        dataset.GetVariableValues(targetVariable, start, end),
+        evaluator.Evaluate(dataset, tree, Enumerable.Range(start, end - start)).ToArray());
       values.Data = v;
     }
Index: /trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Evaluators/SimpleGPEvaluatorBase.cs
===================================================================
--- /trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Evaluators/SimpleGPEvaluatorBase.cs	(revision 2577)
+++ /trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Evaluators/SimpleGPEvaluatorBase.cs	(revision 2578)
@@ -23,4 +23,7 @@
 using HeuristicLab.Data;
 using HeuristicLab.DataAnalysis;
+using HeuristicLab.Modeling;
+using HeuristicLab.GP.Interfaces;
+using System.Linq;
 
 namespace HeuristicLab.GP.StructureIdentification {
@@ -33,14 +36,9 @@
     }
 
-    public override void Evaluate(IScope scope, ITreeEvaluator evaluator, Dataset dataset, int targetVariable, int start, int end) {
+    public override void Evaluate(IScope scope, IFunctionTree tree, ITreeEvaluator evaluator, Dataset dataset, int targetVariable, int start, int end) {
       // store original and estimated values in a double array
-      double[,] values = new double[end - start, 2];
-      for (int sample = start; sample < end; sample++) {
-        double original = dataset.GetValue(sample, targetVariable);
-        double estimated = evaluator.Evaluate(sample);
-        
-        values[sample - start, 0] = estimated;
-        values[sample - start, 1] = original;
-      }
+      double[,] values = Matrix<double>.Create(
+        dataset.GetVariableValues(targetVariable, start, end),
+        evaluator.Evaluate(dataset, tree, Enumerable.Range(start, end - start)).ToArray());
 
       double quality = Evaluate(values);
Index: /trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Evaluators/UncertainMeanSquaredErrorEvaluator.cs
===================================================================
--- /trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Evaluators/UncertainMeanSquaredErrorEvaluator.cs	(revision 2577)
+++ /trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Evaluators/UncertainMeanSquaredErrorEvaluator.cs	(revision 2578)
@@ -24,4 +24,7 @@
 using HeuristicLab.Data;
 using HeuristicLab.Random;
+using HeuristicLab.GP.Interfaces;
+using System.Collections.Generic;
+using System.Linq;
 
 namespace HeuristicLab.GP.StructureIdentification {
@@ -45,5 +48,5 @@
 
     // evaluates the function-tree for the given target-variable and the whole dataset and returns the MSE
-    public override void Evaluate(IScope scope, ITreeEvaluator evaluator, HeuristicLab.DataAnalysis.Dataset dataset, int targetVariable, int start, int end) {
+    public override void Evaluate(IScope scope, IFunctionTree tree, ITreeEvaluator evaluator, HeuristicLab.DataAnalysis.Dataset dataset, int targetVariable, int start, int end) {
       double qualityLimit = GetVariableValue<DoubleData>("QualityLimit", scope, true).Data;
       int minSamples = GetVariableValue<IntData>("MinEvaluatedSamples", scope, true).Data;
@@ -72,6 +75,6 @@
       int[] indexes = InitIndexes(mt, start, end);
       int n = 0;
-      for (int sample = 0; sample < rows; sample++) {
-        double estimated = evaluator.Evaluate(indexes[sample]);
+      int sample = 0;
+      foreach (double estimated in evaluator.Evaluate(dataset, tree, indexes)) {
         double original = dataset.GetValue(indexes[sample], targetVariable);
         if (!double.IsNaN(original) && !double.IsInfinity(original)) {
@@ -91,4 +94,5 @@
           }
         }
+        sample++;
       }
 
Index: /trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/HL2TreeEvaluator.cs
===================================================================
--- /trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/HL2TreeEvaluator.cs	(revision 2577)
+++ /trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/HL2TreeEvaluator.cs	(revision 2578)
@@ -31,4 +31,5 @@
     public HL2TreeEvaluator(double minValue, double maxValue) : base(minValue, maxValue) { }
 
+    [Obsolete]
     protected override double EvaluateBakedCode() {
       Instr currInstr = codeArr[PC++];
Index: /trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/HL3TreeEvaluator.cs
===================================================================
--- /trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/HL3TreeEvaluator.cs	(revision 2577)
+++ /trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/HL3TreeEvaluator.cs	(revision 2578)
@@ -33,4 +33,5 @@
     public HL3TreeEvaluator(double minValue, double maxValue) : base(minValue, maxValue) { }
 
+    [Obsolete]
     protected override double EvaluateBakedCode() {
       Instr currInstr = codeArr[PC++];
Index: /trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/ITreeEvaluator.cs
===================================================================
--- /trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/ITreeEvaluator.cs	(revision 2577)
+++ /trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/ITreeEvaluator.cs	(revision 2578)
@@ -23,4 +23,6 @@
 using HeuristicLab.DataAnalysis;
 using HeuristicLab.GP.Interfaces;
+using System;
+using System.Collections.Generic;
 
 namespace HeuristicLab.GP.StructureIdentification {
@@ -28,6 +30,9 @@
     double LowerEvaluationLimit { get; set; }
     double UpperEvaluationLimit { get; set; }
+    [Obsolete]
     void PrepareForEvaluation(Dataset dataset, IFunctionTree functionTree);
+    [Obsolete]
     double Evaluate(int sampleIndex);
+    IEnumerable<double> Evaluate(Dataset dataset, IFunctionTree functionTree, IEnumerable<int> rows);
   }
 }
