Index: /branches/2994-AutoDiffForIntervals/HeuristicLab 3.3.sln
===================================================================
--- /branches/2994-AutoDiffForIntervals/HeuristicLab 3.3.sln	(revision 16695)
+++ /branches/2994-AutoDiffForIntervals/HeuristicLab 3.3.sln	(revision 16696)
@@ -464,4 +464,6 @@
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests", "Tests\Tests.csproj", "{792B51DB-F5AC-4EED-B165-8E57057413B4}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Algorithms.DataAnalysis.ConstrainedNonlinearRegression-3.4", "HeuristicLab.Algorithms.DataAnalysis.ConstrainedNonlinearRegression\3.4\HeuristicLab.Algorithms.DataAnalysis.ConstrainedNonlinearRegression-3.4.csproj", "{E4CED29F-964F-42AE-B400-AA00D0229CE5}"
 EndProject
 Global
@@ -2263,4 +2265,16 @@
 		{792B51DB-F5AC-4EED-B165-8E57057413B4}.Release|x86.ActiveCfg = Release|Any CPU
 		{792B51DB-F5AC-4EED-B165-8E57057413B4}.Release|x86.Build.0 = Release|Any CPU
+		{E4CED29F-964F-42AE-B400-AA00D0229CE5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{E4CED29F-964F-42AE-B400-AA00D0229CE5}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{E4CED29F-964F-42AE-B400-AA00D0229CE5}.Debug|x64.ActiveCfg = Debug|Any CPU
+		{E4CED29F-964F-42AE-B400-AA00D0229CE5}.Debug|x64.Build.0 = Debug|Any CPU
+		{E4CED29F-964F-42AE-B400-AA00D0229CE5}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{E4CED29F-964F-42AE-B400-AA00D0229CE5}.Debug|x86.Build.0 = Debug|Any CPU
+		{E4CED29F-964F-42AE-B400-AA00D0229CE5}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{E4CED29F-964F-42AE-B400-AA00D0229CE5}.Release|Any CPU.Build.0 = Release|Any CPU
+		{E4CED29F-964F-42AE-B400-AA00D0229CE5}.Release|x64.ActiveCfg = Release|Any CPU
+		{E4CED29F-964F-42AE-B400-AA00D0229CE5}.Release|x64.Build.0 = Release|Any CPU
+		{E4CED29F-964F-42AE-B400-AA00D0229CE5}.Release|x86.ActiveCfg = Release|Any CPU
+		{E4CED29F-964F-42AE-B400-AA00D0229CE5}.Release|x86.Build.0 = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
Index: /branches/2994-AutoDiffForIntervals/HeuristicLab.Algorithms.DataAnalysis.ConstrainedNonlinearRegression/3.4/ConstrainedNonlinearRegression.cs
===================================================================
--- /branches/2994-AutoDiffForIntervals/HeuristicLab.Algorithms.DataAnalysis.ConstrainedNonlinearRegression/3.4/ConstrainedNonlinearRegression.cs	(revision 16696)
+++ /branches/2994-AutoDiffForIntervals/HeuristicLab.Algorithms.DataAnalysis.ConstrainedNonlinearRegression/3.4/ConstrainedNonlinearRegression.cs	(revision 16696)
@@ -0,0 +1,507 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading;
+using HeuristicLab.Analysis;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HEAL.Attic;
+using HeuristicLab.Problems.DataAnalysis;
+using HeuristicLab.Problems.DataAnalysis.Symbolic;
+using HeuristicLab.Problems.DataAnalysis.Symbolic.Regression;
+using HeuristicLab.Random;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+
+namespace HeuristicLab.Algorithms.DataAnalysis {
+  /// <summary>
+  /// Nonlinear regression data analysis algorithm.
+  /// </summary>
+  [Item("Nonlinear Regression with Constraints (NLR)", "Nonlinear regression (curve fitting) data analysis algorithm that supports interval constraints.")]
+  [Creatable(CreatableAttribute.Categories.DataAnalysisRegression, Priority = 120)]
+  [StorableType("B235DB6E-591F-4537-8D2F-C2D1232AAEFD")]
+  public sealed class ConstrainedNonlinearRegression : FixedDataAnalysisAlgorithm<IRegressionProblem> {
+    private const string RegressionSolutionResultName = "Regression solution";
+    private const string ModelStructureParameterName = "Model structure";
+    private const string IterationsParameterName = "Iterations";
+    private const string RestartsParameterName = "Restarts";
+    private const string SetSeedRandomlyParameterName = "SetSeedRandomly";
+    private const string SeedParameterName = "Seed";
+    private const string InitParamsRandomlyParameterName = "InitializeParametersRandomly";
+    private const string ApplyLinearScalingParameterName = "Apply linear scaling";
+
+    public IFixedValueParameter<StringValue> ModelStructureParameter {
+      get { return (IFixedValueParameter<StringValue>)Parameters[ModelStructureParameterName]; }
+    }
+    public IFixedValueParameter<IntValue> IterationsParameter {
+      get { return (IFixedValueParameter<IntValue>)Parameters[IterationsParameterName]; }
+    }
+
+    public IFixedValueParameter<BoolValue> SetSeedRandomlyParameter {
+      get { return (IFixedValueParameter<BoolValue>)Parameters[SetSeedRandomlyParameterName]; }
+    }
+
+    public IFixedValueParameter<IntValue> SeedParameter {
+      get { return (IFixedValueParameter<IntValue>)Parameters[SeedParameterName]; }
+    }
+
+    public IFixedValueParameter<IntValue> RestartsParameter {
+      get { return (IFixedValueParameter<IntValue>)Parameters[RestartsParameterName]; }
+    }
+
+    public IFixedValueParameter<BoolValue> InitParametersRandomlyParameter {
+      get { return (IFixedValueParameter<BoolValue>)Parameters[InitParamsRandomlyParameterName]; }
+    }
+
+    public IFixedValueParameter<BoolValue> ApplyLinearScalingParameter {
+      get { return (IFixedValueParameter<BoolValue>)Parameters[ApplyLinearScalingParameterName]; }
+    }
+
+    public string ModelStructure {
+      get { return ModelStructureParameter.Value.Value; }
+      set { ModelStructureParameter.Value.Value = value; }
+    }
+
+    public int Iterations {
+      get { return IterationsParameter.Value.Value; }
+      set { IterationsParameter.Value.Value = value; }
+    }
+
+    public int Restarts {
+      get { return RestartsParameter.Value.Value; }
+      set { RestartsParameter.Value.Value = value; }
+    }
+
+    public int Seed {
+      get { return SeedParameter.Value.Value; }
+      set { SeedParameter.Value.Value = value; }
+    }
+
+    public bool SetSeedRandomly {
+      get { return SetSeedRandomlyParameter.Value.Value; }
+      set { SetSeedRandomlyParameter.Value.Value = value; }
+    }
+
+    public bool InitializeParametersRandomly {
+      get { return InitParametersRandomlyParameter.Value.Value; }
+      set { InitParametersRandomlyParameter.Value.Value = value; }
+    }
+
+    public bool ApplyLinearScaling {
+      get { return ApplyLinearScalingParameter.Value.Value; }
+      set { ApplyLinearScalingParameter.Value.Value = value; }
+    }
+
+    [StorableConstructor]
+    private ConstrainedNonlinearRegression(StorableConstructorFlag _) : base(_) { }
+    private ConstrainedNonlinearRegression(ConstrainedNonlinearRegression original, Cloner cloner)
+      : base(original, cloner) {
+    }
+    public ConstrainedNonlinearRegression()
+      : base() {
+      Problem = new RegressionProblem();
+      Parameters.Add(new FixedValueParameter<StringValue>(ModelStructureParameterName, "The function for which the parameters must be fit (only numeric constants are tuned).", new StringValue("1.0 * x*x + 0.0")));
+      Parameters.Add(new FixedValueParameter<IntValue>(IterationsParameterName, "The maximum number of iterations for constants optimization.", new IntValue(200)));
+      Parameters.Add(new FixedValueParameter<IntValue>(RestartsParameterName, "The number of independent random restarts (>0)", new IntValue(10)));
+      Parameters.Add(new FixedValueParameter<IntValue>(SeedParameterName, "The PRNG seed value.", new IntValue()));
+      Parameters.Add(new FixedValueParameter<BoolValue>(SetSeedRandomlyParameterName, "Switch to determine if the random number seed should be initialized randomly.", new BoolValue(true)));
+      Parameters.Add(new FixedValueParameter<BoolValue>(InitParamsRandomlyParameterName, "Switch to determine if the real-valued model parameters should be initialized randomly in each restart.", new BoolValue(false)));
+      Parameters.Add(new FixedValueParameter<BoolValue>(ApplyLinearScalingParameterName, "Switch to determine if linear scaling terms should be added to the model", new BoolValue(true)));
+
+      SetParameterHiddenState();
+
+      InitParametersRandomlyParameter.Value.ValueChanged += (sender, args) => {
+        SetParameterHiddenState();
+      };
+    }
+
+    private void SetParameterHiddenState() {
+      var hide = !InitializeParametersRandomly;
+      RestartsParameter.Hidden = hide;
+      SeedParameter.Hidden = hide;
+      SetSeedRandomlyParameter.Hidden = hide;
+    }
+
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      SetParameterHiddenState();
+      InitParametersRandomlyParameter.Value.ValueChanged += (sender, args) => {
+        SetParameterHiddenState();
+      };
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new ConstrainedNonlinearRegression(this, cloner);
+    }
+
+    #region nonlinear regression
+    protected override void Run(CancellationToken cancellationToken) {
+      IRegressionSolution bestSolution = null;
+      if (InitializeParametersRandomly) {
+        var qualityTable = new DataTable("RMSE table");
+        qualityTable.VisualProperties.YAxisLogScale = true;
+        var trainRMSERow = new DataRow("RMSE (train)");
+        trainRMSERow.VisualProperties.ChartType = DataRowVisualProperties.DataRowChartType.Points;
+        var testRMSERow = new DataRow("RMSE test");
+        testRMSERow.VisualProperties.ChartType = DataRowVisualProperties.DataRowChartType.Points;
+
+        qualityTable.Rows.Add(trainRMSERow);
+        qualityTable.Rows.Add(testRMSERow);
+        Results.Add(new Result(qualityTable.Name, qualityTable.Name + " for all restarts", qualityTable));
+        if (SetSeedRandomly) Seed = RandomSeedGenerator.GetSeed();
+        var rand = new MersenneTwister((uint)Seed);
+        bestSolution = CreateRegressionSolution((RegressionProblemData)Problem.ProblemData, ModelStructure, Iterations, ApplyLinearScaling, rand);
+        trainRMSERow.Values.Add(bestSolution.TrainingRootMeanSquaredError);
+        testRMSERow.Values.Add(bestSolution.TestRootMeanSquaredError);
+        for (int r = 0; r < Restarts; r++) {
+          var solution = CreateRegressionSolution((RegressionProblemData)Problem.ProblemData, ModelStructure, Iterations, ApplyLinearScaling, rand);
+          trainRMSERow.Values.Add(solution.TrainingRootMeanSquaredError);
+          testRMSERow.Values.Add(solution.TestRootMeanSquaredError);
+          if (solution.TrainingRootMeanSquaredError < bestSolution.TrainingRootMeanSquaredError) {
+            bestSolution = solution;
+          }
+        }
+      } else {
+        bestSolution = CreateRegressionSolution((RegressionProblemData)Problem.ProblemData, ModelStructure, Iterations, ApplyLinearScaling);
+      }
+
+      Results.Add(new Result(RegressionSolutionResultName, "The nonlinear regression solution.", bestSolution));
+      Results.Add(new Result("Root mean square error (train)", "The root of the mean of squared errors of the regression solution on the training set.", new DoubleValue(bestSolution.TrainingRootMeanSquaredError)));
+      Results.Add(new Result("Root mean square error (test)", "The root of the mean of squared errors of the regression solution on the test set.", new DoubleValue(bestSolution.TestRootMeanSquaredError)));
+
+    }
+
+    /// <summary>
+    /// Fits a model to the data by optimizing the numeric constants.
+    /// Model is specified as infix expression containing variable names and numbers. 
+    /// The starting point for the numeric constants is initialized randomly if a random number generator is specified (~N(0,1)). Otherwise the user specified constants are
+    /// used as a starting point. 
+    /// </summary>-
+    /// <param name="problemData">Training and test data</param>
+    /// <param name="modelStructure">The function as infix expression</param>
+    /// <param name="maxIterations">Number of constant optimization iterations (using Levenberg-Marquardt algorithm)</param>
+    /// <param name="random">Optional random number generator for random initialization of numeric constants.</param>
+    /// <returns></returns>
+    public static ISymbolicRegressionSolution CreateRegressionSolution(RegressionProblemData problemData, string modelStructure, int maxIterations, bool applyLinearScaling, IRandom rand = null) {
+      var parser = new InfixExpressionParser();
+      var tree = parser.Parse(modelStructure);
+      // parser handles double and string variables equally by creating a VariableTreeNode
+      // post-process to replace VariableTreeNodes by FactorVariableTreeNodes for all string variables
+      var factorSymbol = new FactorVariable();
+      factorSymbol.VariableNames =
+        problemData.AllowedInputVariables.Where(name => problemData.Dataset.VariableHasType<string>(name));
+      factorSymbol.AllVariableNames = factorSymbol.VariableNames;
+      factorSymbol.VariableValues =
+        factorSymbol.VariableNames.Select(name =>
+        new KeyValuePair<string, Dictionary<string, int>>(name,
+        problemData.Dataset.GetReadOnlyStringValues(name).Distinct()
+        .Select((n, i) => Tuple.Create(n, i))
+        .ToDictionary(tup => tup.Item1, tup => tup.Item2)));
+
+      foreach (var parent in tree.IterateNodesPrefix().ToArray()) {
+        for (int i = 0; i < parent.SubtreeCount; i++) {
+          var varChild = parent.GetSubtree(i) as VariableTreeNode;
+          var factorVarChild = parent.GetSubtree(i) as FactorVariableTreeNode;
+          if (varChild != null && factorSymbol.VariableNames.Contains(varChild.VariableName)) {
+            parent.RemoveSubtree(i);
+            var factorTreeNode = (FactorVariableTreeNode)factorSymbol.CreateTreeNode();
+            factorTreeNode.VariableName = varChild.VariableName;
+            factorTreeNode.Weights =
+              factorTreeNode.Symbol.GetVariableValues(factorTreeNode.VariableName).Select(_ => 1.0).ToArray();
+            // weight = 1.0 for each value
+            parent.InsertSubtree(i, factorTreeNode);
+          } else if (factorVarChild != null && factorSymbol.VariableNames.Contains(factorVarChild.VariableName)) {
+            if (factorSymbol.GetVariableValues(factorVarChild.VariableName).Count() != factorVarChild.Weights.Length)
+              throw new ArgumentException(
+                string.Format("Factor variable {0} needs exactly {1} weights",
+                factorVarChild.VariableName,
+                factorSymbol.GetVariableValues(factorVarChild.VariableName).Count()));
+            parent.RemoveSubtree(i);
+            var factorTreeNode = (FactorVariableTreeNode)factorSymbol.CreateTreeNode();
+            factorTreeNode.VariableName = factorVarChild.VariableName;
+            factorTreeNode.Weights = factorVarChild.Weights;
+            parent.InsertSubtree(i, factorTreeNode);
+          }
+        }
+      }
+
+      // var interpreter = new SymbolicDataAnalysisExpressionTreeLinearInterpreter();
+      // 
+      // SymbolicRegressionConstantOptimizationEvaluator.OptimizeConstants(interpreter, tree, problemData, problemData.TrainingIndices,
+      //   applyLinearScaling: applyLinearScaling, maxIterations: maxIterations,
+      //   updateVariableWeights: false, updateConstantsInTree: true);
+
+
+      var intervals = problemData.IntervalConstraints;
+      var constraintsParser = new IntervalConstraintsParser();
+      var constraints = constraintsParser.Parse(intervals.Value);
+      var dataIntervals = problemData.VariableRanges.VariableIntervals;
+
+      // convert constants to variables named theta...
+      var treeForDerivation = ReplaceConstWithVar(tree, out List<string> thetaNames, out List<double> thetaValues);
+
+      // create trees for relevant derivatives
+      Dictionary<string, ISymbolicExpressionTree> derivatives = new Dictionary<string, ISymbolicExpressionTree>();
+      var allThetaNodes = thetaNames.Select(_ => new List<ConstantTreeNode>()).ToArray();
+      var constraintTrees = new List<ISymbolicExpressionTree>();
+      foreach (var constraint in constraints) {
+        if (constraint.IsDerivation) {
+          var df = DerivativeCalculator.Derive(treeForDerivation, constraint.Variable);
+
+          // alglib requires constraint expressions of the form c(x) <= 0
+          // -> we make two expressions, one for the lower bound and one for the upper bound
+
+          if (constraint.Interval.UpperBound < double.PositiveInfinity) {
+            var df_smaller_upper = Subtract((ISymbolicExpressionTree)df.Clone(), CreateConstant(constraint.Interval.UpperBound));
+            // convert variables named theta back to constants
+            var df_prepared = ReplaceVarWithConst(df_smaller_upper, thetaNames, thetaValues, allThetaNodes);
+            constraintTrees.Add(df_prepared);
+          }
+          if (constraint.Interval.LowerBound > double.NegativeInfinity) {
+            var df_larger_lower = Subtract(CreateConstant(constraint.Interval.LowerBound), (ISymbolicExpressionTree)df.Clone());
+            // convert variables named theta back to constants
+            var df_prepared = ReplaceVarWithConst(df_larger_lower, thetaNames, thetaValues, allThetaNodes);
+            constraintTrees.Add(df_prepared);
+          }
+        } else {
+          if (constraint.Interval.UpperBound < double.PositiveInfinity) {
+            var f_smaller_upper = Subtract((ISymbolicExpressionTree)treeForDerivation.Clone(), CreateConstant(constraint.Interval.UpperBound));
+            // convert variables named theta back to constants
+            var df_prepared = ReplaceVarWithConst(f_smaller_upper, thetaNames, thetaValues, allThetaNodes);
+            constraintTrees.Add(df_prepared);
+          }
+          if (constraint.Interval.LowerBound > double.NegativeInfinity) {
+            var f_larger_lower = Subtract(CreateConstant(constraint.Interval.LowerBound), (ISymbolicExpressionTree)treeForDerivation.Clone());
+            // convert variables named theta back to constants
+            var df_prepared = ReplaceVarWithConst(f_larger_lower, thetaNames, thetaValues, allThetaNodes);
+            constraintTrees.Add(df_prepared);
+          }
+        }
+      }
+
+      var preparedTree = ReplaceVarWithConst(treeForDerivation, thetaNames, thetaValues, allThetaNodes);
+
+      // initialize constants randomly
+      if (rand != null) {
+        for (int i = 0; i < allThetaNodes.Length; i++) {
+          double f = Math.Exp(NormalDistributedRandom.NextDouble(rand, 0, 1));
+          double scale = rand.NextDouble() < 0.5 ? -1 : 1;
+          thetaValues[i] = scale * thetaValues[i] * f;
+          foreach (var constNode in allThetaNodes[i]) constNode.Value = thetaValues[i];
+        }
+      }
+
+      void UpdateThetaValues(double[] theta) {
+        for (int i = 0; i < theta.Length; ++i) {
+          foreach (var constNode in allThetaNodes[i]) constNode.Value = theta[i];
+        }
+      }
+
+      // define the callback used by the alglib optimizer
+      // the x argument for this callback represents our theta
+      void calculate_jacobian(double[] x, double[] fi, double[,] jac, object obj) {
+        UpdateThetaValues(x);
+
+        var autoDiffEval = new VectorAutoDiffEvaluator();
+        autoDiffEval.Evaluate(preparedTree, problemData.Dataset, problemData.TrainingIndices.ToArray(),
+          GetParameterNodes(preparedTree, allThetaNodes), out double[] fi_eval, out double[,] jac_eval);
+        var target = problemData.TargetVariableTrainingValues.ToArray();
+
+        // calc sum of squared errors and gradient
+        var sse = 0.0;
+        var g = new double[x.Length];
+        for (int i = 0; i < target.Length; i++) {
+          var res = target[i] - fi_eval[i];
+          sse += res * res;
+          for (int j = 0; j < g.Length; j++) {
+            g[j] += -2.0 * res * jac_eval[i, j];
+          }
+        }
+
+        fi[0] = sse;
+        for (int j = 0; j < x.Length; j++) { jac[0, j] = g[j]; }
+
+        var intervalEvaluator = new IntervalEvaluator();
+        for (int i = 0; i < constraintTrees.Count; i++) {
+          var interval = intervalEvaluator.Evaluate(constraintTrees[i], dataIntervals, GetParameterNodes(constraintTrees[i], allThetaNodes),
+            out double[] lowerGradient, out double[] upperGradient);
+
+          // we transformed this to a constraint c(x) <= 0, so only the upper bound is relevant for us
+          fi[i + 1] = interval.UpperBound;
+          for (int j = 0; j < x.Length; j++) {
+            jac[i + 1, j] = upperGradient[j];
+          }
+        }
+      }
+
+      // prepare alglib
+      alglib.minnlcstate state;
+      alglib.minnlcreport rep;
+      var x0 = thetaValues.ToArray();
+
+      alglib.minnlccreate(x0.Length, x0, out state);
+      double epsx = 1e-6;
+      int maxits = 0;
+      alglib.minnlcsetalgoslp(state);
+      alglib.minnlcsetcond(state, 0, maxits);
+      var s = Enumerable.Repeat(1d, x0.Length).ToArray();  // scale is set to unit scale
+      alglib.minnlcsetscale(state, s);
+
+      // set boundary constraints
+      // var boundaryLower = Enumerable.Repeat(-10d, n).ToArray();
+      // var boundaryUpper = Enumerable.Repeat(10d, n).ToArray();
+      // alglib.minnlcsetbc(state, boundaryLower, boundaryUpper);
+      // set non-linear constraints: 0 equality constraints, 1 inequality constraint
+      alglib.minnlcsetnlc(state, 0, constraintTrees.Count);
+
+      alglib.minnlcoptimize(state, calculate_jacobian, null, null);
+      alglib.minnlcresults(state, out double[] xOpt, out rep);
+
+      var interpreter = new SymbolicDataAnalysisExpressionTreeLinearInterpreter();
+      UpdateThetaValues(xOpt);
+      var model = new SymbolicRegressionModel(problemData.TargetVariable, (ISymbolicExpressionTree)preparedTree.Clone(), (ISymbolicDataAnalysisExpressionTreeInterpreter)interpreter.Clone());
+      if (applyLinearScaling)
+        model.Scale(problemData);
+
+      SymbolicRegressionSolution solution = new SymbolicRegressionSolution(model, (IRegressionProblemData)problemData.Clone());
+      solution.Model.Name = "Regression Model";
+      solution.Name = "Regression Solution";
+      return solution;
+    }
+
+    private static ISymbolicExpressionTreeNode[] GetParameterNodes(ISymbolicExpressionTree tree, List<ConstantTreeNode>[] allNodes) {
+      // TODO better solution necessary
+      var treeConstNodes = tree.IterateNodesPostfix().OfType<ConstantTreeNode>().ToArray();
+      var paramNodes = new ISymbolicExpressionTreeNode[allNodes.Length];
+      for (int i = 0; i < paramNodes.Length; i++) {
+        paramNodes[i] = allNodes[i].SingleOrDefault(n => treeConstNodes.Contains(n));
+      }
+      return paramNodes;
+    }
+
+    #endregion
+
+    #region helper
+    private static ISymbolicExpressionTree ReplaceVarWithConst(ISymbolicExpressionTree tree, List<string> thetaNames, List<double> thetaValues, List<ConstantTreeNode>[] thetaNodes) {
+      var copy = (ISymbolicExpressionTree)tree.Clone();
+      var nodes = copy.IterateNodesPostfix().ToList();
+      for (int i = 0; i < nodes.Count; i++) {
+        var n = nodes[i] as VariableTreeNode;
+        if (n != null) {
+          var thetaIdx = thetaNames.IndexOf(n.VariableName);
+          if (thetaIdx >= 0) {
+            var parent = n.Parent;
+            if(thetaNodes[thetaIdx].Any()) {
+              // HACKY: REUSE CONSTANT TREE NODE IN SEVERAL TREES
+              // we use this trick to allow autodiff over thetas when thetas occurr multiple times in the tree (e.g. in derived trees)
+              var constNode = thetaNodes[thetaIdx].First();
+              var childIdx = parent.IndexOfSubtree(n);
+              parent.RemoveSubtree(childIdx);
+              parent.InsertSubtree(childIdx, constNode);
+            } else {
+              var constNode = (ConstantTreeNode)CreateConstant(thetaValues[thetaIdx]);
+              var childIdx = parent.IndexOfSubtree(n);
+              parent.RemoveSubtree(childIdx);
+              parent.InsertSubtree(childIdx, constNode);
+              thetaNodes[thetaIdx].Add(constNode);
+            }
+          }
+        }
+      }
+      return copy;
+    }
+
+    private static ISymbolicExpressionTree ReplaceConstWithVar(ISymbolicExpressionTree tree, out List<string> thetaNames, out List<double> thetaValues) {
+      thetaNames = new List<string>();
+      thetaValues = new List<double>();
+      var copy = (ISymbolicExpressionTree)tree.Clone();
+      var nodes = copy.IterateNodesPostfix().ToList();
+
+      int n = 1;
+      for (int i = 0; i < nodes.Count; ++i) {
+        var node = nodes[i];
+        /*if (node is VariableTreeNode variableTreeNode) {
+          var thetaVar = (VariableTreeNode)new Problems.DataAnalysis.Symbolic.Variable().CreateTreeNode();
+          thetaVar.Weight = 1;
+          thetaVar.VariableName = $"θ{n++}";
+
+          thetaNames.Add(thetaVar.VariableName);
+          thetaValues.Add(variableTreeNode.Weight);
+          variableTreeNode.Weight = 1; // set to unit weight
+
+          var parent = variableTreeNode.Parent;
+          var prod = MakeNode<Multiplication>(thetaVar, variableTreeNode);
+          if (parent != null) {
+            var index = parent.IndexOfSubtree(variableTreeNode);
+            parent.RemoveSubtree(index);
+            parent.InsertSubtree(index, prod);
+          }
+        } else*/ if (node is ConstantTreeNode constantTreeNode) {
+          var thetaVar = (VariableTreeNode)new Problems.DataAnalysis.Symbolic.Variable().CreateTreeNode();
+          thetaVar.Weight = 1;
+          thetaVar.VariableName = $"θ{n++}";
+
+          thetaNames.Add(thetaVar.VariableName);
+          thetaValues.Add(constantTreeNode.Value);
+
+          var parent = constantTreeNode.Parent;
+          if (parent != null) {
+            var index = constantTreeNode.Parent.IndexOfSubtree(constantTreeNode);
+            parent.RemoveSubtree(index);
+            parent.InsertSubtree(index, thetaVar);
+          }
+        }
+      }
+      return copy;
+    }
+
+    private static ISymbolicExpressionTreeNode CreateConstant(double value) {
+      var constantNode = (ConstantTreeNode)new Constant().CreateTreeNode();
+      constantNode.Value = value;
+      return constantNode;
+    }
+
+    private static ISymbolicExpressionTree Subtract(ISymbolicExpressionTree t, ISymbolicExpressionTreeNode b) {
+      var sub = MakeNode<Subtraction>(t.Root.GetSubtree(0).GetSubtree(0), b);
+      t.Root.GetSubtree(0).RemoveSubtree(0);
+      t.Root.GetSubtree(0).InsertSubtree(0, sub);
+      return t;
+    }
+    private static ISymbolicExpressionTree Subtract(ISymbolicExpressionTreeNode b, ISymbolicExpressionTree t) {
+      var sub = MakeNode<Subtraction>(b, t.Root.GetSubtree(0).GetSubtree(0));
+      t.Root.GetSubtree(0).RemoveSubtree(0);
+      t.Root.GetSubtree(0).InsertSubtree(0, sub);
+      return t;
+    }
+
+    private static ISymbolicExpressionTreeNode MakeNode<T>(params ISymbolicExpressionTreeNode[] fs) where T : ISymbol, new() {
+      var node = new T().CreateTreeNode();
+      foreach (var f in fs) node.AddSubtree(f);
+      return node;
+    }
+    #endregion
+  }
+}
Index: /branches/2994-AutoDiffForIntervals/HeuristicLab.Algorithms.DataAnalysis.ConstrainedNonlinearRegression/3.4/HeuristicLab.Algorithms.DataAnalysis.ConstrainedNonlinearRegression-3.4.csproj
===================================================================
--- /branches/2994-AutoDiffForIntervals/HeuristicLab.Algorithms.DataAnalysis.ConstrainedNonlinearRegression/3.4/HeuristicLab.Algorithms.DataAnalysis.ConstrainedNonlinearRegression-3.4.csproj	(revision 16696)
+++ /branches/2994-AutoDiffForIntervals/HeuristicLab.Algorithms.DataAnalysis.ConstrainedNonlinearRegression/3.4/HeuristicLab.Algorithms.DataAnalysis.ConstrainedNonlinearRegression-3.4.csproj	(revision 16696)
@@ -0,0 +1,183 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{E4CED29F-964F-42AE-B400-AA00D0229CE5}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>HeuristicLab.Algorithms.DataAnalysis.ConstrainedNonlinearRegression</RootNamespace>
+    <AssemblyName>HeuristicLab.Algorithms.DataAnalysis.ConstrainedNonlinearRegression-3.4</AssemblyName>
+    <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
+    <TargetFrameworkProfile />
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>..\..\bin\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>..\..\bin\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup>
+    <SignAssembly>true</SignAssembly>
+  </PropertyGroup>
+  <PropertyGroup>
+    <AssemblyOriginatorKeyFile>HeuristicLab.snk</AssemblyOriginatorKeyFile>
+  </PropertyGroup>
+  <PropertyGroup>
+    <StartupObject />
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="ALGLIB-3.15.0, Version=3.15.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\trunk\bin\ALGLIB-3.15.0.dll</HintPath>
+    </Reference>
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Data.Linq" />
+    <Reference Include="System.Drawing" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="Microsoft.CSharp" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Net.Http" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="HeuristicLab.snk" />
+    <None Include="Plugin.cs.frame" />
+    <None Include="Properties\AssemblyInfo.cs.frame" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="ConstrainedNonlinearRegression.cs" />
+    <Compile Include="Plugin.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\..\HeuristicLab.Algorithms.DataAnalysis\3.4\HeuristicLab.Algorithms.DataAnalysis-3.4.csproj">
+      <Project>{2e782078-fa81-4b70-b56f-74ce38dac6c8}</Project>
+      <Name>HeuristicLab.Algorithms.DataAnalysis-3.4</Name>
+      <Private>False</Private>
+    </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.Analysis\3.3\HeuristicLab.Analysis-3.3.csproj">
+      <Project>{887425b4-4348-49ed-a457-b7d2c26ddbf9}</Project>
+      <Name>HeuristicLab.Analysis-3.3</Name>
+      <Private>False</Private>
+    </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.Collections\3.3\HeuristicLab.Collections-3.3.csproj">
+      <Project>{958b43bc-cc5c-4fa2-8628-2b3b01d890b6}</Project>
+      <Name>HeuristicLab.Collections-3.3</Name>
+      <Private>False</Private>
+    </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.Common\3.3\HeuristicLab.Common-3.3.csproj">
+      <Project>{a9ad58b9-3ef9-4cc1-97e5-8d909039ff5c}</Project>
+      <Name>HeuristicLab.Common-3.3</Name>
+      <Private>False</Private>
+    </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.Core\3.3\HeuristicLab.Core-3.3.csproj">
+      <Project>{c36bd924-a541-4a00-afa8-41701378ddc5}</Project>
+      <Name>HeuristicLab.Core-3.3</Name>
+      <Private>False</Private>
+    </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.Data\3.3\HeuristicLab.Data-3.3.csproj">
+      <Project>{bbab9df5-5ef3-4ba8-ade9-b36e82114937}</Project>
+      <Name>HeuristicLab.Data-3.3</Name>
+      <Private>False</Private>
+    </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding\3.4\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4.csproj">
+      <Project>{06D4A186-9319-48A0-BADE-A2058D462EEA}</Project>
+      <Name>HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4</Name>
+      <Private>False</Private>
+    </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.Optimization\3.3\HeuristicLab.Optimization-3.3.csproj">
+      <Project>{14ab8d24-25bc-400c-a846-4627aa945192}</Project>
+      <Name>HeuristicLab.Optimization-3.3</Name>
+      <Private>False</Private>
+    </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.Parameters\3.3\HeuristicLab.Parameters-3.3.csproj">
+      <Project>{56F9106A-079F-4C61-92F6-86A84C2D84B7}</Project>
+      <Name>HeuristicLab.Parameters-3.3</Name>
+      <Private>False</Private>
+    </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.Persistence\3.3\HeuristicLab.Persistence-3.3.csproj">
+      <Project>{102BC7D3-0EF9-439C-8F6D-96FF0FDB8E1B}</Project>
+      <Name>HeuristicLab.Persistence-3.3</Name>
+      <Private>False</Private>
+    </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.PluginInfrastructure\3.3\HeuristicLab.PluginInfrastructure-3.3.csproj">
+      <Project>{94186A6A-5176-4402-AE83-886557B53CCA}</Project>
+      <Name>HeuristicLab.PluginInfrastructure-3.3</Name>
+      <Private>False</Private>
+    </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis.Symbolic.Regression\3.4\HeuristicLab.Problems.DataAnalysis.Symbolic.Regression-3.4.csproj">
+      <Project>{5AC82412-911B-4FA2-A013-EDC5E3F3FCC2}</Project>
+      <Name>HeuristicLab.Problems.DataAnalysis.Symbolic.Regression-3.4</Name>
+      <Private>False</Private>
+    </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis.Symbolic\3.4\HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj">
+      <Project>{3D28463F-EC96-4D82-AFEE-38BE91A0CA00}</Project>
+      <Name>HeuristicLab.Problems.DataAnalysis.Symbolic-3.4</Name>
+      <Private>False</Private>
+    </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis\3.4\HeuristicLab.Problems.DataAnalysis-3.4.csproj">
+      <Project>{df87c13e-a889-46ff-8153-66dcaa8c5674}</Project>
+      <Name>HeuristicLab.Problems.DataAnalysis-3.4</Name>
+      <Private>False</Private>
+    </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.Problems.Instances\3.3\HeuristicLab.Problems.Instances-3.3.csproj">
+      <Project>{3540E29E-4793-49E7-8EE2-FEA7F61C3994}</Project>
+      <Name>HeuristicLab.Problems.Instances-3.3</Name>
+      <Private>False</Private>
+    </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.Random\3.3\HeuristicLab.Random-3.3.csproj">
+      <Project>{f4539fb6-4708-40c9-be64-0a1390aea197}</Project>
+      <Name>HeuristicLab.Random-3.3</Name>
+    </ProjectReference>
+  </ItemGroup>
+  <ItemGroup>
+    <Reference Include="HEAL.Attic, Version=1.0.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\bin\HEAL.Attic.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+  <PropertyGroup>
+    <PreBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">set Path=%25Path%25;$(ProjectDir);$(SolutionDir)
+set ProjectDir=$(ProjectDir)
+set SolutionDir=$(SolutionDir)
+set Outdir=$(Outdir)
+
+call PreBuildEvent.cmd
+</PreBuildEvent>
+    <PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">
+export ProjectDir=$(ProjectDir)
+export SolutionDir=$(SolutionDir)
+
+$SolutionDir/PreBuildEvent.sh
+</PreBuildEvent>
+  </PropertyGroup>
+</Project>
Index: /branches/2994-AutoDiffForIntervals/HeuristicLab.Algorithms.DataAnalysis.ConstrainedNonlinearRegression/3.4/Plugin.cs.frame
===================================================================
--- /branches/2994-AutoDiffForIntervals/HeuristicLab.Algorithms.DataAnalysis.ConstrainedNonlinearRegression/3.4/Plugin.cs.frame	(revision 16696)
+++ /branches/2994-AutoDiffForIntervals/HeuristicLab.Algorithms.DataAnalysis.ConstrainedNonlinearRegression/3.4/Plugin.cs.frame	(revision 16696)
@@ -0,0 +1,44 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using HeuristicLab.PluginInfrastructure;
+
+namespace HeuristicLab.Algorithms.DataAnalysis {
+  [Plugin("HeuristicLab.Algorithms.DataAnalysis.ConstrainedNonlinearRegression", "", "3.4.0.$WCREV$")]
+  [PluginFile("HeuristicLab.Algorithms.DataAnalysis.ConstrainedNonlinearRegression-3.4.dll", PluginFileType.Assembly)]
+  [PluginDependency("HeuristicLab.ALGLIB", "3.15")]
+  [PluginDependency("HeuristicLab.Attic", "1.0")]
+  [PluginDependency("HeuristicLab.Algorithms.DataAnalysis", "3.4")]
+  [PluginDependency("HeuristicLab.Analysis", "3.3")]
+  [PluginDependency("HeuristicLab.Collections", "3.3")]
+  [PluginDependency("HeuristicLab.Common", "3.3")]
+  [PluginDependency("HeuristicLab.Core", "3.3")]
+  [PluginDependency("HeuristicLab.Data", "3.3")]
+  [PluginDependency("HeuristicLab.Encodings.SymbolicExpressionTreeEncoding", "3.4")]
+  [PluginDependency("HeuristicLab.Optimization", "3.3")]
+  [PluginDependency("HeuristicLab.Parameters", "3.3")]
+  [PluginDependency("HeuristicLab.Problems.DataAnalysis", "3.4")]
+  [PluginDependency("HeuristicLab.Problems.DataAnalysis.Symbolic", "3.4")]
+  [PluginDependency("HeuristicLab.Problems.DataAnalysis.Symbolic.Regression", "3.4")]
+  [PluginDependency("HeuristicLab.Random", "3.4")]
+  public class ConstrainedNonlinearRegressionPlugin : PluginBase {
+  }
+}
Index: /branches/2994-AutoDiffForIntervals/HeuristicLab.Algorithms.DataAnalysis.ConstrainedNonlinearRegression/3.4/Properties/AssemblyInfo.cs.frame
===================================================================
--- /branches/2994-AutoDiffForIntervals/HeuristicLab.Algorithms.DataAnalysis.ConstrainedNonlinearRegression/3.4/Properties/AssemblyInfo.cs.frame	(revision 16696)
+++ /branches/2994-AutoDiffForIntervals/HeuristicLab.Algorithms.DataAnalysis.ConstrainedNonlinearRegression/3.4/Properties/AssemblyInfo.cs.frame	(revision 16696)
@@ -0,0 +1,56 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using HeuristicLab.PluginInfrastructure;
+
+// General Information about an assembly is controlled through the following 
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("HeuristicLab.Algorithms.DataAnalysis.ConstrainedNonlinearRegression")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("HeuristicLab")]
+[assembly: AssemblyCopyright("(c) 2002-2019 HEAL")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible 
+// to COM components.  If you need to access a type in this assembly from 
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version 
+//      Build Number
+//      Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers 
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("3.4.0")]
+[assembly: AssemblyFileVersion("3.4.0.$WCREV$")]
Index: /branches/2994-AutoDiffForIntervals/Tests/AutoDiffTest.cs
===================================================================
--- /branches/2994-AutoDiffForIntervals/Tests/AutoDiffTest.cs	(revision 16695)
+++ /branches/2994-AutoDiffForIntervals/Tests/AutoDiffTest.cs	(revision 16696)
@@ -9,7 +9,7 @@
 namespace Tests {
   [TestClass]
-  public class AutoDiffTest {
+  public class AutoDiffTestClass {
     [TestMethod]
-    public void Test() {
+    public void AutoDiffTest() {
       {
         // eval
Index: /branches/2994-AutoDiffForIntervals/Tests/Tests.csproj
===================================================================
--- /branches/2994-AutoDiffForIntervals/Tests/Tests.csproj	(revision 16695)
+++ /branches/2994-AutoDiffForIntervals/Tests/Tests.csproj	(revision 16696)
@@ -40,4 +40,7 @@
   </PropertyGroup>
   <ItemGroup>
+    <Reference Include="HeuristicLab.Problems.DataAnalysis.Symbolic.Regression-3.4">
+      <HintPath>..\..\..\trunk\bin\HeuristicLab.Problems.DataAnalysis.Symbolic.Regression-3.4.dll</HintPath>
+    </Reference>
     <Reference Include="Microsoft.VisualStudio.TestPlatform.TestFramework, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
       <HintPath>..\packages\MSTest.TestFramework.1.3.2\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll</HintPath>
@@ -50,4 +53,5 @@
   </ItemGroup>
   <ItemGroup>
+    <Compile Include="ConstrainedNLRTest.cs" />
     <Compile Include="AutoDiffTest.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
@@ -57,4 +61,12 @@
   </ItemGroup>
   <ItemGroup>
+    <ProjectReference Include="..\HeuristicLab.Algorithms.DataAnalysis.ConstrainedNonlinearRegression\3.4\HeuristicLab.Algorithms.DataAnalysis.ConstrainedNonlinearRegression-3.4.csproj">
+      <Project>{e4ced29f-964f-42ae-b400-aa00d0229ce5}</Project>
+      <Name>HeuristicLab.Algorithms.DataAnalysis.ConstrainedNonlinearRegression-3.4</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\HeuristicLab.Algorithms.DataAnalysis\3.4\HeuristicLab.Algorithms.DataAnalysis-3.4.csproj">
+      <Project>{2E782078-FA81-4B70-B56F-74CE38DAC6C8}</Project>
+      <Name>HeuristicLab.Algorithms.DataAnalysis-3.4</Name>
+    </ProjectReference>
     <ProjectReference Include="..\HeuristicLab.Common\3.3\HeuristicLab.Common-3.3.csproj">
       <Project>{A9AD58B9-3EF9-4CC1-97E5-8D909039FF5C}</Project>
@@ -73,4 +85,8 @@
       <Name>HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4</Name>
     </ProjectReference>
+    <ProjectReference Include="..\HeuristicLab.Optimization\3.3\HeuristicLab.Optimization-3.3.csproj">
+      <Project>{14AB8D24-25BC-400C-A846-4627AA945192}</Project>
+      <Name>HeuristicLab.Optimization-3.3</Name>
+    </ProjectReference>
     <ProjectReference Include="..\HeuristicLab.Problems.DataAnalysis.Symbolic\3.4\HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj">
       <Project>{3d28463f-ec96-4d82-afee-38be91a0ca00}</Project>
@@ -80,4 +96,8 @@
       <Project>{df87c13e-a889-46ff-8153-66dcaa8c5674}</Project>
       <Name>HeuristicLab.Problems.DataAnalysis-3.4</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\HeuristicLab.Random\3.3\HeuristicLab.Random-3.3.csproj">
+      <Project>{F4539FB6-4708-40C9-BE64-0A1390AEA197}</Project>
+      <Name>HeuristicLab.Random-3.3</Name>
     </ProjectReference>
   </ItemGroup>
