linbox
Public Member Functions | Protected Member Functions
RandIterAbstract Class Referenceabstract

Random field element generator. More...

#include <abstract.h>

+ Inheritance diagram for RandIterAbstract:

Public Member Functions

virtual RandIterAbstractconstruct (const FieldAbstract &F, const integer &size=0, const uint64_t seed=0) const =0
 Virtual constructor from field, sampling size, and seed. More...
 
virtual RandIterAbstractclone (void) const =0
 Virtual copy constructor. More...
 
virtual RandIterAbstractoperator= (const RandIterAbstract &x)=0
 Assignment operator. More...
 
virtual ~RandIterAbstract (void)
 Destructor.
 
virtual Elementrandom (Element &a)=0
 Random field element creator. More...
 

Protected Member Functions

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

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 random() which acts on a reference to a field element. The random value is written to the argument and also returned as a reference.

See also
Random field element generator wrappers Randiter Field Element Generator wrapper

Member Function Documentation

◆ construct()

virtual RandIterAbstract* construct ( const FieldAbstract F,
const integer size = 0,
const uint64_t  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
FLinBox field archetype object in which to do arithmetic
sizeconstant integer reference of sample size from which to sample (default = 0)
seedconstant integer reference from which to seed random number generator (default = 0)

Implemented in RandIterEnvelope< Field >.

◆ clone()

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< Field >.

◆ operator=()

virtual RandIterAbstract& operator= ( const RandIterAbstract x)
pure virtual

Assignment operator.

Purely virtual.

Parameters
xconstant reference to RandIterAbstract object
Returns
reference to self

Implemented in RandIterEnvelope< Field >.

◆ random()

virtual Element& random ( Element a)
pure virtual

Random field element creator.

Purely virtual.

Returns
reference to ElementAbstract object

Implemented in RandIterEnvelope< Field >.


The documentation for this class was generated from the following file: