linbox
1
|
#include <envelope.h>
Public Types | |
typedef ElementEnvelope< Field > | Element |
element type | |
Public Member Functions | |
RandIterEnvelope (const FieldEnvelope< Field > &F, const integer &size=0, const integer &seed=0) | |
RandIterEnvelope (const typename Field::RandIter &R) | |
RandIterEnvelope (const RandIterEnvelope &R) | |
~RandIterEnvelope () | |
RandIterAbstract & | operator= (const RandIterAbstract &R) |
RandIterAbstract * | construct (const FieldAbstract &F, const integer &size=0, const integer &seed=0) const |
RandIterAbstract * | clone (void) const |
ElementAbstract & | random (ElementAbstract &a) const |
Random field base element generator. This encapsulated class is a generator of random field base 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 base element. In this operator(), the random element is placed into the input field base element and also returned as a reference.
RandIterEnvelope | ( | const FieldEnvelope< Field > & | F, |
const integer & | size = 0 , |
||
const integer & | 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.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.
F | LinBox field envelope 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) |
RandIterEnvelope | ( | const typename Field::RandIter & | R | ) | [inline] |
Constructor from random field element generator to be wrapped
R | random field element generator object to be wrapped |
RandIterEnvelope | ( | const RandIterEnvelope< Field > & | R | ) | [inline] |
Copy constructor. Constructs RandIterEnvelope object by copying the random field element generator. This is required to allow generator objects to be passed by value into functions.
R | RandIterEnvelope object. |
~RandIterEnvelope | ( | ) | [inline] |
Destructor. Required by abstract base class. This destructs the random field element generator object.
RandIterAbstract& operator= | ( | const RandIterAbstract & | R | ) | [inline, virtual] |
Assignment operator. Assigns RandIterEnvelope object R to generator. Required by abstract base class.
R | RandIterEnvelope object. |
Implements RandIterAbstract.
RandIterAbstract* construct | ( | const FieldAbstract & | F, |
const integer & | size = 0 , |
||
const integer & | seed = 0 |
||
) | const [inline, virtual] |
Virtual constructor from field, sampling size, and seed. Required because constructors cannot be virtual. Passes construction on to derived classes. 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. Required by abstract base class.
F | LinBox field abstract 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) |
Implements RandIterAbstract.
RandIterAbstract* clone | ( | void | ) | const [inline, virtual] |
Virtual copy constructor. Required because constructors cannot be virtual. Passes construction on to derived classes. Required by abstract base class.
Implements RandIterAbstract.
ElementAbstract& random | ( | ElementAbstract & | a | ) | const [inline, virtual] |
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.
Implements RandIterAbstract.