OpenCurves
0.9
|
Utility functions for sampling and filtering plots and expression evaluation. More...
Classes | |
class | RefCountObject |
A base class for adding reference counting to a class. More... | |
class | RefCountPtr |
A pointer wrapper for a reference counted object such as RefCountObject . More... | |
Functions | |
double | filter (double value, double filterResult, bool zeroInf, bool zeroNaN) |
Filters value for infinite and NaN results, returning a valid result instead. More... | |
Utility functions for sampling and filtering plots and expression evaluation.
double plotutil::filter | ( | double | value, |
double | filterResult, | ||
bool | zeroInf, | ||
bool | zeroNaN | ||
) |
Filters value
for infinite and NaN
results, returning a valid result instead.
Invalid values are either returned as zero or as filterResult
. Infinite values are converted according to zeroInf
, while NaN values are converted according to zeroNaN
. The result is zero when an invalid value is found and the respective control parameter is true
. The result is filterResult
when an invalid value is found and the control parameter is false
.
value | The value to filter. |
filterResult | The value to return when value is invalid and the respective control parameter is false . |
zeroInf | True to replace infinite values with zero. False to replace with filterResult . |
zeroNaN | True to replace NaN values with zero. False to replace with filterResult . |
value
when it is neither infinite nor NaN. Otherwise zero or filterResult
are returned.