Kong
Kong

Reputation: 2422

Boost Accumulator to calculate mean and variance - Is it fast?

I am developing a real-time application and part of it requires me to compute the mean and standard deviation of the input data once. Would it be faster to use the boost accumulator or to use a vector to store the information then compute the mean and variance at the end ?

Upvotes: 1

Views: 395

Answers (1)

sehe
sehe

Reputation: 393719

Yes it's fast. And it's correct. The latter being the important feature.

No, it would not be faster to store the information first (simple logic: you'll spend time allocating memory and traversing it again).

Upvotes: 2

Related Questions