22 #ifndef __MLPACK_CORE_MATH_RANGE_HPP
23 #define __MLPACK_CORE_MATH_RANGE_HPP
47 inline Range(
const double point);
55 inline Range(
const double lo,
const double hi);
58 inline double Lo()
const {
return lo; }
60 inline double&
Lo() {
return lo; }
63 inline double Hi()
const {
return hi; }
65 inline double&
Hi() {
return hi; }
70 inline double Width()
const;
75 inline double Mid()
const;
163 inline bool Contains(
const double d)
const;
177 inline std::string
ToString()
const;
185 #include "range_impl.hpp"
187 #endif // __MLPACK_CORE_MATH_RANGE_HPP
double Hi() const
Get the upper bound.
double hi
The lower bound.
Range operator*(const double d) const
Scale the bounds by the given double.
Range & operator|=(const Range &rhs)
Expands this range to include another range.
double Lo() const
Get the lower bound.
double & Hi()
Modify the upper bound.
bool operator==(const Range &rhs) const
Compare with another range for strict equality.
double & Lo()
Modify the lower bound.
std::string ToString() const
Returns a string representation of an object.
bool operator!=(const Range &rhs) const
Compare with another range for strict equality.
double Mid() const
Gets the midpoint of this range.
Range operator|(const Range &rhs) const
Expands this range to include another range.
bool Contains(const double d) const
Determines if a point is contained within the range.
double Width() const
Gets the span of the range (hi - lo).
bool operator>(const Range &rhs) const
Compare with another range.
Range operator&(const Range &rhs) const
Shrinks this range to be the overlap with another range; this makes an empty set if there is no overl...
Simple real-valued range.
Range & operator&=(const Range &rhs)
Shrinks this range to be the overlap with another range; this makes an empty set if there is no overl...
bool operator<(const Range &rhs) const
Compare with another range.
Range & operator*=(const double d)
Scale the bounds by the given double.