Loading...
Searching...
No Matches
AlgExtGenerator Class Reference

generate all elements in F_p(alpha) starting from 0 More...

`#include <cf_generator.h>`

## Public Member Functions

| AlgExtGenerator (const Variable &a)
| ~AlgExtGenerator ()
bool | hasItems () const
void | reset ()
CanonicalForm | item () const
void | next ()
void | operator++ ()
void | operator++ (int)
CFGenerator * | clone () const
| AlgExtGenerator (const Variable &a)
| ~AlgExtGenerator ()
bool | hasItems () const
void | reset ()
CanonicalForm | item () const
void | next ()
void | operator++ ()
void | operator++ (int)
CFGenerator * | clone () const
| AlgExtGenerator (const Variable &a)
| ~AlgExtGenerator ()
bool | hasItems () const
void | reset ()
CanonicalForm | item () const
void | next ()
void | operator++ ()
void | operator++ (int)
CFGenerator * | clone () const
Public Member Functions inherited from CFGenerator
| CFGenerator ()
virtual | ~CFGenerator ()
| CFGenerator ()
virtual | ~CFGenerator ()
| CFGenerator ()
virtual | ~CFGenerator ()

## Private Member Functions

| AlgExtGenerator ()
| AlgExtGenerator (const AlgExtGenerator &)
AlgExtGenerator & | operator= (const AlgExtGenerator &)
| AlgExtGenerator ()
| AlgExtGenerator (const AlgExtGenerator &)
AlgExtGenerator & | operator= (const AlgExtGenerator &)
| AlgExtGenerator ()
| AlgExtGenerator (const AlgExtGenerator &)
AlgExtGenerator & | operator= (const AlgExtGenerator &)

## Private Attributes

Variable | algext
FFGenerator ** | gensf
GFGenerator ** | gensg
int | n
bool | nomoreitems

## Detailed Description

generate all elements in F_p(alpha) starting from 0

Definition at line 93 of file cf_generator.h.

## Constructor & Destructor Documentation

## AlgExtGenerator() [1/9]

AlgExtGenerator::AlgExtGenerator | ( |  | ) |

private

Definition at line 94 of file cf_generator.cc.

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

## AlgExtGenerator() [2/9]

AlgExtGenerator::AlgExtGenerator | ( | const AlgExtGenerator & |  | ) |

private

Definition at line 99 of file cf_generator.cc.

{
ASSERT( 0, "not a valid generator" );
}

## AlgExtGenerator() [3/9]

AlgExtGenerator::AlgExtGenerator | ( | const Variable & | a | ) |

Definition at line 110 of file cf_generator.cc.

{
ASSERT( a.level() < 0, "not an algebraic extension" );
ASSERT( getCharacteristic() > 0, "not a finite field" );
algext = a;
n = degree( getMipo( a ) );
if ( getGFDegree() > 1 )
{
gensg = new GFGenerator * [n];
for ( int i = 0; i < n; i++ )
gensg[i] = new GFGenerator();
}
else
{
gensf = new FFGenerator * [n];
for ( int i = 0; i < n; i++ )
gensf[i] = new FFGenerator();
}
nomoreitems = false;
}
i
int i
Definition cfEzgcd.cc:132
AlgExtGenerator::gensf
FFGenerator ** gensf
Definition cf_generator.h:97
AlgExtGenerator::n
int n
Definition cf_generator.h:99
AlgExtGenerator::gensg
GFGenerator ** gensg
Definition cf_generator.h:98
AlgExtGenerator::nomoreitems
bool nomoreitems
Definition cf_generator.h:100
AlgExtGenerator::algext
Variable algext
Definition cf_generator.h:96
Variable::level
int level() const
Definition factory.h:143
degree
int degree(const CanonicalForm &f)
Definition factory.h:457
getGFDegree
int getGFDegree()
Definition cf_char.cc:75
getMipo
CanonicalForm getMipo(const Variable &alpha, const Variable &x)
Definition variable.cc:207
getCharacteristic
int FACTORY_PUBLIC getCharacteristic()
Definition cf_char.cc:70

