From e8712e58dc2b7a0e9df8c5779572be3f8c71ff8d Mon Sep 17 00:00:00 2001 From: Jeff Preshing Date: Tue, 2 Feb 2016 16:24:53 -0500 Subject: [PATCH] Delete unused junction/Averager.h --- junction/Averager.cpp | 30 --------- junction/Averager.h | 63 ------------------- .../MapPerformanceTests.cpp | 3 +- .../MapScalabilityTests.cpp | 3 +- 4 files changed, 4 insertions(+), 95 deletions(-) delete mode 100644 junction/Averager.cpp delete mode 100644 junction/Averager.h diff --git a/junction/Averager.cpp b/junction/Averager.cpp deleted file mode 100644 index 8ee0d00..0000000 --- a/junction/Averager.cpp +++ /dev/null @@ -1,30 +0,0 @@ -/*------------------------------------------------------------------------ - Junction: Concurrent data structures in C++ - Copyright (c) 2016 Jeff Preshing - - Distributed under the Simplified BSD License. - Original location: https://github.com/preshing/junction - - This software is distributed WITHOUT ANY WARRANTY; without even the - implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the LICENSE file for more information. -------------------------------------------------------------------------*/ - -#include -#include -#include - -namespace junction { - -double Averager::getStdDev() { - finalize(); - double avg = getAverage(); - double dev = 0; - for (ureg i = 0; i < m_values.size(); i++) { - double diff = m_values[i] - avg; - dev += diff * diff; - } - return sqrt(dev / m_values.size()); -} - -} // namespace junction diff --git a/junction/Averager.h b/junction/Averager.h deleted file mode 100644 index 0c30fb2..0000000 --- a/junction/Averager.h +++ /dev/null @@ -1,63 +0,0 @@ -/*------------------------------------------------------------------------ - Junction: Concurrent data structures in C++ - Copyright (c) 2016 Jeff Preshing - - Distributed under the Simplified BSD License. - Original location: https://github.com/preshing/junction - - This software is distributed WITHOUT ANY WARRANTY; without even the - implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the LICENSE file for more information. -------------------------------------------------------------------------*/ - -#ifndef JUNCTION_AVERAGER_H -#define JUNCTION_AVERAGER_H - -#include -#include -#include - -namespace junction { - -class Averager { -private: - std::vector m_values; - bool m_finalized; - -public: - Averager() : m_finalized(false) { - } - - void add(double value) { - TURF_ASSERT(!m_finalized); - m_values.push_back(value); - } - - ureg getNumValues() const { - return m_values.size(); - } - - void finalize(ureg bestValueCount = 0) { - if (!m_finalized) { - std::sort(m_values.begin(), m_values.end()); - if (bestValueCount) - m_values.resize(bestValueCount); - m_finalized = true; - } - } - - double getAverage() { - finalize(); - double sum = 0; - for (ureg i = 0; i < m_values.size(); i++) { - sum += m_values[i]; - } - return sum / m_values.size(); - } - - double getStdDev(); -}; - -} // namespace junction - -#endif // JUNCTION_AVERAGER_H diff --git a/samples/MapPerformanceTests/MapPerformanceTests.cpp b/samples/MapPerformanceTests/MapPerformanceTests.cpp index 4c9b91e..61dd0ae 100644 --- a/samples/MapPerformanceTests/MapPerformanceTests.cpp +++ b/samples/MapPerformanceTests/MapPerformanceTests.cpp @@ -15,9 +15,10 @@ #include #include #include -#include #include #include +#include +#include using namespace turf::intTypes; typedef junction::extra::MapAdapter MapAdapter; diff --git a/samples/MapScalabilityTests/MapScalabilityTests.cpp b/samples/MapScalabilityTests/MapScalabilityTests.cpp index 8f84110..6cf2e05 100644 --- a/samples/MapScalabilityTests/MapScalabilityTests.cpp +++ b/samples/MapScalabilityTests/MapScalabilityTests.cpp @@ -15,9 +15,10 @@ #include #include #include -#include #include #include +#include +#include using namespace turf::intTypes; typedef junction::extra::MapAdapter MapAdapter; -- 2.34.1