Range.h¶
-
template<typename
T, size_tDIM>
classCubism::Core::Range¶ Rectangular range.
- Template Parameters
T: Data type that describes coordinates in the rangeDIM: Dimension
Public Functions
-
inline
Range()¶ Default constructor (NULL range)
-
inline explicit
Range(const DataType e)¶ Construct range.
Constructs equal extent in all
DIMdimensions.- Parameters
e: End point (top right) of rectangle. Begin is0.
-
inline explicit
Range(const PointType &e)¶ Construct range.
Constructs an extent specified the
DIM-dimensionale.- Parameters
e: End point (top right) of rectangle. Begin is0.
-
inline
Range(const DataType b, const DataType e)¶ Construct range.
Constructs equal extent in all
DIMdimensions.- Parameters
b: Begin point (lower left) of rectangle.e: End point (top right) of rectangle.
-
inline
Range(const PointType &b, const PointType &e)¶ Construct range.
Constructs an extent specified the
DIM-dimensional difference ofeandb.- Parameters
b: Begin point (lower left) of rectangle.e: End point (top right) of rectangle.
-
inline void
setBegin(const PointType &b)¶ Set range begin.
- Parameters
b: New begin point
-
inline void
setEnd(const PointType &e)¶ Set range end.
- Parameters
e: New end point
-
inline PointType
getBegin() const¶ Get range begin.
- Return
Begin point
-
inline PointType
getEnd() const¶ Get range end.
- Return
End point
-
inline PointType
getExtent() const¶ Get range extent.
Note
If
getNullSpace().size() > 0then the extent for the corresponding null space dimension is equal to the identity. This allows for arithmetic operations if the range spans a lower dimensional space. Use thegetNullSpace()method to obtain the null space components.- Return
Range extent
-
inline DataType
getVolume() const¶ Get range volume.
- Return
Range volume
-
inline std::vector<size_t>
getNullSpace() const¶ Get the null space.
The range has a reduced basis if
null.size()>0, wherenullis the return value.- Return
Vector of indices corresponding to the dimensions that span a null space
-
inline bool
isContained(const Range &o) const¶ Check if other range is contained in this range.
- Return
True if
ois contained in this range (inclusive)- Parameters
o: Other range
-
inline bool
isContained(const PointType &p) const¶ Check if point is contained in this range.
- Return
True if
pis contained in this range (inclusive)- Parameters
p: Point
-
inline bool
isIntersecting(const Range &o) const¶ Check if other range intersects this range.
- Return
True if
ointersects this range- Parameters
o: Other range
-
inline Range
getIntersection(const Range &o) const¶ Get intersection subspace.
- Return
New range for intersection
- Parameters
o: Other range