Changeset 16831
- Timestamp:
- 04/19/19 09:30:56 (6 years ago)
- Location:
- branches/2994-AutoDiffForIntervals
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2994-AutoDiffForIntervals/HeuristicLab.Algorithms.DataAnalysis.ConstrainedNonlinearRegression/3.4/ConstrainedNonlinearRegression.cs
r16742 r16831 249 249 } 250 250 } 251 var intervals = problemData.IntervalConstraints; 252 var constraints = IntervalConstraintsParser.Parse(intervals.Value); 251 var intervalConstraints = problemData.IntervalConstraints; 253 252 var dataIntervals = problemData.VariableRanges.VariableIntervals; 254 253 … … 260 259 var allThetaNodes = thetaNames.Select(_ => new List<ConstantTreeNode>()).ToArray(); 261 260 var constraintTrees = new List<ISymbolicExpressionTree>(); 262 foreach (var constraint in constraints) {261 foreach (var constraint in intervalConstraints.Constraints) { 263 262 if (constraint.IsDerivation) { 264 263 if (!problemData.AllowedInputVariables.Contains(constraint.Variable)) -
branches/2994-AutoDiffForIntervals/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/Interpreter.cs
r16744 r16831 370 370 public sealed class IntervalEvaluator : Interpreter<AlgebraicInterval> { 371 371 [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) { 375 375 this.intervals = intervals; 376 376 var code = Compile(tree); … … 379 379 } 380 380 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) { 382 382 this.intervals = intervals; 383 383 var code = Compile(tree); -
branches/2994-AutoDiffForIntervals/Tests/ConstrainedNLRTest.cs
r16697 r16831 13 13 var modelStructure = "1.0*sqr(x)+1.0*x+1.0"; 14 14 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); 19 19 var solution = ConstrainedNonlinearRegression.CreateRegressionSolution(problemData, modelStructure, 0, true, new FastRandom(1234)); 20 20 }
Note: See TracChangeset
for help on using the changeset viewer.