Changeset 17918 for branches/3105_PythonFormatter/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Interval/Interval.cs
- Timestamp:
- 03/29/21 09:54:58 (3 years ago)
- Location:
- branches/3105_PythonFormatter
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3105_PythonFormatter
- Property svn:mergeinfo changed
/trunk (added) merged: 17845,17856,17858-17859,17861,17867,17871-17873,17888-17889,17902-17903,17906-17914
- Property svn:mergeinfo changed
-
branches/3105_PythonFormatter/HeuristicLab.Problems.DataAnalysis
- Property svn:mergeinfo changed
-
branches/3105_PythonFormatter/HeuristicLab.Problems.DataAnalysis/3.4
- Property svn:mergeinfo changed
-
branches/3105_PythonFormatter/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Interval/Interval.cs
- Property svn:mergeinfo changed
r17583 r17918 33 33 [Storable] 34 34 public double UpperBound { get; private set; } 35 36 public double Width => UpperBound - LowerBound; 35 37 36 38 [StorableConstructor] … … 67 69 } 68 70 71 private Interval(double v) : this(v, v) { } 72 69 73 public bool Contains(double value) { 70 74 return LowerBound <= value && value <= UpperBound; … … 126 130 return false; 127 131 128 return (UpperBound .IsAlmost(other.UpperBound)|| (double.IsNaN(UpperBound) && double.IsNaN(other.UpperBound)))129 && (LowerBound .IsAlmost(other.LowerBound)|| (double.IsNaN(LowerBound) && double.IsNaN(other.LowerBound)));132 return (UpperBound==other.UpperBound || (double.IsNaN(UpperBound) && double.IsNaN(other.UpperBound))) 133 && (LowerBound==other.LowerBound || (double.IsNaN(LowerBound) && double.IsNaN(other.LowerBound))); 130 134 } 131 135 … … 267 271 } 268 272 269 public static Interval Analytic alQuotient(Interval a, Interval b) {273 public static Interval AnalyticQuotient(Interval a, Interval b) { 270 274 var dividend = a; 271 275 var divisor = Add(Square(b), new Interval(1.0, 1.0)); … … 276 280 } 277 281 #endregion 282 283 #region arithmetic overloads 284 public static Interval operator +(Interval a, Interval b) => Add(a, b); 285 public static Interval operator +(Interval a, double b) => Add(a, new Interval(b)); 286 public static Interval operator +(double a, Interval b) => Add(new Interval(a), b); 287 public static Interval operator -(Interval a, Interval b) => Subtract(a, b); 288 public static Interval operator -(Interval a, double b) => Subtract(a, new Interval(b)); 289 public static Interval operator -(double a, Interval b) => Subtract(new Interval(a), b); 290 public static Interval operator -(Interval a) => Subtract(new Interval(0), a); 291 public static Interval operator *(Interval a, Interval b) => Multiply(a, b); 292 public static Interval operator *(Interval a, double b) => Multiply(a, new Interval(b)); 293 public static Interval operator *(double a, Interval b) => Multiply(new Interval(a), b); 294 public static Interval operator /(Interval a, Interval b) => Divide(a, b); 295 public static Interval operator /(Interval a, double b) => Divide(a, new Interval(b)); 296 public static Interval operator /(double a, Interval b) => Divide(new Interval(a), b); 297 public static Interval Exponential(double a) { return Exponential(new Interval(a)); } 298 public static Interval Logarithm(double a) { return Logarithm(new Interval(a)); } 299 public static Interval Sine(double a) { return Sine(new Interval(a)); } 300 public static Interval Cosine(double a) { return Cosine(new Interval(a)); } 301 public static Interval Tangens(double a) { return Tangens(new Interval(a)); } 302 public static Interval HyperbolicTangent(double a) { return HyperbolicTangent(new Interval(a)); } 303 public static Interval Square(double a) { return Square(new Interval(a)); } 304 public static Interval Cube(double a) { return Cube(new Interval(a)); } 305 public static Interval SquareRoot(double a) { return SquareRoot(new Interval(a)); } 306 public static Interval CubicRoot(double a) { return CubicRoot(new Interval(a)); } 307 public static Interval Absolute(double a) { return Absolute(new Interval(a)); } 308 public static Interval AnalyticQuotient(Interval a, double b) { return AnalyticQuotient(a, new Interval(b)); } 309 public static Interval AnalyticQuotient(double a, Interval b) { return AnalyticQuotient(new Interval(a), b); } 310 public static Interval AnalyticQuotient(double a, double b) { return AnalyticQuotient(new Interval(a), new Interval(b)); } 311 #endregion 278 312 } 279 313 }
Note: See TracChangeset
for help on using the changeset viewer.