## ~AlgExtGenerator() [1/3]

AlgExtGenerator::~AlgExtGenerator | ( |  | ) |

Definition at line 131 of file cf_generator.cc.

{
if ( getGFDegree() > 1 )
{
for ( int i = 0; i < n; i++ )
delete gensg[i];
delete [] gensg;
}
else
{
for ( int i = 0; i < n; i++ )
delete gensf[i];
delete [] gensf;
}
}

## AlgExtGenerator() [4/9]

AlgExtGenerator::AlgExtGenerator | ( |  | ) |

private

## AlgExtGenerator() [5/9]

AlgExtGenerator::AlgExtGenerator | ( | const AlgExtGenerator & |  | ) |

private

## AlgExtGenerator() [6/9]

AlgExtGenerator::AlgExtGenerator | ( | const Variable & | a | ) |

## ~AlgExtGenerator() [2/3]

AlgExtGenerator::~AlgExtGenerator | ( |  | ) |

## AlgExtGenerator() [7/9]

AlgExtGenerator::AlgExtGenerator | ( |  | ) |

private

## AlgExtGenerator() [8/9]

AlgExtGenerator::AlgExtGenerator | ( | const AlgExtGenerator & |  | ) |

private

## AlgExtGenerator() [9/9]

AlgExtGenerator::AlgExtGenerator | ( | const Variable & | a | ) |

## ~AlgExtGenerator() [3/3]

AlgExtGenerator::~AlgExtGenerator | ( |  | ) |

## Member Function Documentation

## clone() [1/3]

CFGenerator * AlgExtGenerator::clone | ( |  | ) | const

virtual

Reimplemented from CFGenerator.

Definition at line 216 of file cf_generator.cc.

{
return new AlgExtGenerator(algext);
}
AlgExtGenerator::AlgExtGenerator
AlgExtGenerator()
Definition cf_generator.cc:94

## clone() [2/3]

CFGenerator * AlgExtGenerator::clone | ( |  | ) | const

virtual

Reimplemented from CFGenerator.

## clone() [3/3]

CFGenerator * AlgExtGenerator::clone | ( |  | ) | const

virtual

Reimplemented from CFGenerator.

## hasItems() [1/3]

bool AlgExtGenerator::hasItems | ( |  | ) | const

inline virtual

Reimplemented from CFGenerator.

Definition at line 108 of file cf_generator.h.

{ return ! nomoreitems; }

## hasItems() [2/3]

bool AlgExtGenerator::hasItems | ( |  | ) | const

inline virtual

Reimplemented from CFGenerator.

Definition at line 773 of file factory.h.

{ return ! nomoreitems; }

## hasItems() [3/3]

bool AlgExtGenerator::hasItems | ( |  | ) | const

inline virtual

Reimplemented from CFGenerator.

Definition at line 773 of file factory.h.

{ return ! nomoreitems; }

## item() [1/3]

CanonicalForm AlgExtGenerator::item | ( |  | ) | const

virtual

Reimplemented from CFGenerator.

Definition at line 162 of file cf_generator.cc.

{
ASSERT( ! nomoreitems, "no more items" );
CanonicalForm result = 0;
if ( getGFDegree() > 1 )
{
for ( int i = 0; i < n; i++ )
result += power( algext, i ) * gensg[i]->item();
}
else
{
for ( int i = 0; i < n; i++ )
result += power( algext, i ) * gensf[i]->item();
}
return result;
}
result
return result
Definition facAbsBiFact.cc:76
power
CanonicalForm FACTORY_PUBLIC power(const CanonicalForm &f, int n)
exponentiation
Definition canonicalform.cc:1896

## item() [2/3]

CanonicalForm AlgExtGenerator::item | ( |  | ) | const

virtual

Reimplemented from CFGenerator.

## item() [3/3]

CanonicalForm AlgExtGenerator::item | ( |  | ) | const

virtual

Reimplemented from CFGenerator.

## next() [1/3]

void AlgExtGenerator::next | ( |  | ) |

virtual

Reimplemented from CFGenerator.

