MLPACK
1.0.4
|
Simple real-valued range. More...
Public Member Functions | |
Range () | |
The upper bound. | |
Range (const double point) | |
Range (const double lo, const double hi) | |
Initializes to specified range. | |
bool | Contains (const double d) const |
Determines if a point is contained within the range. | |
bool | Contains (const Range &r) const |
Determines if another range overlaps with this one. | |
double | Hi () const |
Get the upper bound. | |
double & | Hi () |
Modify the upper bound. | |
double | Lo () const |
Get the lower bound. | |
double & | Lo () |
Modify the lower bound. | |
double | Mid () const |
Gets the midpoint of this range. | |
bool | operator!= (const Range &rhs) const |
Compare with another range for strict equality. | |
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 overlap. | |
Range & | operator&= (const Range &rhs) |
Shrinks this range to be the overlap with another range; this makes an empty set if there is no overlap. | |
Range | operator* (const double d) const |
Scale the bounds by the given double. | |
Range & | operator*= (const double d) |
Scale the bounds by the given double. | |
bool | operator< (const Range &rhs) const |
Compare with another range. | |
bool | operator== (const Range &rhs) const |
Compare with another range for strict equality. | |
bool | operator> (const Range &rhs) const |
Compare with another range. | |
Range | operator| (const Range &rhs) const |
Expands this range to include another range. | |
Range & | operator|= (const Range &rhs) |
Expands this range to include another range. | |
std::string | ToString () const |
Returns a string representation of an object. | |
double | Width () const |
Gets the span of the range (hi - lo). | |
Private Attributes | |
double | hi |
The lower bound. | |
double | lo |
Friends | |
Range | operator* (const double d, const Range &r) |
Scale the bounds by the given double. |
Simple real-valued range.
It contains an upper and lower bound.
mlpack::math::Range::Range | ( | ) | [inline] |
The upper bound.
Initialize to an empty set (where lo > hi).
mlpack::math::Range::Range | ( | const double | point | ) | [inline] |
mlpack::math::Range::Range | ( | const double | lo, |
const double | hi | ||
) | [inline] |
Initializes to specified range.
lo | Lower bound of the range. |
hi | Upper bound of the range. |
bool mlpack::math::Range::Contains | ( | const double | d | ) | const [inline] |
Determines if a point is contained within the range.
d | Point to check. |
bool mlpack::math::Range::Contains | ( | const Range & | r | ) | const [inline] |
Determines if another range overlaps with this one.
r | Other range. |
double mlpack::math::Range::Hi | ( | ) | const [inline] |
double& mlpack::math::Range::Hi | ( | ) | [inline] |
double mlpack::math::Range::Lo | ( | ) | const [inline] |
double& mlpack::math::Range::Lo | ( | ) | [inline] |
double mlpack::math::Range::Mid | ( | ) | const [inline] |
Gets the midpoint of this range.
bool mlpack::math::Range::operator!= | ( | const Range & | rhs | ) | const [inline] |
Compare with another range for strict equality.
rhs | Other range. |
Shrinks this range to be the overlap with another range; this makes an empty set if there is no overlap.
rhs | Other range. |
Shrinks this range to be the overlap with another range; this makes an empty set if there is no overlap.
rhs | Other range. |
Range mlpack::math::Range::operator* | ( | const double | d | ) | const [inline] |
Scale the bounds by the given double.
d | Scaling factor. |
Range& mlpack::math::Range::operator*= | ( | const double | d | ) | [inline] |
Scale the bounds by the given double.
d | Scaling factor. |
bool mlpack::math::Range::operator< | ( | const Range & | rhs | ) | const [inline] |
Compare with another range.
For Range objects x and y, x < y means that x is strictly less than y and does not overlap at all.
rhs | Other range. |
bool mlpack::math::Range::operator== | ( | const Range & | rhs | ) | const [inline] |
Compare with another range for strict equality.
rhs | Other range. |
bool mlpack::math::Range::operator> | ( | const Range & | rhs | ) | const [inline] |
Compare with another range.
For Range objects x and y, x < y means that x is strictly less than y and does not overlap at all.
rhs | Other range. |
Expands this range to include another range.
rhs | Range to include. |
Expands this range to include another range.
rhs | Range to include. |
std::string mlpack::math::Range::ToString | ( | ) | const [inline] |
Returns a string representation of an object.
double mlpack::math::Range::Width | ( | ) | const [inline] |
Gets the span of the range (hi - lo).
Scale the bounds by the given double.
d | Scaling factor. |
double mlpack::math::Range::hi [private] |
double mlpack::math::Range::lo [private] |