linbox
GmpRandomPrime Class Reference

generating random prime integers, using the gmp library. More...

#include <gmp-random-prime.h>

+ Inheritance diagram for GmpRandomPrime:

Public Types

typedef UniqueSamplingTrait< Trait > UniqueSamplingTag
 whether a prime can be picked more than once
 

Public Member Functions

PrimeIterator< Trait > & operator++ ()
 operator++() (prefix ++ operator) creates a new random prime.
 
const Prime_Type & operator* () const
 get the random prime.
 
void setBits (uint64_t bits)
 Sets the bit size.
 

Static Public Member Functions

static void setSeed (uint64_t ul)
 Sets the seed.
 

Protected Attributes

uint64_t _bits
 common lenght of all primes
 
integer _prime
 the generated prime.
 
Givaro::IntPrimeDom _IPD
 empty struct dealing with primality.
 

Detailed Description

generating random prime integers, using the gmp library.

via primeiterator

Member Function Documentation

◆ operator*()

template<class Trait = IteratorCategories::HeuristicTag>
const Prime_Type & operator* ( ) const
inlineinherited

get the random prime.

returns the actual prime.

Warning
a new prime is not generated.

◆ setSeed()

template<class Trait = IteratorCategories::HeuristicTag>
static void setSeed ( uint64_t ul)
inlinestaticinherited

Sets the seed.

Set the random seed to be ul.

Parameters
ulthe new seed.

◆ setBits()

template<class Trait = IteratorCategories::HeuristicTag>
void setBits ( uint64_t bits)
inlineinherited

Sets the bit size.

Parameters
bitsthe new bit size.

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