linbox
|
Random field element generator archetype. More...
#include <archetype.h>
Public Member Functions | |
Implementation-Specific Methods. | |
These methods are not required of all LinBox random field element generators and are included only for this implementation of the archetype. | |
RandIterArchetype (RandIterAbstract *randIter_ptr) | |
Constructor. More... | |
Common Object Interface. | |
These methods are required of all LinBox field element generators. | |
typedef ElementArchetype | Element |
element type | |
RandIterArchetype (const FieldArchetype &F, const integer &size=0, const uint64_t seed=0) | |
Constructor from field, sampling size, and seed. More... | |
RandIterArchetype (const RandIterArchetype &R) | |
Copy constructor. More... | |
template<class Field_qcq > | |
RandIterArchetype (Field_qcq *f, const integer &size=0, const uint64_t seed=0) | |
Constructor. More... | |
~RandIterArchetype () | |
Destructor. More... | |
RandIterArchetype & | operator= (const RandIterArchetype &R) |
Assignment operator. More... | |
Element & | random (Element &a) const |
Random field element creator. More... | |
Random field element generator archetype.
This encapsulated class is a generator of random field elements for the encapsulating field. It is required to contain constructors from a field object and two integers. The first integer being a cardinality of a set to draw the random elements from, and the second being a seed for the random number generator. It is also required to contain a copy constructor, a destructor, and an operator () which acts on a reference to a field element. In this operator (), the random element is placed into the input field element and also returned as a reference.
|
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 (c)).
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. In this implementation, this means copying the field to which F._field_ptr
points, the element to which F._elem_ptr
points, and the random element generator to which F._randIter_ptr
points.
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 RandIterArchetype 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 | RandIterArchetype object. |
|
inline |
Constructor.
Constructs RandIterArchetype from ANYTHING matching the interface using the enveloppe as a FieldAbstract and its encapsulated element and random element generator if needed.
f | |
size | |
seed |
|
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 |
Constructor.
Constructs field from pointer to RandIterAbstract. Not part of the interface. Creates new copies of random iterator generator object in dynamic memory.
randIter_ptr | pointer to RandIterAbstract |
|
inline |
Assignment operator.
Assigns RandIterArchetype object R to generator. In this implementation, this means copying the generator to which R._randIter_ptr
points.
R | RandIterArchetype object. |
Random field element creator.
This returns a random field element from the information supplied at the creation of the generator.