Main Page | Modules | Namespace List | Class Hierarchy | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages

RandIterAbstract Class Reference

#include <abstract.h>

Inheritance diagram for RandIterAbstract:

RandIterEnvelope

Detailed Description

Random field element generator. 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.


Public Types

typedef ElementAbstract Element

Public Member Functions

virtual RandIterAbstractconstruct (const FieldAbstract &F, const integer &size=0, const integer &seed=0) const =0
virtual RandIterAbstractclone (void) const =0
virtual RandIterAbstractoperator= (const RandIterAbstract &x)=0
virtual ~RandIterAbstract (void)
virtual Elementrandom (Element &a) const =0

Protected Member Functions

 RandIterAbstract (void)


Member Typedef Documentation

typedef ElementAbstract Element
 

Reimplemented in RandIterEnvelope.


Constructor & Destructor Documentation

virtual ~RandIterAbstract void   )  [inline, virtual]
 

Destructor.

RandIterAbstract void   )  [inline, protected]
 

Default constructor Required by derived classes, but protected because this class should never be constructed by itself.


Member Function Documentation

virtual RandIterAbstract* construct const FieldAbstract F,
const integer size = 0,
const integer seed = 0
const [pure 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. Purely virtual.

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)

Implemented in RandIterEnvelope.

virtual RandIterAbstract* clone void   )  const [pure virtual]
 

Virtual copy constructor. Required because constructors cannot be virtual. Passes construction on to derived classes. Purely virtual.

Returns:
pointer to new RandIterAbstract object in dynamic memory.

Implemented in RandIterEnvelope.

virtual RandIterAbstract& operator= const RandIterAbstract x  )  [pure virtual]
 

Assignment operator. Purely virtual.

Parameters:
x constant reference to RandIterAbstract object
Returns:
reference to self

Implemented in RandIterEnvelope.

virtual Element& random Element a  )  const [pure virtual]
 

Random field element creator. Purely virtual.

Returns:
reference to ElementAbstract object


Generated on Fri Jul 8 10:29:55 2005 for linbox by doxygen 1.3.7