Class Specialization
Average Accumulator
Accumulator for computing averages.
![]() | ![]() | ||||||
Average Accumulator |
Include Headers
seqan/misc/misc_accumulators.h
Parameters
The type of the values to compute the average of. | |
The specialization tag. |
Remarks
The average of an empty sequence is defined to be 0.
Specialization of
Metafunctions
Return the result of a computation. (Accumulator) | |
Type of the items in the container or behind an iterator. (Accumulator) |
Functions
Return average from an accumulator. | |
Resets an object. (Accumulator) | |
Return sum from an accumulator. | |
Adds a value to an accumulator. (Accumulator) | |
Return sum from an accumulator. |
Examples
This program shows how to use the Average Accumulator.
push(acc, 1);
push(acc, 2);
push(acc, 3);
std::cout << "average: " << average(acc) << "\n"
<< "sum: " << sum(acc) << "\n"
<< "count: " << count(acc) << "\n";
The output is then:
sum: 6
count: 3
SeqAn - Sequence Analysis Library - www.seqan.de