Reputation: 2422
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
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