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; }
73 inline T
Width()
const;
130 template<
typename TT>
168 inline bool Contains(
const T d)
const;
182 template<
typename Archive>
183 void serialize(Archive& ar,
const uint32_t version);
192 #endif // MLPACK_CORE_MATH_RANGE_HPP T Lo() const
Get the lower bound.
Definition: range.hpp:61
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...
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: cv.hpp:1
RangeType operator|(const RangeType &rhs) const
Expands this range to include another range.
Definition: range_impl.hpp:79
bool operator<(const RangeType &rhs) const
Compare with another range.
Definition: range_impl.hpp:172
RangeType< double > Range
3.0.0 TODO: break reverse-compatibility by changing RangeType to Range.
Definition: range.hpp:19
Implementation of the (inlined) Range class.
bool operator!=(const RangeType &rhs) const
Compare with another range for strict equality.
Definition: range_impl.hpp:162
RangeType & operator*=(const T d)
Scale the bounds by the given double.
Definition: range_impl.hpp:111
Simple real-valued range.
Definition: range.hpp:19
void serialize(Archive &ar, const uint32_t version)
Serialize the range object.
Definition: range_impl.hpp:204
T & Lo()
Modify the lower bound.
Definition: range.hpp:63
T Hi() const
Get the upper bound.
Definition: range.hpp:66
RangeType & operator|=(const RangeType &rhs)
Expands this range to include another range.
Definition: range_impl.hpp:68
bool Contains(const T d) const
Determines if a point is contained within the range.
Definition: range_impl.hpp:187
RangeType()
The upper bound.
Definition: range_impl.hpp:25
bool operator>(const RangeType &rhs) const
Compare with another range.
Definition: range_impl.hpp:178
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...
T Width() const
Gets the span of the range (hi - lo).
Definition: range_impl.hpp:47
bool operator==(const RangeType &rhs) const
Compare with another range for strict equality.
Definition: range_impl.hpp:156
RangeType operator*(const T d) const
Scale the bounds by the given double.
Definition: range_impl.hpp:128
T & Hi()
Modify the upper bound.
Definition: range.hpp:68
T Mid() const
Gets the midpoint of this range.
Definition: range_impl.hpp:59