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

## Implementation-Specific Methods.

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

## 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

template<class Ring>

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

template<class Ring>

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]

template<class Ring>

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

  F | LinBox ring archetype object in which to do arithmetic
  seed | constant integer reference from which to seed random number generator (default = 0)

## ModularRandIter() [2/2]

template<class Ring>

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

  R | ALP_randIter object.

## ~ModularRandIter()

template<class Ring>

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

template<class Ring>

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

  R | ALP_randIter object.

## operator()() [1/2]

template<class Ring>

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]

template<class Ring>

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]

template<class Ring>

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]

template<class Ring>

Element random | ( |  | ) | 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:

- givranditer.h