SYNOPSIS

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.

Detailed Description

Simple real-valued range.

It contains an upper and lower bound.

Definition at line 31 of file range.hpp.

Constructor & Destructor Documentation

mlpack::math::Range::Range ()\fC [inline]\fP

The upper bound. Initialize to an empty set (where lo > hi).

mlpack::math::Range::Range (const doublepoint)\fC [inline]\fP

mlpack::math::Range::Range (const doublelo, const doublehi)\fC [inline]\fP

Initializes to specified range.

Parameters:

lo Lower bound of the range.

hi Upper bound of the range.

Member Function Documentation

bool mlpack::math::Range::Contains (const doubled) const\fC [inline]\fP

Determines if a point is contained within the range.

Parameters:

d Point to check.

bool mlpack::math::Range::Contains (const \fBRange\fP &r) const\fC [inline]\fP

Determines if another range overlaps with this one.

Parameters:

r Other range.

Returns:

true if ranges overlap at all.

double mlpack::math::Range::Hi () const\fC [inline]\fP

Get the upper bound.

Definition at line 63 of file range.hpp.

References hi.

double& mlpack::math::Range::Hi ()\fC [inline]\fP

Modify the upper bound.

Definition at line 65 of file range.hpp.

References hi.

double mlpack::math::Range::Lo () const\fC [inline]\fP

Get the lower bound.

Definition at line 58 of file range.hpp.

References lo.

double& mlpack::math::Range::Lo ()\fC [inline]\fP

Modify the lower bound.

Definition at line 60 of file range.hpp.

References lo.

double mlpack::math::Range::Mid () const\fC [inline]\fP

Gets the midpoint of this range.

bool mlpack::math::Range::operator!= (const \fBRange\fP &rhs) const\fC [inline]\fP

Compare with another range for strict equality.

Parameters:

rhs Other range.

\fBRange\fP mlpack::math::Range::operator& (const \fBRange\fP &rhs) const\fC [inline]\fP

Shrinks this range to be the overlap with another range; this makes an empty set if there is no overlap.

Parameters:

rhs Other range.

\fBRange\fP& mlpack::math::Range::operator&= (const \fBRange\fP &rhs)\fC [inline]\fP

Shrinks this range to be the overlap with another range; this makes an empty set if there is no overlap.

Parameters:

rhs Other range.

\fBRange\fP mlpack::math::Range::operator* (const doubled) const\fC [inline]\fP

Scale the bounds by the given double.

Parameters:

d Scaling factor.

\fBRange\fP& mlpack::math::Range::operator*= (const doubled)\fC [inline]\fP

Scale the bounds by the given double.

Parameters:

d Scaling factor.

bool mlpack::math::Range::operator< (const \fBRange\fP &rhs) const\fC [inline]\fP

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.

Parameters:

rhs Other range.

bool mlpack::math::Range::operator== (const \fBRange\fP &rhs) const\fC [inline]\fP

Compare with another range for strict equality.

Parameters:

rhs Other range.

bool mlpack::math::Range::operator> (const \fBRange\fP &rhs) const\fC [inline]\fP

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.

Parameters:

rhs Other range.

\fBRange\fP mlpack::math::Range::operator| (const \fBRange\fP &rhs) const\fC [inline]\fP

Expands this range to include another range.

Parameters:

rhs Range to include.

\fBRange\fP& mlpack::math::Range::operator|= (const \fBRange\fP &rhs)\fC [inline]\fP

Expands this range to include another range.

Parameters:

rhs Range to include.

std::string mlpack::math::Range::ToString () const\fC [inline]\fP

Returns a string representation of an object.

double mlpack::math::Range::Width () const\fC [inline]\fP

Gets the span of the range (hi - lo).

Friends And Related Function Documentation

\fBRange\fP operator* (const doubled, const \fBRange\fP &r)\fC [friend]\fP

Scale the bounds by the given double.

Parameters:

d Scaling factor.

Member Data Documentation

double mlpack::math::Range::hi\fC [private]\fP

The lower bound.

Definition at line 35 of file range.hpp.

Referenced by Hi().

double mlpack::math::Range::lo\fC [private]\fP

Definition at line 34 of file range.hpp.

Referenced by Lo().

Author

Generated automatically by Doxygen for MLPACK from the source code.