Class Specialization
Average Accumulator
Accumulator for computing averages.
Accumulator
Average Accumulator
Accumulator<TValue, TSpec>
Include Headers
seqan/misc/misc_accumulators.h
Parameters
TValue
The type of the values to compute the average of.
TSpec
The specialization tag.
Remarks
The average of an empty sequence is defined to be 0.
Specialization of
Metafunctions
ResultReturn the result of a computation. (Accumulator)
ValueType of the items in the container or behind an iterator. (Accumulator)
Functions
averageReturn average from an accumulator.
clearResets an object. (Accumulator)
countReturn sum from an accumulator.
pushAdds a value to an accumulator. (Accumulator)
sumReturn sum from an accumulator.
Examples
This program shows how to use the Average Accumulator.
Accumulator<int, Average> acc;
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:
average: 2
sum:     6
count:   3
SeqAn - Sequence Analysis Library - www.seqan.de
 

Page built @2013/07/11 09:12:38