My Project  debian-1:4.1.1-p2+ds-4build2
Public Member Functions | Private Member Functions | Private Attributes
AlgExtRandomF Class Reference

generate random elements in F_p(alpha) More...

#include <cf_random.h>

Public Member Functions

 AlgExtRandomF (const AlgExtRandomF &)
 
 AlgExtRandomF (const Variable &v)
 
 AlgExtRandomF (const Variable &v1, const Variable &v2)
 
 ~AlgExtRandomF ()
 
CanonicalForm generate () const
 
CFRandomclone () const
 
 AlgExtRandomF (const AlgExtRandomF &)
 
 AlgExtRandomF (const Variable &v)
 
 AlgExtRandomF (const Variable &v1, const Variable &v2)
 
 ~AlgExtRandomF ()
 
CanonicalForm generate () const
 
CFRandomclone () const
 
 AlgExtRandomF (const AlgExtRandomF &)
 
 AlgExtRandomF (const Variable &v)
 
 AlgExtRandomF (const Variable &v1, const Variable &v2)
 
 ~AlgExtRandomF ()
 
CanonicalForm generate () const
 
CFRandomclone () const
 
- Public Member Functions inherited from CFRandom
virtual ~CFRandom ()
 
virtual ~CFRandom ()
 
virtual ~CFRandom ()
 

Private Member Functions

 AlgExtRandomF ()
 
 AlgExtRandomF (const Variable &v, CFRandom *g, int nn)
 
AlgExtRandomFoperator= (const AlgExtRandomF &)
 
 AlgExtRandomF ()
 
 AlgExtRandomF (const Variable &v, CFRandom *g, int nn)
 
AlgExtRandomFoperator= (const AlgExtRandomF &)
 
 AlgExtRandomF ()
 
 AlgExtRandomF (const Variable &v, CFRandom *g, int nn)
 
AlgExtRandomFoperator= (const AlgExtRandomF &)
 

Private Attributes

Variable algext
 
CFRandomgen
 
int n
 

Detailed Description

generate random elements in F_p(alpha)

Definition at line 70 of file cf_random.h.

Constructor & Destructor Documentation

◆ AlgExtRandomF() [1/15]

AlgExtRandomF::AlgExtRandomF ( )
private

Definition at line 101 of file cf_random.cc.

102 {
103  ASSERT( 0, "not a valid random generator" );
104 }

◆ AlgExtRandomF() [2/15]

AlgExtRandomF::AlgExtRandomF ( const Variable v,
CFRandom g,
int  nn 
)
private

Definition at line 133 of file cf_random.cc.

134 {
135  algext = v;
136  n = nn;
137  gen = g;
138 }

◆ AlgExtRandomF() [3/15]

AlgExtRandomF::AlgExtRandomF ( const AlgExtRandomF )

Definition at line 106 of file cf_random.cc.

107 {
108  ASSERT( 0, "not a valid random generator" );
109 }

◆ AlgExtRandomF() [4/15]

AlgExtRandomF::AlgExtRandomF ( const Variable v)

Definition at line 117 of file cf_random.cc.

118 {
119  ASSERT( v.level() < 0, "not an algebraic extension" );
120  algext = v;
121  n = degree( getMipo( v ) );
123 }

◆ AlgExtRandomF() [5/15]

AlgExtRandomF::AlgExtRandomF ( const Variable v1,
const Variable v2 
)

Definition at line 125 of file cf_random.cc.

126 {
127  ASSERT( v1.level() < 0 && v2.level() < 0 && v1 != v2, "not an algebraic extension" );
128  algext = v2;
129  n = degree( getMipo( v2 ) );
130  gen = new AlgExtRandomF( v1 );
131 }

◆ ~AlgExtRandomF() [1/3]

AlgExtRandomF::~AlgExtRandomF ( )

Definition at line 140 of file cf_random.cc.

141 {
142  delete gen;
143 }

◆ AlgExtRandomF() [6/15]

AlgExtRandomF::AlgExtRandomF ( )
private

◆ AlgExtRandomF() [7/15]

AlgExtRandomF::AlgExtRandomF ( const Variable v,
CFRandom g,
int  nn 
)
private

◆ AlgExtRandomF() [8/15]

AlgExtRandomF::AlgExtRandomF ( const AlgExtRandomF )

