Click or drag to resize
gmp_libgmp_randinit_set Method
Initialize rop with a copy of the algorithm and state from op.

Namespace:  Math.Gmp.Native
Assembly:  Math.Gmp.Native (in Math.Gmp.Native.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
public static void gmp_randinit_set(
	gmp_randstate_t rop,
	gmp_randstate_t op
)

Parameters

rop
Type: Math.Gmp.Nativegmp_randstate_t
The state to initialize.
op
Type: Math.Gmp.Nativegmp_randstate_t
The source state.
Examples
// Create new random number generator state, and initialize state with the Mersenne Twister algorithm.
gmp_randstate_t op = new gmp_randstate_t();
gmp_lib.gmp_randinit_mt(op);

// Create new random number generator state, and initialize it with the state op.
gmp_randstate_t rop = new gmp_randstate_t();
gmp_lib.gmp_randinit_set(rop, op);

// Free all memory occupied by op and rop.
gmp_lib.gmp_randclear(op);
gmp_lib.gmp_randclear(rop);
See Also