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
Accumulator
Metafunctions

Result | Return the result of a computation. (Accumulator)
Value | Type of the items in the container or behind an iterator. (Accumulator)

Functions

average | Return average from an accumulator.
clear | Resets an object. (Accumulator)
count | Return sum from an accumulator.
push | Adds a value to an accumulator. (Accumulator)
sum | Return 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 @2014/10/13 16:13:00