My Project
Loading...
Searching...
No Matches
cf_random.h
Go to the documentation of this file.
1/* emacs edit mode for this file is -*- C++ -*- */
2
3/**
4 * @file cf_random.h
5 *
6 * generate random integers, random elements of finite fields
7**/
8
9#ifndef INCL_CF_RANDOM_H
10#define INCL_CF_RANDOM_H
11
12// #include "config.h"
13
14#include "canonicalform.h"
15
16/*BEGINPUBLIC*/
17
18/**
19 * virtual class for random element generation
20**/
21class CFRandom {
22public:
23 virtual ~CFRandom() {}
24 virtual CanonicalForm generate() const { return 0; }
25 virtual CFRandom * clone() const { return new CFRandom(); }
26};
27
28/**
29 * generate random elements in GF
30**/
31class GFRandom : public CFRandom
32{
33public:
36 CanonicalForm generate() const;
37 CFRandom * clone() const;
38};
39
40/**
41 * generate random elements in F_p
42**/
43class FFRandom : public CFRandom
44{
45public:
48 CanonicalForm generate() const;
49 CFRandom * clone() const;
50};
51
52/**
53 * generate random integers
54**/
55class IntRandom : public CFRandom
56{
57private:
58 int max;
59public:
60 IntRandom();
61 IntRandom( int m );
62 ~IntRandom();
63 CanonicalForm generate() const;
64 CFRandom * clone() const;
65};
66
67/**
68 * generate random elements in F_p(alpha)
69**/
70class AlgExtRandomF : public CFRandom {
71private:
74 int n;
76 AlgExtRandomF( const Variable & v, CFRandom * g, int nn );
78public:
80 AlgExtRandomF( const Variable & v );
81 AlgExtRandomF( const Variable & v1, const Variable & v2 );
83 CanonicalForm generate() const;
84 CFRandom * clone() const;
85};
86
88public:
89 static CFRandom * generate();
90};
91
92/// random integers with abs less than n
93int factoryrandom( int n );
94
95/// random seed initializer
96void FACTORY_PUBLIC factoryseed( int s );
97
98/*ENDPUBLIC*/
99
100#endif /* ! INCL_CF_RANDOM_H */
Header for factory's main class CanonicalForm.
int m
Definition: cfEzgcd.cc:128
g
Definition: cfModGcd.cc:4090
int factoryrandom(int n)
random integers with abs less than n
Definition: cf_random.cc:180
void FACTORY_PUBLIC factoryseed(int s)
random seed initializer
Definition: cf_random.cc:189
generate random elements in F_p(alpha)
Definition: cf_random.h:70
CFRandom * clone() const
Definition: cf_random.cc:165
Variable algext
Definition: cf_random.h:72
AlgExtRandomF & operator=(const AlgExtRandomF &)
Definition: cf_random.cc:123
CFRandom * gen
Definition: cf_random.h:73
CanonicalForm generate() const
Definition: cf_random.cc:157
static CFRandom * generate()
Definition: cf_random.cc:170
virtual class for random element generation
Definition: cf_random.h:21
virtual CFRandom * clone() const
Definition: cf_random.h:25
virtual CanonicalForm generate() const
Definition: cf_random.h:24
virtual ~CFRandom()
Definition: cf_random.h:23
factory's main class
Definition: canonicalform.h:86
generate random elements in F_p
Definition: cf_random.h:44
CanonicalForm generate() const
Definition: cf_random.cc:68
CFRandom * clone() const
Definition: cf_random.cc:73
FFRandom()
Definition: cf_random.h:46
~FFRandom()
Definition: cf_random.h:47
generate random elements in GF
Definition: cf_random.h:32
CFRandom * clone() const
Definition: cf_random.cc:85
~GFRandom()
Definition: cf_random.h:35
CanonicalForm generate() const
Definition: cf_random.cc:78
GFRandom()
Definition: cf_random.h:34
generate random integers
Definition: cf_random.h:56
int max
Definition: cf_random.h:58
CanonicalForm generate() const
Definition: cf_random.cc:103
CFRandom * clone() const
Definition: cf_random.cc:108
factory's class for variables
Definition: variable.h:33
const CanonicalForm int s
Definition: facAbsFact.cc:51
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:39
#define FACTORY_PUBLIC
Definition: globaldefs.h:25