summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2022-10-20 02:23:29 +0200
committerStanislaw Halik <sthalik@misaki.pl>2022-10-20 02:23:29 +0200
commit8fb653c9f48b81aa2ef986ac36bdb81c1fd5a4e9 (patch)
treec22b0610ae43d988d6b16e048158973d6d37bd17 /src
parentdcac560e53d82ca8d7c8952b0a7c695ae43d09c2 (diff)
a
Diffstat (limited to 'src')
-rw-r--r--src/random.cpp3
-rw-r--r--src/random.hpp4
2 files changed, 3 insertions, 4 deletions
diff --git a/src/random.cpp b/src/random.cpp
index 82c47ff9..4da534a3 100644
--- a/src/random.cpp
+++ b/src/random.cpp
@@ -6,6 +6,8 @@ namespace floormat {
static thread_local auto g = std::independent_bits_engine<decltype(std::ranlux48{}), 32, std::uint32_t>{std::ranlux48{}};
+random_engine::~random_engine() = default;
+
struct random_engine_impl final : random_engine {
std::size_t operator()() override;
float operator()(float min, float max) override;
@@ -21,7 +23,6 @@ std::size_t random_engine_impl::operator()()
std::size_t x;
std::uint32_t a[N];
} ret;
-#pragma omp unroll full
for (std::size_t i = 0; i < N; i++)
ret.a[i] = g();
return ret.x;
diff --git a/src/random.hpp b/src/random.hpp
index 3616aabf..84d8ca2a 100644
--- a/src/random.hpp
+++ b/src/random.hpp
@@ -7,7 +7,7 @@ namespace floormat {
struct random_engine
{
- virtual inline ~random_engine();
+ virtual ~random_engine();
virtual std::common_type_t<std::size_t, std::uintptr_t, std::ptrdiff_t> operator()() = 0;
template<std::integral T>
@@ -25,8 +25,6 @@ struct random_engine
virtual float operator()(float min, float max) = 0;
};
-random_engine::~random_engine() = default;
-
[[maybe_unused]] extern random_engine& random; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables)
} // namespace floormat