You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
doubleGetNormallyDistributedNumberForEntry(unsigned long longentry)
46
46
{
47
-
// We want to generate a random number distributed according to a normal distribution in a thread-safe way and such that it is reproducible across different RDataFrame runs, i.e. given the same input to the generator it will produce the same value.
48
-
// This is one way to do it. It assumes that the input argument represents a unique entry ID, such that any thread processing an RDataFrame task will see this number once throughout the entire execution of the computation graph
47
+
// We want to generate a random number distributed according to a normal distribution in a thread-safe way and such
48
+
// that it is reproducible across different RDataFrame runs, i.e. given the same input to the generator it will
49
+
// produce the same value. This is one way to do it. It assumes that the input argument represents a unique entry ID,
50
+
// such that any thread processing an RDataFrame task will see this number once throughout the entire execution of
// Calling both `reset` and `seed` methods is fundamental here to ensure reproducibility: without them the same generator could be seeded by a different entry (depending on which is the first entry ID seen by a thread) or could be at a different step of the sequence (depending how many entries this particular thread is processing).
52
-
// Alternatively, if both the generator and the distribution objects were recreated from scratch at every function call (i.e. by removing the `thread_local` attribute), then the next two method calls would not be necessary, at the cost of a possible performance degradation.
54
+
// Calling both `reset` and `seed` methods is fundamental here to ensure reproducibility: without them the same
55
+
// generator could be seeded by a different entry (depending on which is the first entry ID seen by a thread) or
56
+
// could be at a different step of the sequence (depending how many entries this particular thread is processing).
57
+
// Alternatively, if both the generator and the distribution objects were recreated from scratch at every function
58
+
// call (i.e. by removing the `thread_local` attribute), then the next two method calls would not be necessary, at
59
+
// the cost of a possible performance degradation.
0 commit comments