Data Structures | Functions
cf_random.h File Reference

generate random integers, random elements of finite fields More...

#include "canonicalform.h"

Go to the source code of this file.

Data Structures

class  CFRandom
 virtual class for random element generation More...
 
class  GFRandom
 generate random elements in GF More...
 
class  FFRandom
 generate random elements in F_p More...
 
class  IntRandom
 generate random integers More...
 
class  AlgExtRandomF
 generate random elements in F_p(alpha) More...
 
class  CFRandomFactory
 

Functions

int factoryrandom (int n)
 random integers with abs less than n More...
 
void factoryseed (int s)
 random seed initializer More...
 

Detailed Description

generate random integers, random elements of finite fields

Definition in file cf_random.h.

Function Documentation

int factoryrandom ( int  n)

random integers with abs less than n

Definition at line 168 of file cf_random.cc.

169 {
170  if ( n == 0 )
171  return (int)ranGen.generate();
172  else
173  return ranGen.generate() % n;
174 }
const CanonicalForm CFMap CFMap int &both_non_zero int n
Definition: cfEzgcd.cc:52
RandomGenerator ranGen
Definition: cf_random.cc:54
void factoryseed ( int  s)

random seed initializer

Definition at line 176 of file cf_random.cc.

177 {
178  ranGen.seed( s );
179 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
void seed(int ss)
Definition: cf_random.cc:29
RandomGenerator ranGen
Definition: cf_random.cc:54