plll  1.0
plll::arithmetic::IntegerContext::UniformRNG Class Reference

Public Member Functions

void random (Integer &res, const Integer &bound)
 Creates a random arbitrary precision integer in the range $[0, bound)$. More...
 
Integer random (const Integer &bound, const IntegerContext &ic)
 Creates and returns a random arbitrary precision integer in the range $[0, bound)$. More...
 
void randomBits (Integer &res, unsigned long bits)
 Creates random bits. More...
 
Integer randomBits (unsigned long bits, const IntegerContext &ic)
 Creates random bits. More...
 
void randomLen (Integer &res, unsigned long bits)
 Creates a random integer of a fixed bit length. More...
 
Integer randomLen (unsigned long bits, const IntegerContext &ic)
 Creates a random integer of a fixed bit length. More...
 
 UniformRNG (RandomNumberGenerator &rng) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Creates a new uniform random number generator based on the given random number generator.
 

Detailed Description

Definition at line 3592 of file arithmetic-gmp.hpp.

Member Function Documentation

void plll::arithmetic::IntegerContext::UniformRNG::random ( Integer res,
const Integer bound 
)
inline

Creates a random arbitrary precision integer in the range $[0, bound)$.

Parameters
resWhere to store the result.
boundA bound on the maximal integer returned.

Definition at line 3613 of file arithmetic-gmp.hpp.

Integer plll::arithmetic::IntegerContext::UniformRNG::random ( const Integer bound,
const IntegerContext ic 
)
inline

Creates and returns a random arbitrary precision integer in the range $[0, bound)$.

Parameters
boundA bound on the maximal integer returned.
icAn integer context.
Returns
The result.

Definition at line 3625 of file arithmetic-gmp.hpp.

void plll::arithmetic::IntegerContext::UniformRNG::randomBits ( Integer res,
unsigned long  bits 
)
inline

Creates random bits.

Parameters
resWill be filled with a random integer in range $[0, 2^{bits})$.
bitsThe number of bits.

Definition at line 3638 of file arithmetic-gmp.hpp.

Integer plll::arithmetic::IntegerContext::UniformRNG::randomBits ( unsigned long  bits,
const IntegerContext ic 
)
inline

Creates random bits.

Parameters
bitsThe number of bits.
icAn integer context.
Returns
A random integer in range $[0, 2^{bits})$.

Definition at line 3650 of file arithmetic-gmp.hpp.

void plll::arithmetic::IntegerContext::UniformRNG::randomLen ( Integer res,
unsigned long  bits 
)
inline

Creates a random integer of a fixed bit length.

Parameters
resWill be filled with a random integer in range $[2^{bits-1}, 2^{bits})$.
bitsThe number of bits.

Definition at line 3663 of file arithmetic-gmp.hpp.

Integer plll::arithmetic::IntegerContext::UniformRNG::randomLen ( unsigned long  bits,
const IntegerContext ic 
)
inline

Creates a random integer of a fixed bit length.

Parameters
bitsThe number of bits.
icAn integer context.
Returns
A random integer in range $[2^{bits-1}, 2^{bits})$.

Definition at line 3675 of file arithmetic-gmp.hpp.


The documentation for this class was generated from the following file: