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 4c9b91e9e6c6b477303944cbec15f523572f276b..61dd0aea503f7017190901fd8b6cdfccf300a4f3 100644 (file)
 #include <turf/Util.h>
 #include <turf/extra/UniqueSequence.h>
 #include <turf/extra/JobDispatcher.h>
 #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 <turf/extra/Options.h>
 #include <junction/extra/MapAdapter.h>
+#include <algorithm>
+#include <vector>
 
 using namespace turf::intTypes;
 typedef junction::extra::MapAdapter MapAdapter;
 
 using namespace turf::intTypes;
 typedef junction::extra::MapAdapter MapAdapter;
index 8f8411009a76f76e670f6d9419db0272f93f4f55..6cf2e05cbbb8204c6a7ae8376b7599bc29498d0f 100644 (file)
 #include <turf/Util.h>
 #include <turf/extra/UniqueSequence.h>
 #include <turf/extra/JobDispatcher.h>
 #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 <turf/extra/Options.h>
 #include <junction/extra/MapAdapter.h>
+#include <algorithm>
+#include <vector>
 
 using namespace turf::intTypes;
 typedef junction::extra::MapAdapter MapAdapter;
 
 using namespace turf::intTypes;
 typedef junction::extra::MapAdapter MapAdapter;