My Project
Loading...
Searching...
No Matches
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
 
- Public Member Functions inherited from CFRandom
virtual ~CFRandom ()
 
virtual CanonicalForm generate () const
 
virtual CFRandomclone () const
 

Private Member Functions

 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/5]

AlgExtRandomF::AlgExtRandomF ( )
private

Definition at line 113 of file cf_random.cc.

114{
115 ASSERT( 0, "not a valid random generator" );
116}
#define ASSERT(expression, message)
Definition: cf_assert.h:99

◆ AlgExtRandomF() [2/5]

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

Definition at line 145 of file cf_random.cc.

146{
147 algext = v;
148 n = nn;
149 gen = g;
150}
g
Definition: cfModGcd.cc:4090
Variable algext
Definition: cf_random.h:72
CFRandom * gen
Definition: cf_random.h:73
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:39

◆ AlgExtRandomF() [3/5]

AlgExtRandomF::AlgExtRandomF ( const AlgExtRandomF )

Definition at line 118 of file cf_random.cc.

119{
120 ASSERT( 0, "not a valid random generator" );
121}

◆ AlgExtRandomF() [4/5]

AlgExtRandomF::AlgExtRandomF ( const Variable v)

Definition at line 129 of file cf_random.cc.

130{
131 ASSERT( v.level() < 0, "not an algebraic extension" );
132 algext = v;
133 n = degree( getMipo( v ) );
135}
int degree(const CanonicalForm &f)
static CFRandom * generate()
Definition: cf_random.cc:170
int level() const
Definition: variable.h:49
CanonicalForm getMipo(const Variable &alpha, const Variable &x)
Definition: variable.cc:207

◆ AlgExtRandomF() [5/5]

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

Definition at line 137 of file cf_random.cc.

138{
139 ASSERT( v1.level() < 0 && v2.level() < 0 && v1 != v2, "not an algebraic extension" );
140 algext = v2;
141 n = degree( getMipo( v2 ) );
142 gen = new AlgExtRandomF( v1 );
143}

◆ ~AlgExtRandomF()

AlgExtRandomF::~AlgExtRandomF ( )

Definition at line 152 of file cf_random.cc.

153{
154 delete gen;
155}

Member Function Documentation

◆ clone()

CFRandom * AlgExtRandomF::clone ( ) const
virtual

Reimplemented from CFRandom.

Definition at line 165 of file cf_random.cc.

166{
167 return new AlgExtRandomF( algext, gen->clone(), n );
168}
virtual CFRandom * clone() const
Definition: cf_random.h:25

◆ generate()

CanonicalForm AlgExtRandomF::generate ( ) const
virtual

Reimplemented from CFRandom.

Definition at line 157 of file cf_random.cc.

158{
160 for ( int i = 0; i < n; i++ )
161 result += power( algext, i ) * gen->generate();
162 return result;
163}
CanonicalForm power(const CanonicalForm &f, int n)
exponentiation
int i
Definition: cfEzgcd.cc:132
virtual CanonicalForm generate() const
Definition: cf_random.h:24
factory's main class
Definition: canonicalform.h:86
return result
Definition: facAbsBiFact.cc:75

◆ operator=()

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

Definition at line 123 of file cf_random.cc.

124{
125 ASSERT( 0, "not a valid random generator" );
126 return *this;
127}

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: