Givaro
|
Random field Element generator. More...
#include <giv_randiter.h>
Public Member Functions | |
Implementation-Specific Methods. | |
GIV_randIter (void) | |
Default constructor. | |
Common Object Interface. | |
These methods are required of all LinBox random field Element generators. | |
typedef Field::Element | Element |
Field Element type. More... | |
GIV_randIter (const Field &F, const Type &size=0, const Type &seed=0) | |
Constructor from field, sampling size, and seed. More... | |
GIV_randIter (const GIV_randIter &R) | |
Copy constructor. More... | |
~GIV_randIter (void) | |
Destructor. More... | |
GIV_randIter< Field, Type > & | operator= (const GIV_randIter< Field, Type > &R) |
Assignment operator. More... | |
Element & | operator() (void) |
Random field Element creator. More... | |
Element & | random (Element &elt) const |
Random field Element creator with assignement. More... | |
Random field Element generator.
This class defines a field Element generator for all givaro field (Gfq and Zpz) throught a template argument as a field. The random generator used is the givrandom.
typedef Field::Element Element |
Field Element type.
The field Element must contain a default constructor, a copy constructor, a destructor, and an assignment operator.
|
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.cardinality()). A sampling size of zero means to sample from the entire field. A seed of zero means to use some arbitrary seed for the generator. This implementation sets the sampling size to be no more than the cardinality of the field.
F | LinBox field archetype object in which to do arithmetic |
size | constant integer reference of sample size from which to sample (default = 0) |
seed | constant integer reference from which to seed random number generator (default = 0) |
|
inline |
Copy constructor.
Constructs ALP_randIter object by copying the random field Element generator. This is required to allow generator objects to be passed by value into functions. In this implementation, this means copying the random field Element generator to which R._randIter_ptr points.
R | ALP_randIter object. |
|
inline |
Destructor.
This destructs the random field Element generator object. In this implementation, this destroys the generator by deleting the random generator object to which _randIter_ptr points.
|
inline |
Assignment operator.
Assigns ALP_randIter object R to generator. In this implementation, this means copying the generator to which R._randIter_ptr points.
R | ALP_randIter object. |
|
inline |
Random field Element creator.
This returns a random field Element from the information supplied at the creation of the generator.
Random field Element creator with assignement.
This returns a random field Element from the information supplied at the creation of the generator.