Index: /branches/SimplifierViewsProgress/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/InteractiveSymbolicRegressionSolutionSimplifierView.cs
===================================================================
--- /branches/SimplifierViewsProgress/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/InteractiveSymbolicRegressionSolutionSimplifierView.cs	(revision 15318)
+++ /branches/SimplifierViewsProgress/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/InteractiveSymbolicRegressionSolutionSimplifierView.cs	(revision 15319)
@@ -22,5 +22,5 @@
 using System;
 using System.Collections.Generic;
-using System.Linq;
+using System.Threading.Tasks;
 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
 using HeuristicLab.Problems.DataAnalysis.Symbolic.Views;
@@ -54,4 +54,5 @@
         double impactValue, replacementValue, newQualityForImpactsCalculation;
         calculator.CalculateImpactAndReplacementValues(Content.Model, node, Content.ProblemData, Content.ProblemData.TrainingIndices, out impactValue, out replacementValue, out newQualityForImpactsCalculation);
+        Progress.ProgressValue += 1.0 / (tree.Length - 2);
         impactAndReplacementValues.Add(node, new Tuple<double, double>(impactValue, replacementValue));
       }
@@ -59,9 +60,16 @@
     }
 
-    protected override void btnOptimizeConstants_Click(object sender, EventArgs e) {
+    protected override async void btnOptimizeConstants_Click(object sender, EventArgs e) {
+      const int constOptIterations = 50;
       var model = Content.Model;
-      SymbolicRegressionConstantOptimizationEvaluator.OptimizeConstants(model.Interpreter, model.SymbolicExpressionTree, Content.ProblemData, Content.ProblemData.TrainingIndices,
-        applyLinearScaling: true, maxIterations: 50, updateVariableWeights: true, lowerEstimationLimit: model.LowerEstimationLimit, upperEstimationLimit: model.UpperEstimationLimit);
-      UpdateModel(Content.Model.SymbolicExpressionTree);
+      Progress.Start("Optimizing Constants ...", 0);
+      await Task.Run(() => {
+        SymbolicRegressionConstantOptimizationEvaluator.OptimizeConstants(model.Interpreter, model.SymbolicExpressionTree, Content.ProblemData, Content.ProblemData.TrainingIndices,
+          applyLinearScaling: true, maxIterations: constOptIterations, updateVariableWeights: true, lowerEstimationLimit: model.LowerEstimationLimit, upperEstimationLimit: model.UpperEstimationLimit,
+          iterationReport: (args, func, iter) => {
+            Progress.ProgressValue = (double)iter / (constOptIterations + 1); // (maxIterations + 1) iterations are reported
+          });
+      });
+      UpdateModel(Content.Model.SymbolicExpressionTree); // UpdateModel calls Progress.Finish
     }
   }
Index: /branches/SimplifierViewsProgress/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/SymbolicRegressionSolutionView.cs
===================================================================
--- /branches/SimplifierViewsProgress/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/SymbolicRegressionSolutionView.cs	(revision 15318)
+++ /branches/SimplifierViewsProgress/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/SymbolicRegressionSolutionView.cs	(revision 15319)
@@ -51,6 +51,6 @@
     private void btn_SimplifyModel_Click(object sender, EventArgs e) {
       var view = new InteractiveSymbolicRegressionSolutionSimplifierView();
+      view.Show(); // open view first that a progress can be displayed when setting the content
       view.Content = (SymbolicRegressionSolution)this.Content.Clone();
-      view.Show();
     }
 
Index: /branches/SimplifierViewsProgress/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators/SymbolicRegressionConstantOptimizationEvaluator.cs
===================================================================
--- /branches/SimplifierViewsProgress/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators/SymbolicRegressionConstantOptimizationEvaluator.cs	(revision 15318)
+++ /branches/SimplifierViewsProgress/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators/SymbolicRegressionConstantOptimizationEvaluator.cs	(revision 15319)
@@ -156,5 +156,5 @@
       int maxIterations, bool updateVariableWeights = true,
       double lowerEstimationLimit = double.MinValue, double upperEstimationLimit = double.MaxValue,
