Range.h

template<typename T, size_t DIM>
class Cubism::Core::Range

Rectangular range.

Template Parameters
  • T: Data type that describes coordinates in the range

  • DIM: Dimension

Public Functions

inline Range()

Default constructor (NULL range)

inline explicit Range(const DataType e)

Construct range.

Constructs equal extent in all DIM dimensions.

Parameters
  • e: End point (top right) of rectangle. Begin is 0.

inline explicit Range(const PointType &e)

Construct range.

Constructs an extent specified the DIM-dimensional e.

Parameters
  • e: End point (top right) of rectangle. Begin is 0.

inline Range(const DataType b, const DataType e)

Construct range.

Constructs equal extent in all DIM dimensions.

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 of e and b.

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() > 0 then 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 the getNullSpace() 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, where null is 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 o is 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 p is 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 o intersects 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

inline bool operator==(const Range &o) const

Check if other range is equal to this range.

Parameters
  • o: Other range

inline bool operator!=(const Range &o) const

Check if other range is not equal to this range.

Parameters
  • o: Other range