Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/19/19 09:30:56 (6 years ago)
Author:
gkronber
Message:

#2994: made required changes to work with current trunk

Location:
branches/2994-AutoDiffForIntervals
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/2994-AutoDiffForIntervals/HeuristicLab.Algorithms.DataAnalysis.ConstrainedNonlinearRegression/3.4/ConstrainedNonlinearRegression.cs

    r16742 r16831  
    249249        }
    250250      }
    251       var intervals = problemData.IntervalConstraints;
    252       var constraints = IntervalConstraintsParser.Parse(intervals.Value);
     251      var intervalConstraints = problemData.IntervalConstraints;
    253252      var dataIntervals = problemData.VariableRanges.VariableIntervals;
    254253
     
    260259      var allThetaNodes = thetaNames.Select(_ => new List<ConstantTreeNode>()).ToArray();
    261260      var constraintTrees = new List<ISymbolicExpressionTree>();
    262       foreach (var constraint in constraints) {
     261      foreach (var constraint in intervalConstraints.Constraints) {
    263262        if (constraint.IsDerivation) {
    264263          if (!problemData.AllowedInputVariables.Contains(constraint.Variable))
  • branches/2994-AutoDiffForIntervals/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/Interpreter.cs

    r16744 r16831  
    370370  public sealed class IntervalEvaluator : Interpreter<AlgebraicInterval> {
    371371    [ThreadStatic]
    372     private Dictionary<string, Interval> intervals;
    373 
    374     public Interval Evaluate(ISymbolicExpressionTree tree, Dictionary<string, Interval> intervals) {
     372    private IDictionary<string, Interval> intervals;
     373
     374    public Interval Evaluate(ISymbolicExpressionTree tree, IDictionary<string, Interval> intervals) {
    375375      this.intervals = intervals;
    376376      var code = Compile(tree);
     
    379379    }
    380380
    381     public Interval Evaluate(ISymbolicExpressionTree tree, Dictionary<string, Interval> intervals, ISymbolicExpressionTreeNode[] paramNodes, out double[] lowerGradient, out double[] upperGradient) {
     381    public Interval Evaluate(ISymbolicExpressionTree tree, IDictionary<string, Interval> intervals, ISymbolicExpressionTreeNode[] paramNodes, out double[] lowerGradient, out double[] upperGradient) {
    382382      this.intervals = intervals;
    383383      var code = Compile(tree);
  • branches/2994-AutoDiffForIntervals/Tests/ConstrainedNLRTest.cs

    r16697 r16831  
    1313      var modelStructure = "1.0*sqr(x)+1.0*x+1.0";
    1414      var problemData = new RegressionProblemData();
    15       problemData.IntervalConstraints.Value =
    16 @"y in [0 .. 100]
    17 ∂y/∂x in ]-inf. .. 0]
    18 ";
     15//       problemData.IntervalConstraints.Value = new ParsedConstraint(
     16// @"y in [0 .. 100]
     17// ∂y/∂x in ]-inf. .. 0]
     18// ", problemData);
    1919      var solution = ConstrainedNonlinearRegression.CreateRegressionSolution(problemData, modelStructure, 0, true, new FastRandom(1234));
    2020    }
Note: See TracChangeset for help on using the changeset viewer.