From 94217187eb2785939458f08d96c7b1b9e55439ab Mon Sep 17 00:00:00 2001 From: Julian T Date: Sun, 17 Jan 2021 00:09:15 +0100 Subject: Minor changed and draft for random sampling --- src/sampling/random.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 src/sampling/random.cpp (limited to 'src/sampling/random.cpp') diff --git a/src/sampling/random.cpp b/src/sampling/random.cpp new file mode 100644 index 0000000..d77e78a --- /dev/null +++ b/src/sampling/random.cpp @@ -0,0 +1,13 @@ +#include "random.hpp" + +RandomSampler::RandomSampler(long samples, int seed) + : Sampler(samples), m_rng(seed) {} + +double RandomSampler::getSample() { + return m_rng.getDouble(); +} + +Vec2d RandomSampler::get2dSample() { + return Vec2d(m_rng.getDouble(), m_rng.getDouble()); +} + -- cgit v1.2.3