Definition at line 179 of file cf_generator.cc.

{
ASSERT( ! nomoreitems, "no more items" );
int i = 0;
bool stop = false;
if ( getGFDegree() > 1 )
{
while ( ! stop && i < n )
{
gensg[i]->next();
if ( ! gensg[i]->hasItems() )
{
gensg[i]->reset();
i++;
}
else
stop = true;
}
}
else
{
while ( ! stop && i < n )
{
gensf[i]->next();
if ( ! gensf[i]->hasItems() )
{
gensf[i]->reset();
i++;
}
else
stop = true;
}
}
if ( ! stop )
nomoreitems = true;
}
AlgExtGenerator::hasItems
bool hasItems() const
Definition cf_generator.h:108

## next() [2/3]

void AlgExtGenerator::next | ( |  | ) |

virtual

Reimplemented from CFGenerator.

## next() [3/3]

void AlgExtGenerator::next | ( |  | ) |

virtual

Reimplemented from CFGenerator.

## operator++() [1/6]

void AlgExtGenerator::operator++ | ( |  | ) |

inline

Definition at line 112 of file cf_generator.h.

{ next(); }
AlgExtGenerator::next
void next()
Definition cf_generator.cc:179

## operator++() [2/6]

void AlgExtGenerator::operator++ | ( |  | ) |

inline

Definition at line 777 of file factory.h.

{ next(); }

## operator++() [3/6]

void AlgExtGenerator::operator++ | ( |  | ) |

inline

Definition at line 777 of file factory.h.

{ next(); }

## operator++() [4/6]

void AlgExtGenerator::operator++ | ( | int |  | ) |

inline

Definition at line 113 of file cf_generator.h.

{ next(); }

## operator++() [5/6]

void AlgExtGenerator::operator++ | ( | int |  | ) |

inline

Definition at line 778 of file factory.h.

{ next(); }

## operator++() [6/6]

void AlgExtGenerator::operator++ | ( | int |  | ) |

inline

Definition at line 778 of file factory.h.

{ next(); }

## operator=() [1/3]

AlgExtGenerator & AlgExtGenerator::operator= | ( | const AlgExtGenerator & |  | ) |

private

Definition at line 104 of file cf_generator.cc.

{
ASSERT( 0, "not a valid generator" );
return *this;
}

## operator=() [2/3]

AlgExtGenerator & AlgExtGenerator::operator= | ( | const AlgExtGenerator & |  | ) |

private

## operator=() [3/3]

AlgExtGenerator & AlgExtGenerator::operator= | ( | const AlgExtGenerator & |  | ) |

private

## reset() [1/3]

void AlgExtGenerator::reset | ( |  | ) |

virtual

Reimplemented from CFGenerator.

Definition at line 147 of file cf_generator.cc.

{
if ( getGFDegree() > 1 )
{
for ( int i = 0; i < n; i++ )
gensg[i]->reset();
}
else
{
for ( int i = 0; i < n; i++ )
gensf[i]->reset();
}
nomoreitems = false;
}
AlgExtGenerator::reset
void reset()
Definition cf_generator.cc:147

## reset() [2/3]

void AlgExtGenerator::reset | ( |  | ) |

virtual

Reimplemented from CFGenerator.

## reset() [3/3]

void AlgExtGenerator::reset | ( |  | ) |

virtual

Reimplemented from CFGenerator.

## Field Documentation

## algext

Variable AlgExtGenerator::algext

private

Definition at line 96 of file cf_generator.h.

## gensf

FFGenerator ** AlgExtGenerator::gensf

private

Definition at line 97 of file cf_generator.h.

## gensg

GFGenerator ** AlgExtGenerator::gensg

private

Definition at line 98 of file cf_generator.h.

## n

int AlgExtGenerator::n

private

Definition at line 99 of file cf_generator.h.

## nomoreitems

bool AlgExtGenerator::nomoreitems

private

Definition at line 100 of file cf_generator.h.

The documentation for this class was generated from the following files:

- factory/cf_generator.h
- factory/factory.h
- factory/include/factory/factory.h
- factory/cf_generator.cc