randArray

Allows the creation of an array of random numbers with an explicitly specified type. Useful, for example, when single-precision floats are all you need.

  1. auto randArray(size_t N, auto ref Args args)
  2. R[] randArray(size_t N, auto ref Args args)
    R[]
    randArray
    (
    R
    alias randFun
    Args...
    )
    (
    size_t N
    ,
    auto ref Args args
    )

Examples

// Create an array of 10 million floats distributed Normal(0, 1).
float[] normals = randArray!(float, rNormal)(10, 0, 1);

Meta