Givaro
ModularRandIter< Ring > Class Template Reference

Random ring Element generator. More...

#include <givranditer.h>

Common Object Interface.

These methods are required of all LinBox random ring Element generators.

typedef Ring::Element Element
 Ring Element type. More...
 
typedef Ring::Residu_t Residu_t
 Ring Element type. More...
 
 ModularRandIter (const Ring &F, const uint64_t seed=0, const Residu_t size=0)
 Constructor from ring, sampling size, and seed. More...
 
 ModularRandIter (const ModularRandIter &R)
 Copy constructor. More...
 
 ~ModularRandIter (void)
 Destructor. More...
 
ModularRandIter< Ring > & operator= (const ModularRandIter< Ring > &R)
 Assignment operator. More...
 
Elementoperator() (Element &elt) const
 Random ring Element creator with assignement. More...
 
Elementrandom (Element &elt) const
 Ring Element type. More...
 
Element operator() () const
 Ring Element type. More...
 
Element random () const
 Ring Element type. More...
 

Implementation-Specific Methods.

const Ring & ring () const
 Random generator. More...
 

Detailed Description

template<class Ring>
class Givaro::ModularRandIter< Ring >

Random ring Element generator.

This class defines a ring Element generator for all givaro modular rings (Gfq and Modular) throught a template argument as a ring. The random generator used is the givrandom.

Member Typedef Documentation

◆ Element

typedef Ring::Element Element

Ring Element type.

The ring Element must contain a default constructor, a copy constructor, a destructor, and an assignment operator.

◆ Residu_t

typedef Ring::Residu_t Residu_t

Ring Element type.

The ring Element must contain a default constructor, a copy constructor, a destructor, and an assignment operator.

Constructor & Destructor Documentation

◆ ModularRandIter() [1/2]

ModularRandIter ( const Ring &  F,
const uint64_t  seed = 0,
const Residu_t  size = 0 
)
inline

Constructor from ring, sampling size, and seed.

The random ring Element iterator works in the ring F, is seeded by seed, and it returns any one Element with probability no more than 1/min(F.cardinality()). size has no meaning in ModularRandIter. A seed of zero means to use some arbitrary seed for the generator.

Parameters
FLinBox ring archetype object in which to do arithmetic
seedconstant integer reference from which to seed random number generator (default = 0)

◆ ModularRandIter() [2/2]

ModularRandIter ( const ModularRandIter< Ring > &  R)
inline

Copy constructor.

Constructs ALP_randIter object by copying the random ring Element generator. This is required to allow generator objects to be passed by value into functions. In this implementation, this means copying the random ring Element generator to which R._randIter_ptr points.

Parameters
RALP_randIter object.

◆ ~ModularRandIter()

~ModularRandIter ( void  )
inline

Destructor.

This destructs the random ring Element generator object. In this implementation, this destroys the generator by deleting the random generator object to which _randIter_ptr points.

Member Function Documentation

◆ operator=()

ModularRandIter<Ring>& operator= ( const ModularRandIter< Ring > &  R)
inline

Assignment operator.

Assigns ALP_randIter object R to generator. In this implementation, this means copying the generator to which R._randIter_ptr points.

Parameters
RALP_randIter object.

◆ operator()() [1/2]

Element& operator() ( Element elt) const
inline

Random ring Element creator with assignement.

This returns a random ring Element from the information supplied at the creation of the generator.

Returns
random ring Element

◆ random() [1/2]

Element& random ( Element elt) const
inline

Ring Element type.

The ring Element must contain a default constructor, a copy constructor, a destructor, and an assignment operator.

◆ operator()() [2/2]

Element operator() ( ) const
inline

Ring Element type.

The ring Element must contain a default constructor, a copy constructor, a destructor, and an assignment operator.

◆ random() [2/2]

Element random ( ) const
inline

Ring Element type.

The ring Element must contain a default constructor, a copy constructor, a destructor, and an assignment operator.

◆ ring()

const Ring& ring ( ) const
inline

Random generator.


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