Changeset 17200 for branches/2994-AutoDiffForIntervals/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4
- Timestamp:
- 08/12/19 10:50:02 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2994-AutoDiffForIntervals/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/Interpreter.cs
r17131 r17200 788 788 [DebuggerBrowsable(DebuggerBrowsableState.Never)] 789 789 public AlgebraicInterval Zero => new AlgebraicInterval(0.0, 0.0); 790 [DebuggerBrowsable(DebuggerBrowsableState.Never)] 790 791 public AlgebraicInterval One => new AlgebraicInterval(1.0, 1.0); 792 791 793 public AlgebraicInterval Add(AlgebraicInterval a) { 792 794 low.Add(a.low); … … 818 820 public AlgebraicInterval Div(AlgebraicInterval a) { 819 821 if (a.Contains(0.0)) { 820 if (a.low.Value.Value .IsAlmost(0.0) && a.high.Value.Value.IsAlmost(0.0)) {822 if (a.low.Value.Value == 0 && a.high.Value.Value == 0) { 821 823 low = new MultivariateDual<AlgebraicDouble>(double.NegativeInfinity); 822 824 high = new MultivariateDual<AlgebraicDouble>(double.PositiveInfinity); 823 } else if (a.low.Value.Value .IsAlmost(0.0))825 } else if (a.low.Value.Value == 0) 824 826 Mul(new AlgebraicInterval(a.Clone().high.Inv(), new MultivariateDual<AlgebraicDouble>(double.PositiveInfinity))); 825 827 else … … 945 947 //divide the interval by PI/2 so that the optima lie at x element of N (0,1,2,3,4,...) 946 948 double Pihalf = Math.PI / 2; 947 var scaled = this.Clone().Scale(1.0 / Pihalf);949 var scaled = a.Clone().Scale(1.0 / Pihalf); 948 950 //move to positive scale 949 951 if (scaled.LowerBound.Value.Value < 0) { … … 965 967 } 966 968 967 low = new MultivariateDual<AlgebraicDouble>(sinValues.Min()); 969 low = new MultivariateDual<AlgebraicDouble>(sinValues.Min()); // TODO, XXX FIX CALCULATION TO SUPPORT GRADIENTS! 968 970 high = new MultivariateDual<AlgebraicDouble>(sinValues.Max()); 969 971 return this;
Note: See TracChangeset
for help on using the changeset viewer.