aboutsummaryrefslogtreecommitdiff
path: root/src/sampling/random.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/sampling/random.cpp')
-rw-r--r--src/sampling/random.cpp13
1 files changed, 13 insertions, 0 deletions
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());
+}
+