14 #ifndef __MLPACK_CORE_MATH_RANGE_HPP
15 #define __MLPACK_CORE_MATH_RANGE_HPP
35 template<
typename T =
double>
63 inline T
Lo()
const {
return lo; }
65 inline T&
Lo() {
return lo; }
68 inline T
Hi()
const {
return hi; }
70 inline T&
Hi() {
return hi; }
75 inline T
Width()
const;
131 template<
typename TT>
169 inline bool Contains(
const T d)
const;
183 template<
typename Archive>
184 void Serialize(Archive& ar,
const unsigned int version);
191 #include "range_impl.hpp"
193 #endif // __MLPACK_CORE_MATH_RANGE_HPP
bool operator>(const RangeType &rhs) const
Compare with another range.
bool operator<(const RangeType &rhs) const
Compare with another range.
Linear algebra utility functions, generally performed on matrices or vectors.
void Serialize(Archive &ar, const unsigned int version)
Serialize the range object.
RangeType operator|(const RangeType &rhs) const
Expands this range to include another range.
bool Contains(const T d) const
Determines if a point is contained within the range.
T Width() const
Gets the span of the range (hi - lo).
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 operator!=(const RangeType &rhs) const
Compare with another range for strict equality.
bool operator==(const RangeType &rhs) const
Compare with another range for strict equality.
Simple real-valued range.
T Lo() const
Get the lower bound.
RangeType & operator*=(const T d)
Scale the bounds by the given double.
T & Lo()
Modify the lower bound.
T Mid() const
Gets the midpoint of this range.
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...
RangeType()
The upper bound.
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...
RangeType & operator|=(const RangeType &rhs)
Expands this range to include another range.
T Hi() const
Get the upper bound.
T & Hi()
Modify the upper bound.