Index: branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/InteractiveSymbolicRegressionSolutionSimplifierView.cs
===================================================================
--- branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/InteractiveSymbolicRegressionSolutionSimplifierView.cs	(revision 17633)
+++ branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/InteractiveSymbolicRegressionSolutionSimplifierView.cs	(revision 17786)
@@ -46,4 +46,6 @@
       btnVectorOptimizeConstants.Enabled = tree != null && TensorFlowConstantOptimizationEvaluator.CanOptimizeConstants(tree);
       nudLearningRate.Enabled = tree != null && TensorFlowConstantOptimizationEvaluator.CanOptimizeConstants(tree);
+      btnUnrollingVectorOptimizeConstants.Enabled = tree != null && VectorUnrollingNonlinearLeastSquaresConstantOptimizationEvaluator.CanOptimizeConstants(tree);
+      btnDiffSharpOptimizeConstants.Enabled = tree != null && NonlinearLeastSquaresVectorConstantOptimizationEvaluator.CanOptimizeConstants(tree);
     }
 
@@ -102,4 +104,67 @@
     }
 
+    protected override ISymbolicExpressionTree UnrollingVectorOptimizeConstants(ISymbolicExpressionTree tree, CancellationToken cancellationToken, IProgress progress) {
+      const int constOptIterations = 50;
+      const int maxRepetitions = 100;
+      const double minimumImprovement = 1e-10;
+      var regressionProblemData = Content.ProblemData;
+      var model = Content.Model;
+      progress.CanBeStopped = true;
+      double prevResult = 0.0, improvement = 0.0;
+      var result = 0.0;
+      int reps = 0;
+      var interpreter = new SymbolicDataAnalysisExpressionTreeVectorInterpreter();
+
+      do {
+        prevResult = result;
+        tree = VectorUnrollingNonlinearLeastSquaresConstantOptimizationEvaluator.OptimizeTree(
+          tree, interpreter,
+          regressionProblemData, regressionProblemData.TrainingIndices,
+          applyLinearScaling: true, maxIterations: constOptIterations, updateVariableWeights: true,
+          cancellationToken: cancellationToken, iterationCallback: (args, func, obj) => {
+            double newProgressValue = progress.ProgressValue + (1.0 / (constOptIterations + 2) / maxRepetitions); // (constOptIterations + 2) iterations are reported
+            progress.ProgressValue = Math.Min(newProgressValue, 1.0);
+          });
+        result = SymbolicRegressionSingleObjectivePearsonRSquaredEvaluator.Calculate(model.Interpreter, tree,
+          model.LowerEstimationLimit, model.UpperEstimationLimit, regressionProblemData, regressionProblemData.TrainingIndices, applyLinearScaling: true);
+        reps++;
+        improvement = result - prevResult;
+      } while (improvement > minimumImprovement && reps < maxRepetitions &&
+               progress.ProgressState != ProgressState.StopRequested &&
+               progress.ProgressState != ProgressState.CancelRequested);
+      return tree;
+    }
+
+
+    protected override ISymbolicExpressionTree DiffSharpVectorOptimizeConstants(ISymbolicExpressionTree tree, CancellationToken cancellationToken, IProgress progress) {
+      const int constOptIterations = 50;
+      const int maxRepetitions = 100;
+      const double minimumImprovement = 1e-10;
+      var regressionProblemData = Content.ProblemData;
+      var model = Content.Model;
+      progress.CanBeStopped = true;
+      double prevResult = 0.0, improvement = 0.0;
+      var result = 0.0;
+      int reps = 0;
+
+      do {
+        prevResult = result;
+        tree = NonlinearLeastSquaresVectorConstantOptimizationEvaluator.OptimizeTree(tree, regressionProblemData, regressionProblemData.TrainingIndices,
+          applyLinearScaling: true, maxIterations: constOptIterations, updateVariableWeights: true,
+          cancellationToken: cancellationToken, iterationCallback: (args, func, obj) => {
+            double newProgressValue = progress.ProgressValue + (1.0 / (constOptIterations + 2) / maxRepetitions); // (constOptIterations + 2) iterations are reported
+            progress.ProgressValue = Math.Min(newProgressValue, 1.0);
+          });
+        result = SymbolicRegressionSingleObjectivePearsonRSquaredEvaluator.Calculate(model.Interpreter, tree,
+          model.LowerEstimationLimit, model.UpperEstimationLimit, regressionProblemData, regressionProblemData.TrainingIndices, applyLinearScaling: true);
+        reps++;
+        improvement = result - prevResult;
+      } while (improvement > minimumImprovement && reps < maxRepetitions &&
+               progress.ProgressState != ProgressState.StopRequested &&
+               progress.ProgressState != ProgressState.CancelRequested);
+      return tree;
+    }
+
+
     internal class SynchronousProgress<T> : IProgress<T> {
       private readonly Action<T> callback;
