Delete unused junction/Averager.h
authorJeff Preshing <filter-github@preshing.com>
Tue, 2 Feb 2016 21:24:53 +0000 (16:24 -0500)
committerJeff Preshing <filter-github@preshing.com>
Tue, 2 Feb 2016 21:24:53 +0000 (16:24 -0500)
junction/Averager.cpp [deleted file]
junction/Averager.h [deleted file]
samples/MapPerformanceTests/MapPerformanceTests.cpp
samples/MapScalabilityTests/MapScalabilityTests.cpp

diff --git a/junction/Averager.cpp b/junction/Averager.cpp
deleted file mode 100644 (file)
index 8ee0d00..0000000
+++ /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 <junction/Core.h>
-#include <junction/Averager.h>
-#include <math.h>
-
-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 (file)
index 0c30fb2..0000000
+++ /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 <junction/Core.h>
-#include <vector>
-#include <algorithm>
-
-namespace junction {
-
-class Averager {
-private:
-    std::vector<double> 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
index 4c9b91e..61dd0ae 100644 (file)
 #include <turf/Util.h>
 #include <turf/extra/UniqueSequence.h>
 #include <turf/extra/JobDispatcher.h>
-#include <junction/Averager.h>
 #include <turf/extra/Options.h>
 #include <junction/extra/MapAdapter.h>
+#include <algorithm>
+#include <vector>
 
 using namespace turf::intTypes;
 typedef junction::extra::MapAdapter MapAdapter;
index 8f84110..6cf2e05 100644 (file)
 #include <turf/Util.h>
 #include <turf/extra/UniqueSequence.h>
 #include <turf/extra/JobDispatcher.h>
-#include <junction/Averager.h>
 #include <turf/extra/Options.h>
 #include <junction/extra/MapAdapter.h>
+#include <algorithm>
+#include <vector>
 
 using namespace turf::intTypes;
 typedef junction::extra::MapAdapter MapAdapter;