Loading...
Searching...
No Matches
cf_random.h
Go to the documentation of this file.
/* emacs edit mode for this file is -*- C++ -*- */
/**
* @file cf_random.h
*
* generate random integers, random elements of finite fields
**/
#ifndef INCL_CF_RANDOM_H
#define INCL_CF_RANDOM_H
// #include "config.h"
#include "canonicalform.h"
/*BEGINPUBLIC*/
/**
* virtual class for random element generation
**/
class CFRandom {
public:
virtual ~CFRandom() {}
virtual CanonicalForm generate() const { return 0; }
virtual CFRandom * clone() const { return new CFRandom(); }
};
/**
* generate random elements in GF
**/
class GFRandom : public CFRandom
{
public:
GFRandom() {};
~GFRandom() {}
CanonicalForm generate() const;
CFRandom * clone() const;
};
/**
* generate random elements in F_p
**/
class FFRandom : public CFRandom
{
public:
FFRandom() {}
~FFRandom() {}
CanonicalForm generate() const;
CFRandom * clone() const;
};
/**
* generate random integers
**/
class IntRandom : public CFRandom
{
private:
int max;
public:
IntRandom();
IntRandom( int m );
~IntRandom();
CanonicalForm generate() const;
CFRandom * clone() const;
};
/**
* generate random elements in F_p(alpha)
**/
class AlgExtRandomF : public CFRandom {
private:
Variable algext;
CFRandom * gen;
int n;
AlgExtRandomF();
AlgExtRandomF( const Variable & v, CFRandom * g, int nn );
AlgExtRandomF& operator= ( const AlgExtRandomF & );
public:
AlgExtRandomF( const AlgExtRandomF & );
AlgExtRandomF( const Variable & v );
AlgExtRandomF( const Variable & v1, const Variable & v2 );
~AlgExtRandomF();
CanonicalForm generate() const;
CFRandom * clone() const;
};
class CFRandomFactory {
public:
static CFRandom * generate();
};
/// random integers with abs less than n
int factoryrandom( int n );
/// random seed initializer
void FACTORY_PUBLIC factoryseed( int s );
/*ENDPUBLIC*/
#endif /* ! INCL_CF_RANDOM_H */
canonicalform.h
Header for factory's main class CanonicalForm.
m
int m
Definition cfEzgcd.cc:128
g
g
Definition cfModGcd.cc:4098
factoryrandom
int factoryrandom(int n)
random integers with abs less than n
Definition cf_random.cc:177
factoryseed
void FACTORY_PUBLIC factoryseed(int s)
random seed initializer
Definition cf_random.cc:186
AlgExtRandomF::clone
CFRandom * clone() const
Definition cf_random.cc:162
AlgExtRandomF::gen
CFRandom * gen
Definition cf_random.h:73
AlgExtRandomF::algext
Variable algext
Definition cf_random.h:72
AlgExtRandomF::~AlgExtRandomF
~AlgExtRandomF()
Definition cf_random.cc:149
AlgExtRandomF::operator=
AlgExtRandomF & operator=(const AlgExtRandomF &)
Definition cf_random.cc:120
AlgExtRandomF::n
int n
Definition cf_random.h:74
AlgExtRandomF::AlgExtRandomF
AlgExtRandomF()
Definition cf_random.cc:110
AlgExtRandomF::generate
CanonicalForm generate() const
Definition cf_random.cc:154
CFRandomFactory
Definition cf_random.h:87
CFRandomFactory::generate
static CFRandom * generate()
Definition cf_random.cc:167
CFRandom
virtual class for random element generation
Definition cf_random.h:21
CFRandom::clone
virtual CFRandom * clone() const
Definition cf_random.h:25
CFRandom::generate
virtual CanonicalForm generate() const
Definition cf_random.h:24
CFRandom::~CFRandom
virtual ~CFRandom()
Definition cf_random.h:23
CanonicalForm
factory's main class
Definition canonicalform.h:86
FFRandom::generate
CanonicalForm generate() const
Definition cf_random.cc:65
FFRandom::clone
CFRandom * clone() const
Definition cf_random.cc:70
FFRandom::FFRandom
FFRandom()
Definition cf_random.h:46
FFRandom::~FFRandom
~FFRandom()
Definition cf_random.h:47
GFRandom::clone
CFRandom * clone() const
Definition cf_random.cc:82
GFRandom::~GFRandom
~GFRandom()
Definition cf_random.h:35
GFRandom::generate
CanonicalForm generate() const
Definition cf_random.cc:75
GFRandom::GFRandom
GFRandom()
Definition cf_random.h:34
IntRandom::IntRandom
IntRandom()
Definition cf_random.cc:88
IntRandom::max
int max
Definition cf_random.h:58
IntRandom::generate
CanonicalForm generate() const
Definition cf_random.cc:100
IntRandom::clone
CFRandom * clone() const
Definition cf_random.cc:105
IntRandom::~IntRandom
~IntRandom()
Definition cf_random.cc:98
Variable
factory's class for variables
Definition factory.h:127
s
const CanonicalForm int s
Definition facAbsFact.cc:51
v
const Variable & v
< [in] a sqrfree bivariate poly
Definition facBivar.h:39
FACTORY_PUBLIC
#define FACTORY_PUBLIC
Definition globaldefs.h:25