summaryrefslogtreecommitdiff
path: root/Homework/cs3460/array_perf/sortutils.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'Homework/cs3460/array_perf/sortutils.hpp')
-rw-r--r--Homework/cs3460/array_perf/sortutils.hpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/Homework/cs3460/array_perf/sortutils.hpp b/Homework/cs3460/array_perf/sortutils.hpp
new file mode 100644
index 0000000..202ca4e
--- /dev/null
+++ b/Homework/cs3460/array_perf/sortutils.hpp
@@ -0,0 +1,36 @@
+#ifndef SORTUTILS_HPP
+#define SORTUTILS_HPP
+
+#include <algorithm>
+#include <array>
+#include <chrono>
+#include <cmath>
+#include <cstdint>
+#include <execution>
+#include <functional>
+#include <iostream>
+#include <random>
+#if defined(_MSC_VER)
+ #pragma warning(push)
+ #pragma warning(disable : 4189) // Disable some compiler warnings that come from fmt
+#endif
+#include <fmt/std.h>
+#if defined(_MSC_VER)
+ #pragma warning(pop)
+#endif
+
+const std::size_t HOW_MANY_ELEMENTS = 250000;
+const std::uint8_t HOW_MANY_TIMES = 25;
+using SourceArray = std::array<int, HOW_MANY_ELEMENTS>;
+
+void initializeRawArrayFromStdArray(const SourceArray& source, int dest[]);
+
+void organPipeStdArray(SourceArray& data);
+
+void evaluateRawArray(const SourceArray& random, const SourceArray& sorted, const SourceArray& reversed, const SourceArray& organPipe, const SourceArray& rotated);
+
+void evaluateStdArray(const SourceArray& random, const SourceArray& sorted, const SourceArray& reversed, const SourceArray& organPipe, const SourceArray& rotated);
+
+void evaluateStdVector(const SourceArray& random, const SourceArray& sorted, const SourceArray& reversed, const SourceArray& organPipe, const SourceArray& rotated);
+
+#endif // SORTUTILS_HPP