#include <unparametric.h>
Common Object Interface. | |
These methods are required of all LinBox random field element generators. | |
typedef K | Element |
UnparametricRandIter (const UnparametricField< K > &F, const integer &size=0, const integer &seed=0) | |
UnparametricRandIter (const UnparametricRandIter &R) | |
~UnparametricRandIter (void) | |
UnparametricRandIter & | operator= (const UnparametricRandIter &R) |
Element & | random (Element &x) const |
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. | |
UnparametricRandIter (void) | |
Default constructor. | |
class RR. | |
Rational number field. This field is provided as a convenience in a few places. Use with caution because expression swell.
This specialization allows the UnparametricField} template class to be used to wrap NTL's RR class as a LinBox field. | |
template<> | |
NTL::RR & | random (NTL::RR &elt) const |
K | unparameterized field class |
typedef K Element |
Field element type. The field element must contain a default constructor, a copy constructor, a destructor, and an assignment operator.
UnparametricRandIter | ( | const UnparametricField< K > & | 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. 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) |
UnparametricRandIter | ( | const UnparametricRandIter< K > & | R | ) | [inline] |
Copy constructor. Constructs UnparametricRandIter 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 | UnparametricRandIter object. |
~UnparametricRandIter | ( | void | ) | [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.
UnparametricRandIter& operator= | ( | const UnparametricRandIter< K > & | R | ) | [inline] |
Assignment operator. Assigns UnparametricRandIter object R to generator. In this implementation, this means copying the generator to which R._randIter_ptr points.
R | UnparametricRandIter object. |
Random field element creator. This returns a random field element from the information supplied at the creation of the generator.
NTL::RR & random | ( | NTL::RR & | elt | ) | const [inline] |
Random field element creator. This returns a random field element from the information supplied at the creation of the generator. This generator uses the built-in C++ random number generator instead of NTL's random function because the NTL function does not allow as much control over the sampling size as the generic LinBox template. This specialization is included only to allow conversion to an NTL object.