1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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
|