gmp_lib.gmp_randinit_set Method

GMP Native Interface for .NET

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
)
Public Shared Sub gmp_randinit_set ( 
	rop As gmp_randstate_t,
	op As gmp_randstate_t
)
public:
static void gmp_randinit_set(
	gmp_randstate_t^ rop, 
	gmp_randstate_t^ op
)
static member gmp_randinit_set : 
        rop : gmp_randstate_t * 
        op : gmp_randstate_t -> unit 

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);
' Create new random number generator state, and initialize state with the Mersenne Twister algorithm.
Dim op As New gmp_randstate_t()

gmp_lib.gmp_randinit_mt(op)

' Create new random number generator state, and initialize it with the state op.
Dim rop As 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)

No code example is currently available or this language may not be supported.

No code example is currently available or this language may not be supported.

See Also