◆ AlgExtRandomF() [9/15]

AlgExtRandomF::AlgExtRandomF ( const Variable v)

◆ AlgExtRandomF() [10/15]

AlgExtRandomF::AlgExtRandomF ( const Variable v1,
const Variable v2 
)

◆ ~AlgExtRandomF() [2/3]

AlgExtRandomF::~AlgExtRandomF ( )

◆ AlgExtRandomF() [11/15]

AlgExtRandomF::AlgExtRandomF ( )
private

◆ AlgExtRandomF() [12/15]

AlgExtRandomF::AlgExtRandomF ( const Variable v,
CFRandom g,
int  nn 
)
private

◆ AlgExtRandomF() [13/15]

AlgExtRandomF::AlgExtRandomF ( const AlgExtRandomF )

◆ AlgExtRandomF() [14/15]

AlgExtRandomF::AlgExtRandomF ( const Variable v)

◆ AlgExtRandomF() [15/15]

AlgExtRandomF::AlgExtRandomF ( const Variable v1,
const Variable v2 
)

◆ ~AlgExtRandomF() [3/3]

AlgExtRandomF::~AlgExtRandomF ( )

Member Function Documentation

◆ clone() [1/3]

CFRandom * AlgExtRandomF::clone ( ) const
virtual

Reimplemented from CFRandom.

Definition at line 153 of file cf_random.cc.

154 {
155  return new AlgExtRandomF( algext, gen->clone(), n );
156 }

◆ clone() [2/3]

CFRandom* AlgExtRandomF::clone ( ) const
virtual

Reimplemented from CFRandom.

◆ clone() [3/3]

CFRandom* AlgExtRandomF::clone ( ) const
virtual

Reimplemented from CFRandom.

◆ generate() [1/3]

CanonicalForm AlgExtRandomF::generate ( ) const
virtual

Reimplemented from CFRandom.

Definition at line 145 of file cf_random.cc.

146 {
148  for ( int i = 0; i < n; i++ )
149  result += power( algext, i ) * gen->generate();
150  return result;
151 }

◆ generate() [2/3]

CanonicalForm AlgExtRandomF::generate ( ) const
virtual

Reimplemented from CFRandom.

◆ generate() [3/3]

CanonicalForm AlgExtRandomF::generate ( ) const
virtual

Reimplemented from CFRandom.

◆ operator=() [1/3]

AlgExtRandomF & AlgExtRandomF::operator= ( const AlgExtRandomF )
private

Definition at line 111 of file cf_random.cc.

112 {
113  ASSERT( 0, "not a valid random generator" );
114  return *this;
115 }

◆ operator=() [2/3]

AlgExtRandomF& AlgExtRandomF::operator= ( const AlgExtRandomF )
private

◆ operator=() [3/3]

AlgExtRandomF& AlgExtRandomF::operator= ( const AlgExtRandomF )
private

Field Documentation

◆ algext

Variable AlgExtRandomF::algext
private

Definition at line 72 of file cf_random.h.

◆ gen

CFRandom * AlgExtRandomF::gen
private

Definition at line 73 of file cf_random.h.

◆ n

int AlgExtRandomF::n
private

Definition at line 74 of file cf_random.h.


The documentation for this class was generated from the following files:
result
return result
Definition: facAbsBiFact.cc:76
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:101
power
CanonicalForm power(const CanonicalForm &f, int n)
exponentiation
Definition: canonicalform.cc:1837
g
g
Definition: cfModGcd.cc:4031
CanonicalForm
factory's main class
Definition: canonicalform.h:77
i
int i
Definition: cfEzgcd.cc:125
getMipo
CanonicalForm getMipo(const Variable &alpha, const Variable &x)
Definition: variable.cc:207
ASSERT
#define ASSERT(expression, message)
Definition: cf_assert.h:99
AlgExtRandomF::n
int n
Definition: cf_random.h:74
Variable::level
int level() const
Definition: factory.h:134
CFRandom::clone
virtual CFRandom * clone() const
Definition: cf_random.h:25
CFRandom::generate
virtual CanonicalForm generate() const
Definition: cf_random.h:24
CFRandomFactory::generate
static CFRandom * generate()
Definition: cf_random.cc:158
v
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
degree
int degree(const CanonicalForm &f)
Definition: canonicalform.h:309