Class IntervalsSet
- All Implemented Interfaces:
Iterable<double[]>,Region<Euclidean1D>
- Since:
- 3.0
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.commons.math3.geometry.partitioning.Region
Region.Location -
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.IntervalsSet(double tolerance) Build an intervals set representing the whole real line.IntervalsSet(double lower, double upper) Deprecated.as of 3.3 replaced withIntervalsSet(double, double, double)IntervalsSet(double lower, double upper, double tolerance) Build an intervals set corresponding to a single interval.IntervalsSet(Collection<SubHyperplane<Euclidean1D>> boundary) Deprecated.as of 3.3, replaced withIntervalsSet(Collection, double)IntervalsSet(Collection<SubHyperplane<Euclidean1D>> boundary, double tolerance) Build an intervals set from a Boundary REPresentation (B-rep).IntervalsSet(BSPTree<Euclidean1D> tree) Deprecated.as of 3.3, replaced withIntervalsSet(BSPTree, double)IntervalsSet(BSPTree<Euclidean1D> tree, double tolerance) Build an intervals set from an inside/outside BSP tree. -
Method Summary
Modifier and TypeMethodDescriptionasList()Build an ordered list of intervals representing the instance.buildNew(BSPTree<Euclidean1D> tree) Build a region using the instance as a prototype.protected voidCompute some geometrical properties.doublegetInf()Get the lowest value belonging to the instance.doublegetSup()Get the highest value belonging to the instance.Iterator<double[]> iterator()projectToBoundary(Point<Euclidean1D> point) Project a point on the boundary of the region.Methods inherited from class org.apache.commons.math3.geometry.partitioning.AbstractRegion
applyTransform, checkPoint, checkPoint, checkPoint, checkPoint, contains, copySelf, getBarycenter, getBoundarySize, getSize, getTolerance, getTree, intersection, isEmpty, isEmpty, isFull, isFull, setBarycenter, setBarycenter, setSize, sideMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
IntervalsSet
public IntervalsSet(double tolerance) Build an intervals set representing the whole real line.- Parameters:
tolerance- tolerance below which points are considered identical.- Since:
- 3.3
-
IntervalsSet
public IntervalsSet(double lower, double upper, double tolerance) Build an intervals set corresponding to a single interval.- Parameters:
lower- lower bound of the interval, must be lesser or equal toupper(may beDouble.NEGATIVE_INFINITY)upper- upper bound of the interval, must be greater or equal tolower(may beDouble.POSITIVE_INFINITY)tolerance- tolerance below which points are considered identical.- Since:
- 3.3
-
IntervalsSet
Build an intervals set from an inside/outside BSP tree.The leaf nodes of the BSP tree must have a
Booleanattribute representing the inside status of the corresponding cell (true for inside cells, false for outside cells). In order to avoid building too many small objects, it is recommended to use the predefined constantsBoolean.TRUEandBoolean.FALSE- Parameters:
tree- inside/outside BSP tree representing the intervals settolerance- tolerance below which points are considered identical.- Since:
- 3.3
-
IntervalsSet
Build an intervals set from a Boundary REPresentation (B-rep).The boundary is provided as a collection of
sub-hyperplanes. Each sub-hyperplane has the interior part of the region on its minus side and the exterior on its plus side.The boundary elements can be in any order, and can form several non-connected sets (like for example polygons with holes or a set of disjoints polyhedrons considered as a whole). In fact, the elements do not even need to be connected together (their topological connections are not used here). However, if the boundary does not really separate an inside open from an outside open (open having here its topological meaning), then subsequent calls to the
checkPointmethod will not be meaningful anymore.If the boundary is empty, the region will represent the whole space.
- Parameters:
boundary- collection of boundary elementstolerance- tolerance below which points are considered identical.- Since:
- 3.3
-
IntervalsSet
Deprecated.as of 3.1 replaced withIntervalsSet(double)Build an intervals set representing the whole real line. -
IntervalsSet
Deprecated.as of 3.3 replaced withIntervalsSet(double, double, double)Build an intervals set corresponding to a single interval.- Parameters:
lower- lower bound of the interval, must be lesser or equal toupper(may beDouble.NEGATIVE_INFINITY)upper- upper bound of the interval, must be greater or equal tolower(may beDouble.POSITIVE_INFINITY)
-
IntervalsSet
Deprecated.as of 3.3, replaced withIntervalsSet(BSPTree, double)Build an intervals set from an inside/outside BSP tree.The leaf nodes of the BSP tree must have a
Booleanattribute representing the inside status of the corresponding cell (true for inside cells, false for outside cells). In order to avoid building too many small objects, it is recommended to use the predefined constantsBoolean.TRUEandBoolean.FALSE- Parameters:
tree- inside/outside BSP tree representing the intervals set
-
IntervalsSet
Deprecated.as of 3.3, replaced withIntervalsSet(Collection, double)Build an intervals set from a Boundary REPresentation (B-rep).The boundary is provided as a collection of
sub-hyperplanes. Each sub-hyperplane has the interior part of the region on its minus side and the exterior on its plus side.The boundary elements can be in any order, and can form several non-connected sets (like for example polygons with holes or a set of disjoints polyhedrons considered as a whole). In fact, the elements do not even need to be connected together (their topological connections are not used here). However, if the boundary does not really separate an inside open from an outside open (open having here its topological meaning), then subsequent calls to the
checkPointmethod will not be meaningful anymore.If the boundary is empty, the region will represent the whole space.
- Parameters:
boundary- collection of boundary elements
-
-
Method Details
-
buildNew
Build a region using the instance as a prototype.This method allow to create new instances without knowing exactly the type of the region. It is an application of the prototype design pattern.
The leaf nodes of the BSP tree must have a
Booleanattribute representing the inside status of the corresponding cell (true for inside cells, false for outside cells). In order to avoid building too many small objects, it is recommended to use the predefined constantsBoolean.TRUEandBoolean.FALSE. The tree also must have either null internal nodes or internal nodes representing the boundary as specified in thegetTreemethod).- Specified by:
buildNewin interfaceRegion<Euclidean1D>- Specified by:
buildNewin classAbstractRegion<Euclidean1D,Euclidean1D> - Parameters:
tree- inside/outside BSP tree representing the new region- Returns:
- the built region
-
computeGeometricalProperties
protected void computeGeometricalProperties()Compute some geometrical properties.The properties to compute are the barycenter and the size.
- Specified by:
computeGeometricalPropertiesin classAbstractRegion<Euclidean1D,Euclidean1D>
-
getInf
public double getInf()Get the lowest value belonging to the instance.- Returns:
- lowest value belonging to the instance
(
Double.NEGATIVE_INFINITYif the instance doesn't have any low bound,Double.POSITIVE_INFINITYif the instance is empty)
-
getSup
public double getSup()Get the highest value belonging to the instance.- Returns:
- highest value belonging to the instance
(
Double.POSITIVE_INFINITYif the instance doesn't have any high bound,Double.NEGATIVE_INFINITYif the instance is empty)
-
projectToBoundary
Project a point on the boundary of the region.- Specified by:
projectToBoundaryin interfaceRegion<Euclidean1D>- Overrides:
projectToBoundaryin classAbstractRegion<Euclidean1D,Euclidean1D> - Parameters:
point- point to check- Returns:
- projection of the point on the boundary
- Since:
- 3.3
-
asList
Build an ordered list of intervals representing the instance.This method builds this intervals set as an ordered list of
Intervalelements. If the intervals set has no lower limit, the first interval will have its low bound equal toDouble.NEGATIVE_INFINITY. If the intervals set has no upper limit, the last interval will have its upper bound equal toDouble.POSITIVE_INFINITY. An empty tree will build an empty list while a tree representing the whole real line will build a one element list with both bounds being infinite.- Returns:
- a new ordered list containing
Intervalelements
-
iterator
The iterator returns the limit values of sub-intervals in ascending order.
The iterator does not support the optional
removeoperation.
-
IntervalsSet(double)