Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
3.0
-
None
-
None
Description
It would be convenient if class org.apache.commons.math3.geometry.euclidean.oned.Interval had a method such as the one below.
Here is the method code that may be added to the class. /** Verifies if x is inside this Interval. * @return true if x is a value between this Interval lower and upper * bounds, false otherwise */ public boolean contains(double x) { return upper >= x && lower <= x; }
Notice that I'm assuming that an Interval includes its endpoints which may not be true in certain applications. This may imply the need to improve the Interval class (by adding methods or internal state) that describe the inclusion or exclusion of endpoints.