linbox
Public Types | Public Member Functions
RandomPrimeIter Class Reference

Random Prime Iterator. More...

#include <random-prime.h>

Public Types

typedef integer Prime_Type
 prime type
 

Public Member Functions

 RandomPrimeIter (uint64_t bits=30, uint64_t seed=0)
 Constructor. More...
 
 ~RandomPrimeIter ()
 destructor.
 
 RandomPrimeIter (const RandomPrimeIter &R)
 copy constructor. More...
 
RandomPrimeIteroperator= (const RandomPrimeIter &R)
 copy. More...
 
integerrandom (integer &a) const
 get a random prime of maximum size _bits . More...
 
integerrandom_exact (integer &a) const
 
integerrandom_between (integer &a, uint64_t _low_bits) const
 

Detailed Description

Random Prime Iterator.

Generates prime of size smaller than a prescribed one. This class is closer to the LinBox::RandIterArchetype.

Todo:
one could create the same one on a LinBox::PID_double ?

Constructor & Destructor Documentation

RandomPrimeIter ( uint64_t  bits = 30,
uint64_t  seed = 0 
)
inline

Constructor.

Parameters
bitsmax size of primes (in bits). Default is 30 so it can fit in a Linbox::Modular<double>.
seedif 0 a seed will be generated, otherwise, the provided seed will be use.
RandomPrimeIter ( const RandomPrimeIter R)
inline

copy constructor.

Parameters
Rrandom iterator to be copied.

Member Function Documentation

RandomPrimeIter& operator= ( const RandomPrimeIter R)
inline

copy.

Parameters
Rrandom iterator to be copied.
integer& random ( integer a) const
inline

get a random prime of maximum size _bits .

Parameters
[out]aa prime number
integer& random_exact ( integer a) const
inline
Todo:
uses random_exact when givaro is released.
integer& random_between ( integer a,
uint64_t  _low_bits 
) const
inline
Todo:
uses random_between when givaro is released.

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