-      bool updateConstantsInTree = true) {
+      bool updateConstantsInTree = true, Action<double[], double, int> iterationReport = null) {
 
       // numeric constants in the tree become variables for constant opt
@@ -211,15 +211,19 @@
       alglib.ndimensional_pgrad function_cx_1_grad = CreatePGrad(func_grad);
 
+      int i = 0;
+      var xrep = new alglib.ndimensional_rep((a, f, o) => {
+        if (iterationReport != null) iterationReport(a, f, i++);
+      });
+
       try {
         alglib.lsfitcreatefg(x, y, c, n, m, k, false, out state);
         alglib.lsfitsetcond(state, 0.0, 0.0, maxIterations);
+        alglib.lsfitsetxrep(state, iterationReport != null);
         //alglib.lsfitsetgradientcheck(state, 0.001);
-        alglib.lsfitfit(state, function_cx_1_func, function_cx_1_grad, null, null);
+        alglib.lsfitfit(state, function_cx_1_func, function_cx_1_grad, xrep, null);
         alglib.lsfitresults(state, out retVal, out c, out rep);
-      }
-      catch (ArithmeticException) {
+      } catch (ArithmeticException) {
         return originalQuality;
-      }
-      catch (alglib.alglibexception) {
+      } catch (alglib.alglibexception) {
         return originalQuality;
       }
Index: /branches/SimplifierViewsProgress/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/InteractiveSymbolicDataAnalysisSolutionSimplifierView.cs
===================================================================
--- /branches/SimplifierViewsProgress/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/InteractiveSymbolicDataAnalysisSolutionSimplifierView.cs	(revision 15318)
+++ /branches/SimplifierViewsProgress/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/InteractiveSymbolicDataAnalysisSolutionSimplifierView.cs	(revision 15319)
@@ -24,8 +24,10 @@
 using System.Drawing;
 using System.Linq;
+using System.Threading.Tasks;
 using System.Windows.Forms;
 using HeuristicLab.Common;
 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views;
+using HeuristicLab.MainForm;
 using HeuristicLab.MainForm.WindowsForms;
 
@@ -35,4 +37,6 @@
     private Dictionary<ISymbolicExpressionTreeNode, ISymbolicExpressionTreeNode> changedNodes;
     private Dictionary<ISymbolicExpressionTreeNode, double> nodeImpacts;
+
+    protected IProgress Progress = new Progress();
 
     private enum TreeState { Valid, Invalid }
@@ -145,4 +149,5 @@
       Content.ProblemDataChanged += Content_Changed;
       treeChart.Repainted += treeChart_Repainted;
+      MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>().AddOperationProgressToView(grpSimplify, Progress);
     }
     protected override void DeregisterContentEvents() {
@@ -151,4 +156,5 @@
       Content.ProblemDataChanged -= Content_Changed;
       treeChart.Repainted -= treeChart_Repainted;
+      MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>().RemoveOperationProgressFromView(grpSimplify, false);
     }
 
@@ -169,10 +175,11 @@
     }
 
-    private void UpdateView() {
+    private async void UpdateView() {
       if (Content == null || Content.Model == null || Content.ProblemData == null) return;
       var tree = Content.Model.SymbolicExpressionTree;
       treeChart.Tree = tree.Root.SubtreeCount > 1 ? new SymbolicExpressionTree(tree.Root) : new SymbolicExpressionTree(tree.Root.GetSubtree(0).GetSubtree(0));
 
-      var impactAndReplacementValues = CalculateImpactAndReplacementValues(tree);
+      Progress.Start("Calculate Impact and Replacement Values ...", 0);
+      var impactAndReplacementValues = await Task.Run(() => CalculateImpactAndReplacementValues(tree));
       var replacementValues = impactAndReplacementValues.ToDictionary(x => x.Key, x => x.Value.Item2);
       foreach (var pair in replacementValues.Where(pair => !(pair.Key is ConstantTreeNode))) {
@@ -180,4 +187,5 @@
       }
       nodeImpacts = impactAndReplacementValues.ToDictionary(x => x.Key, x => x.Value.Item1);
+      Progress.Finish();
       PaintNodeImpacts();
     }
