gmp_lib.gmp_randinit_lc_2exp_size Method

GMP Native Interface for .NET

gmp_libgmp_randinit_lc_2exp_size Method
Initialize state for a linear congruential algorithm as per gmp_randinit_lc_2exp.

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 int gmp_randinit_lc_2exp_size(
	gmp_randstate_t state,
	mp_bitcnt_t size
)
Public Shared Function gmp_randinit_lc_2exp_size ( 
	state As gmp_randstate_t,
	size As mp_bitcnt_t
) As Integer
public:
static int gmp_randinit_lc_2exp_size(
	gmp_randstate_t^ state, 
	mp_bitcnt_t size
)
static member gmp_randinit_lc_2exp_size : 
        state : gmp_randstate_t * 
        size : mp_bitcnt_t -> int 

Parameters

state
Type: Math.Gmp.Nativegmp_randstate_t
The state to initialize.
size
Type: Math.Gmp.Nativemp_bitcnt_t

Return Value

Type: Int32
If successful the return value is non-zero. If size is bigger than the table data provides then the return value is zero.
Remarks

a, c and m2exp are selected from a table, chosen so that size bits (or more) of each X will be used, i.e. m2exp / 2 ≥ size.

Examples
// Create new random number generator state.
gmp_randstate_t state = new gmp_randstate_t();

// Initialize state with a linear congruential random number generator algorithm.
gmp_lib.gmp_randinit_lc_2exp_size(state, 30);

// Free all memory occupied by state.
gmp_lib.gmp_randclear(state);
' Create new random number generator state.
Dim state As New gmp_randstate_t()

' Initialize state with a linear congruential random number generator algorithm.
gmp_lib.gmp_randinit_lc_2exp_size(state, 30)

' Free all memory occupied by state.
gmp_lib.gmp_randclear(state)

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