Note that there are some explanatory texts on larger screens.

plurals
  1. USTyler Streeter
    primarykey
    data
    text
    plurals
    1. This table or related slice is empty.
    1. COAlso, to summarize the answers below, it seems that there are two potential problems with constantly calling `reset()` (or recreating the distribution) before generating each sample: 1) it might decrease efficiency because any cached values within the distribution are lost, and 2) (even more serious, if true) it might produce an incorrect distribution.
      singulars
    2. COIt seems that there are two use cases here: 1) binding an engine and distribution (the intended use), and 2) using multiple engines with one distribution (what I am doing here). I suppose I prefer to think of the distributions as simple stateless functions: you give them an engine, and they return a sample. But I understand the need to treat them as objects so they can cache values for efficiency. It would have been nice if the standard provided, for each distribution, both a stateless function to get just *one* sample, and an object for generating/caching *several* samples.
      singulars
    3. CO@SteveJessop: Yes, I was implying that this may be a defect in the standard. Regarding the libc++ implementation of `normal_distribution::operator()` (http://llvm.org/svn/llvm-project/libcxx/trunk/include/random), fortunately, it looks like it always uses the supplied parameters (probably the intent of the standard, as you said). However, it will sometimes use the supplied generator and sometimes use a cached value based on the previously supplied generator (possibly *not* the intent of the standard). So `d(g)` is, in your words, basically useless. But `d(g,p)` is only half useless.
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload