Main Page   Modules   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

UnparametricRandIter Class Template Reference

#include <unparametric.h>

List of all members.


Detailed Description

template<class K>
class LinBox::UnparametricRandIter< K >

Unparameterized random field element generator template. Implements LinBox random field element generator common object interface for unparameterized fields. Used to generate efficient field classes for unparameterized fields. Constructs LinBox unparameterized random field element generators from field types K. In particular, constructs LinBox random field element generators for unparameterized fields from field types that adhere to the operations for double, for example UnparametricRandIter< float >. Can be used as a pattern to write a particular field interface, such as, UnparametricRandIter< SaclibQ > as a template specialization. This implementation uses the standard C++ random number generator. Thus, only one random field element generator can be used at a time since creating a new one will re-seed the built-in generator and affect all current LinBox generators.
Parameters:
K  unparameterized field class


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)
Elementrandom (Element &x) const

Public Methods

Implementation-Specific Methods.
These methods are not required of all \Ref{LinBox Random field element generators} and are included only for this implementation of the archetype.

Common Object Iterface UnparametricRandIter (void)
 Default constructor.


Member Typedef Documentation

typedef K Element
 

Field element type. The field element must contain a default constructor, a copy constructor, a destructor, and an assignment operator.


Constructor & Destructor Documentation

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.

Parameters:
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.

Parameters:
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.

Common Object Iterface UnparametricRandIter void    [inline]
 

Default constructor.


Member Function Documentation

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.

Parameters:
R  UnparametricRandIter object.

Element& random Element   x const [inline]
 

Random field element creator. This returns a random field element from the information supplied at the creation of the generator.

Returns:
random field element


Generated on Mon Jun 20 09:16:56 2005 for linbox by doxygen1.2.18