RandomIntegerIterator< _Unsigned, _Exact_Size > Class Template Reference

Random Integer Iterator. More...

`#include <random-integer.h>`

Collaboration diagram for RandomIntegerIterator< _Unsigned, _Exact_Size >:
[legend]

## Public Member Functions

| RandomIntegerIterator (const Integer_Domain &D, uint64_t seed=0)
| Constructor.
| RandomIntegerIterator (const Integer_Domain &D, uint64_t seed, const Integer &samplesize)
| Constructor.
| RandomIntegerIterator (const RandomIntegerIterator &R)
| copy constructor.
RandomIntegerIterator & | operator= (const RandomIntegerIterator &R)
| copy.
RandomIntegerIterator & | operator++ ()
| operator++() creates a new random integer.
const Integer_Type & | operator* () const
| get the random integer.
const Integer_Type & | randomInteger () const
| get the random integer.

## Static Public Member Functions

static void | setSeed (uint64_t ul)
| Sets the seed *** globally *** WARNING: i.e.

## Protected Attributes

size_t | _bits
| common length of all integers
Integer_Type | _integer
| the generated integer.

## Detailed Description

template<bool _Unsigned = true, bool _Exact_Size = false>
class Givaro::RandomIntegerIterator< _Unsigned, _Exact_Size >

Random Integer Iterator.

Generates integers of specified length.

Template Parameters

  _Unsigned | if `true`, then only non negative integers are generated, if `false`, their sign is random.
  _Exact_Size | if `true`, then random integers have exactly the number of required bits, if `false`, they have less than the required number of bits WARNING, the seed is *** global *** WARNING: i.e. sets the seed for all Givaro Integer

## Constructor & Destructor Documentation

## RandomIntegerIterator() [1/3]

template<bool _Unsigned = true, bool _Exact_Size = false>

RandomIntegerIterator | ( | const Integer_Domain & | D,
|  | uint64_t | seed = 0 )

inline

Constructor.

Parameters

  seed | if `0` a seed will be generated, otherwise, the provided seed will be used, *** globally *** Default bit size (30) can be changed with method 'setBitsize'

## RandomIntegerIterator() [2/3]

template<bool _Unsigned = true, bool _Exact_Size = false>

RandomIntegerIterator | ( | const Integer_Domain & | D,
|  | uint64_t | seed,
|  | const Integer & | samplesize )

inline

Constructor.

Parameters

  seed | if `0` a seed will be generated, otherwise, the provided seed will be used, *** globally ***
  samplesize | is number ofpossible random values

## RandomIntegerIterator() [3/3]

template<bool _Unsigned = true, bool _Exact_Size = false>

RandomIntegerIterator | ( | const RandomIntegerIterator< _Unsigned, _Exact_Size > & | R | ) |

inline

copy constructor.

Parameters

  R | random iterator to be copied.

## Member Function Documentation

## operator=()

template<bool _Unsigned = true, bool _Exact_Size = false>

RandomIntegerIterator & operator= | ( | const RandomIntegerIterator< _Unsigned, _Exact_Size > & | R | ) |

inline

copy.

Parameters

  R | random iterator to be copied.

## operator*()

template<bool _Unsigned = true, bool _Exact_Size = false>

const Integer_Type & operator* | ( |  | ) | const

inline

get the random integer.

returns the actual integer.

## randomInteger()

template<bool _Unsigned = true, bool _Exact_Size = false>

const Integer_Type & randomInteger | ( |  | ) | const

inline

get the random integer.

returns the actual integer.

Warning
  a new integer is not generated.

## setSeed()

template<bool _Unsigned = true, bool _Exact_Size = false>

void setSeed | ( | uint64_t | ul | ) |

inline static

Sets the seed *** globally *** WARNING: i.e.

sets the seed for all Givaro Integer Set the random seed to be `ul`.

Parameters

  ul | the new seed.

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

- random-integer.h