MinMaxAccumulator class
MinMaxAccumulator computes minimum and maximum values of a sequence of values.
Samples are added one by one or two by two, using the Push method. Other members are used to retrieve the results.
It is possible to accumulate samples in different objects (e.g. when processing with multiple threads),
and add the accumulators together using the + operator.
Functions
- auto Maximum() const -> dip::dfloat
- Maximum value seen so far
- auto Minimum() const -> dip::dfloat
- Minimum value seen so far
- void Push(dip::dfloat x)
- Add a sample to the accumulator
- void Push(dip::dfloat x, dip::dfloat y)
- Add two samples to the accumulator. Prefer this over adding one value at the time.
- void Reset()
- Reset the accumulator, leaving it as if newly allocated.
Operators
- auto operator+=(dip::MinMaxAccumulator const& other) -> dip::MinMaxAccumulator&
- Combine two accumulators
Function documentation
void Reset( )
Reset the accumulator, leaving it as if newly allocated.
void Push( dip::dfloat x)
Add a sample to the accumulator
void Push( dip::dfloat x, dip::dfloat y)
Add two samples to the accumulator. Prefer this over adding one value at the time.
dip::dfloat Minimum( ) const
Minimum value seen so far
dip::dfloat Maximum( ) const
Maximum value seen so far
dip::MinMaxAccumulator& operator+=( dip::MinMaxAccumulator const& other)
Combine two accumulators
dip::MinMaxAccumulator
dip:: operator+(
dip::MinMaxAccumulator lhs, dip::MinMaxAccumulator const& rhs)
Combine two accumulators