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