aboutsummaryrefslogtreecommitdiff
path: root/src/sample/uniform.rs
diff options
context:
space:
mode:
authorJulian T <julian@jtle.dk>2021-02-12 23:33:50 +0100
committerJulian T <julian@jtle.dk>2021-02-12 23:34:09 +0100
commit14f7b47f2c2315d0de5e52d31c57fe07a15d08ad (patch)
treef512e7e0939fd151cf9196004611e3cd82a95773 /src/sample/uniform.rs
parent49c6adb0db70ffc30eaac33b66eacf7574b34e26 (diff)
Implement multithreaded compiling of tiles
Diffstat (limited to 'src/sample/uniform.rs')
-rw-r--r--src/sample/uniform.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/sample/uniform.rs b/src/sample/uniform.rs
index 2cd3156..c144f27 100644
--- a/src/sample/uniform.rs
+++ b/src/sample/uniform.rs
@@ -30,4 +30,10 @@ impl Sampler for UniformSampler {
fn get_sample(&mut self) -> Float {
self.d.sample(&mut self.r)
}
+
+ fn clone_and_seed(&mut self) -> Box<dyn Sampler + Send> {
+ let mut n = self.clone();
+ n.r = Pcg32::seed_from_u64(self.r.next_u64());
+ Box::new(n)
+ }
}