1 /*------------------------------------------------------------------------
2 Junction: Concurrent data structures in C++
3 Copyright (c) 2016 Jeff Preshing
5 Distributed under the Simplified BSD License.
6 Original location: https://github.com/preshing/junction
8 This software is distributed WITHOUT ANY WARRANTY; without even the
9 implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10 See the LICENSE file for more information.
11 ------------------------------------------------------------------------*/
13 #include <junction/Core.h>
14 #include <junction/Averager.h>
19 double Averager::getStdDev() {
21 double avg = getAverage();
23 for (ureg i = 0; i < m_values.size(); i++) {
24 double diff = m_values[i] - avg;
27 return sqrt(dev / m_values.size());
30 } // namespace junction