|
| Accum (T const &init) |
| Initializes the internal value (usually to zero).
|
|
| Accum (void) |
| Leaves internal value uninitialized.
|
|
void | add (T const &value, float weight) |
| Adds the weighted given value to the internal value.
|
|
T | normalized (float weight) const |
| Returns a normalized version of the internal value, i.e.
|
|
T | normalized (void) const |
| Returns a normalized version of the internal value, i.e.
|
|
void | sub (T const &value, float weight) |
| Subtracts the weighted given value from the internal value.
|
|
template<typename T>
class math::Accum< T >
Accumulator class that operates on arbitrary types.
The idea behind this is that values can be accumulated even for basic integral types, such as unsigned chars, where accumulation would normally quickly cause overflows or rounding errors.
Accumulation of arbitrary types is handled by specializations of the 'Accum' class. For example, unsigned char values are all internally converted to float to achieve accurate results.
Note: This class currently supports:
- Floating point types
- unsigned char (through specialization)
Definition at line 34 of file accum.h.