Givaro
GIV_randIter< Ring, Type > 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...
 
 GIV_randIter (const Ring &F, const uint64_t seed=0, const Residu_t size=0)
 Constructor from ring, sampling size, and seed. More...
 
 GIV_randIter (const GIV_randIter &R)
 Copy constructor. More...
 
 ~GIV_randIter (void)
 Destructor. More...
 
GIV_randIter< Ring, Type > & operator= (const GIV_randIter< Ring, Type > &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...
 
const Ring & ring () const
 Ring Element type. More...
 

Detailed Description

template<class Ring, class Type>
class Givaro::GIV_randIter< Ring, Type >

Random ring Element generator.

This class defines a ring Element generator for all givaro ring (Gfq and Zpz) 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

◆ GIV_randIter() [1/2]

GIV_randIter ( 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(size, F.cardinality()). A sampling size of zero means to sample from the entire ring. 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 ring.

Parameters
FLinBox ring archetype object in which to do arithmetic
sizeconstant integer reference of sample size from which to sample (default = F.cardinality())
seedconstant integer reference from which to seed random number generator (default = 0)

◆ GIV_randIter() [2/2]

GIV_randIter ( const GIV_randIter< Ring, Type > &  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.

◆ ~GIV_randIter()

~GIV_randIter ( 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=()

GIV_randIter<Ring,Type>& operator= ( const GIV_randIter< Ring, Type > &  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

Ring Element type.

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


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