Next: MPIR.Net Settings, Previous: MPIR.Net Floats, Up: .Net Interface [Index]
The MPIR.Net class that wraps the MPIR random number functions is MpirRandom
.
It holds an algorithm selection and current state, as per gmp_randstate_t
.
As the multi-precision classes, MpirRandom
allocates unmanaged memory,
and should be disposed of via its IDisposable
implementation when no longer in use.
In lieu of constructors, MpirRandom
uses more descriptive static factory methods to create new instances
of specific random number generator algorithms.
Creates a new random number generator with a copy of the algorithm and state from the source instance.
Sets an initial seed value into the random number generator.
Generates a uniformly distributed random number of bitCount
bits,
i.e. in the range 0 to 2^bitCount-1 inclusive.
Generates a uniformly distributed random number in the range 0 to max-1 inclusive.
Returns an expression that generates a uniformly distributed random integer in the range 0 to 2^bitCount-1, inclusive.
Returns an expression that generates a uniformly distributed random number in the range 0 to max-1 inclusive.
Returns an expression that generates a uniformly distributed random float in the range 0 <= n < 1. As with all float expressions, precision of the destination is used when available.
Returns an expression that generates a uniformly distributed random float in the range 0 <= n < 1, with the specified number of significant mantissa bits.
Returns an expression that generates a random float with long strings of zeros and ones in the binary representation, using the precision of the destination. The argument is the maximum absolute value for the exponent of the generated number, expressed in limbs.
Returns an expression that generates a random float with long strings of zeros and ones in the binary representation, and the specified number of significant limbs in the mantissa.
Next: MPIR.Net Settings, Previous: MPIR.Net Floats, Up: .Net Interface [Index]