14 #ifndef __MLPACK_CORE_MATH_RANGE_HPP
15 #define __MLPACK_CORE_MATH_RANGE_HPP
39 inline Range(
const double point);
47 inline Range(
const double lo,
const double hi);
50 inline double Lo()
const {
return lo; }
52 inline double&
Lo() {
return lo; }
55 inline double Hi()
const {
return hi; }
57 inline double&
Hi() {
return hi; }
62 inline double Width()
const;
67 inline double Mid()
const;
155 inline bool Contains(
const double d)
const;
169 inline std::string
ToString()
const;
177 #include "range_impl.hpp"
179 #endif // __MLPACK_CORE_MATH_RANGE_HPP
double Hi() const
Get the upper bound.
double hi
The lower bound.
Linear algebra utility functions, generally performed on matrices or vectors.
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.