|
MathPlot
|
Represents a numeric range with minimum and maximum values. More...
#include <mathplot.h>

Public Member Functions | |
| mpRange () | |
| Default constructor. | |
| mpRange (T value1, T value2) | |
| Create range with the 2 values. | |
| void | Set (T _value) |
| Initialize min and max. | |
| void | Set (T _min, T _max) |
| Set min, max function. | |
| void | SetMin (T _min) |
| Set min function, correct max. | |
| void | SetMax (T _max) |
| Set max function, correct min. | |
| void | Assign (T value1, T value2) |
| Assign values to min and max. | |
| bool | IsSet () |
| Check if this mpRange has been assigned any values. | |
| void | Update (T value) |
| Update range according new value: Expand the range to include the value. More... | |
| void | Update (T _min, T _max) |
| Update range with new min and max values if this expand the range If _min < min then min = _min and if _max > max then max = _max. | |
| void | Update (mpRange range) |
| Update range with new range values if this expand the range. | |
| void | Check (void) |
| Check to always have a range. If min = max then introduce the 0 to make a range. | |
| T | Length (void) const |
| Length of the range. | |
| T | GetCenter (void) const |
| Center of the range. | |
| T | GetMaxAbs (void) const |
| Returns max absolute value of the range. | |
| void | ToLog (void) |
| Convert to log range. | |
| bool | PointIsInside (T point) const |
| Return true if the point is inside the range (min and max included) | |
| bool | operator== (const mpRange &other) const |
| bool | operator!= (const mpRange &other) const |
Public Attributes | |
| T | min = 0 |
| The min value of the range. | |
| T | max = 0 |
| The max value of the range. | |
Represents a numeric range with minimum and maximum values.
This struct holds a range defined by min and max values. It supports equality comparison using the default operator==.
|
inline |
Update range according new value: Expand the range to include the value.
If value < min then min = value and if value > max then max = value
1.8.13