linbox
Public Member Functions
GenericRandIter< Field > Class Template Reference

Random field base element generator. More...

#include <generic.h>

Public Member Functions

 GenericRandIter (const Field &F, const integer &size=0, const uint64_t seed=0)
 Constructor from field, sampling size, and seed. More...
 
Element & random (Element &a) const
 Random field element creator. More...
 
ElementAbstractrandom (ElementAbstract &a) const
 Random field element creator. More...
 

Detailed Description

template<class Field>
class LinBox::GenericRandIter< Field >

Random field base element generator.

This is a generator of random field elements that can be used with any field. It initializes elements using rand(). For prime fields with p < 2^32, a near-uniform distrubution can be expected. For larger fields or non-prime fields, a near-uniform distribution on an unspecified subset of the elements can be expected.

Constructor & Destructor Documentation

◆ GenericRandIter()

GenericRandIter ( const Field &  F,
const integer size = 0,
const uint64_t  seed = 0 
)
inline

Constructor from field, sampling size, and seed.

The random field element iterator works in the field F, is seeded by seed, and it returns any one element with probability no more than 1/min (size, F.characteristic(c)). A sampling size of zero means to sample from the entire prime subfield. A seed of zero means to use some arbitrary seed for the generator which will vary from run to run.

Parameters
FLinBox field in which to do arithmetic
sizeconstant integer reference of sample size from which to sample (default = modulus of field)
seedconstant integer reference from which to seed random number generator (default = 0)

Member Function Documentation

◆ random() [1/2]

Element& random ( Element &  a) const
inline

Random field element creator.

This returns a random field element from the information supplied at the creation of the generator. Required by abstract base class.

Returns
reference to random field element

◆ random() [2/2]

ElementAbstract& random ( ElementAbstract a) const
inline

Random field element creator.

This returns a random field element from the information supplied at the creation of the generator. Required by abstract base class.

Returns
reference to random field element

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