linbox
Public Types | Public Member Functions
RandIterEnvelope< Field > Class Template Reference

Random field base element generator. More...

#include <envelope.h>

+ Inheritance diagram for RandIterEnvelope< Field >:
+ Collaboration diagram for RandIterEnvelope< Field >:

Public Types

typedef ElementEnvelope< Field > Element
 element type
 

Public Member Functions

 RandIterEnvelope (const FieldEnvelope< Field > &F, const integer &size=0, const uint64_t seed=0)
 Constructor from field, sampling size, and seed. More...
 
 RandIterEnvelope (const typename Field::RandIter &R)
 Constructor from random field element generator to be wrapped. More...
 
 RandIterEnvelope (const RandIterEnvelope &R)
 Copy constructor. More...
 
 ~RandIterEnvelope ()
 Destructor. More...
 
RandIterAbstractoperator= (const RandIterAbstract &R)
 Assignment operator. More...
 
RandIterAbstractconstruct (const FieldAbstract &F, const integer &size=0, const uint64_t seed=0) const
 Virtual constructor from field, sampling size, and seed. More...
 
RandIterAbstractclone (void) const
 Virtual copy constructor. More...
 
ElementAbstractrandom (ElementAbstract &a)
 Random field element creator. More...
 

Detailed Description

template<class Field>
class LinBox::RandIterEnvelope< Field >

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.

Constructor & Destructor Documentation

◆ RandIterEnvelope() [1/3]

RandIterEnvelope ( const FieldEnvelope< Field > &  F,
const integer size = 0,
const uint64_t  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.

Parameters
FLinBox field envelope 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)

◆ RandIterEnvelope() [2/3]

RandIterEnvelope ( const typename Field::RandIter &  R)
inline

Constructor from random field element generator to be wrapped.

Parameters
Rrandom field element generator object to be wrapped

◆ RandIterEnvelope() [3/3]

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.

Parameters
RRandIterEnvelope object.

◆ ~RandIterEnvelope()

~RandIterEnvelope ( )
inline

Destructor.

Required by abstract base class. This destructs the random field element generator object.

Member Function Documentation

◆ operator=()

RandIterAbstract& operator= ( const RandIterAbstract R)
inlinevirtual

Assignment operator.

Assigns RandIterEnvelope object R to generator. Required by abstract base class.

Parameters
RRandIterEnvelope object.

Implements RandIterAbstract.

◆ construct()

RandIterAbstract* construct ( const FieldAbstract F,
const integer size = 0,
const uint64_t  seed = 0 
) const
inlinevirtual

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.

Parameters
FLinBox field abstract 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)

Implements RandIterAbstract.

◆ clone()

RandIterAbstract* clone ( void  ) const
inlinevirtual

Virtual copy constructor.

Required because constructors cannot be virtual. Passes construction on to derived classes. Required by abstract base class.

Returns
pointer to new RandIterAbstract object in dynamic memory.

Implements RandIterAbstract.

◆ random()

ElementAbstract& random ( ElementAbstract a)
inlinevirtual

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.

Returns
reference to random field element

Implements RandIterAbstract.


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