Go to the documentation of this file.
12 #ifndef MLPACK_CORE_MATH_RANGE_HPP
13 #define MLPACK_CORE_MATH_RANGE_HPP
33 template<
typename T =
double>
61 inline T
Lo()
const {
return lo; }
63 inline T&
Lo() {
return lo; }
66 inline T
Hi()
const {
return hi; }
68 inline T&
Hi() {
return hi; }
130 template<
typename TT>
182 template<
typename Archive>
183 void serialize(Archive& ar,
const unsigned int version);
190 #include "range_impl.hpp"
192 #endif // MLPACK_CORE_MATH_RANGE_HPP
RangeType & operator&=(const RangeType &rhs)
Shrinks this range to be the overlap with another range; this makes an empty set if there is no overl...
bool operator==(const RangeType &rhs) const
Compare with another range for strict equality.
RangeType()
The upper bound.
T Lo() const
Get the lower bound.
RangeType & operator*=(const T d)
Scale the bounds by the given double.
RangeType operator|(const RangeType &rhs) const
Expands this range to include another range.
Linear algebra utility functions, generally performed on matrices or vectors.
bool operator!=(const RangeType &rhs) const
Compare with another range for strict equality.
T & Hi()
Modify the upper bound.
RangeType< double > Range
3.0.0 TODO: break reverse-compatibility by changing RangeType to Range.
RangeType operator*(const T d) const
Scale the bounds by the given double.
bool Contains(const T d) const
Determines if a point is contained within the range.
T Hi() const
Get the upper bound.
bool operator<(const RangeType &rhs) const
Compare with another range.
bool Contains(const RangeType &r) const
Determines if another range overlaps with this one.
RangeType operator&(const RangeType &rhs) const
Shrinks this range to be the overlap with another range; this makes an empty set if there is no overl...
void serialize(Archive &ar, const unsigned int version)
Serialize the range object.
T Width() const
Gets the span of the range (hi - lo).
T & Lo()
Modify the lower bound.
RangeType & operator|=(const RangeType &rhs)
Expands this range to include another range.
RangeType(const T lo, const T hi)
Initializes to specified range.
friend RangeType< TT > operator*(const TT d, const RangeType< TT > &r)
Scale the bounds by the given double.
bool operator>(const RangeType &rhs) const
Compare with another range.
T Mid() const
Gets the midpoint of this range.