nxt.random_ex

Randomize existing instances and generate randomized instances of a given type.

Members

Aliases

randomize
alias randomize = randInPlace
Undocumented in source.
randomized
alias randomized = randomInstanceOf
Undocumented in source.

Functions

randInPlace
E randInPlace(E x)

Randomize value x.

randInPlace
E randInPlace(E x)

Randomize value x, optionally in range [low, high].

randInPlace
E randInPlace(E x)

Randomize value x, optional in range [low, high].

randInPlace
Rational!E randInPlace(Rational!E x)

Randomize value of x.

randInPlace
dchar randInPlace(dchar x)

Generate random value of x.

randInPlace
dstring randInPlace(dstring x)

Randomize value of x.

randInPlace
R randInPlace(R x)

Randomize value of x.

randInPlace
T randInPlace(T x)

Randomize elements of x.

randInPlace
auto ref randInPlace(T x)

Randomize members of x.

randInPlace
auto ref randInPlace(T x)

Randomize members of x.

randInPlaceBlockwise
A randInPlaceBlockwise(A x)

Blockwise-randomize elements of x of array type A. Randomizes in array blocks of type B.

randInPlaceWithElementRange
R randInPlaceWithElementRange(R x, E elementLow, E elementHigh)

Randomize all elements of x. Each element is randomized within range [elementLow, elementHigh].

randInPlaceWithRange
E randInPlaceWithRange(E x, E low, E high)

Randomize value x, optionally in range [low, high].

randInPlaceWithRange
E randInPlaceWithRange(E x, E low, E high)

Randomize value of x, optional in range [low, high].

randomInstanceOf
T randomInstanceOf()
randomInstanceOf
T randomInstanceOf(T low, T high)

Structs

Xoroshiro128plus
struct Xoroshiro128plus

Random number generator xoroshiro128+

See Also

http://forum.dlang.org/thread/byonwfghdqgcirdjyboh@forum.dlang.org

TODO: Can these be tagged with @nogc? Currently std.random.uniform may allocate.

TODO: Tags as nothrow when std.random gets there.

TODO: How to handle possibly null reference (class, dynamic types) types? Answer relates to how to randomize empty/null variable length structures (arrays, strings, etc).

- Maybe some kind of length randomization?

Meta