My Project
Loading...
Searching...
No Matches
GFGenerator Class Reference

generate all elements in GF starting from 0 More...

#include <cf_generator.h>

Public Member Functions

 GFGenerator ()
 
 ~GFGenerator ()
 
bool hasItems () const
 
void reset ()
 
CanonicalForm item () const
 
void next ()
 
void operator++ ()
 
void operator++ (int)
 
CFGeneratorclone () const
 
 GFGenerator ()
 
 ~GFGenerator ()
 
bool hasItems () const
 
void reset ()
 
CanonicalForm item () const
 
void next ()
 
void operator++ ()
 
void operator++ (int)
 
CFGeneratorclone () const
 
 GFGenerator ()
 
 ~GFGenerator ()
 
bool hasItems () const
 
void reset ()
 
CanonicalForm item () const
 
void next ()
 
void operator++ ()
 
void operator++ (int)
 
CFGeneratorclone () const
 
- Public Member Functions inherited from CFGenerator
 CFGenerator ()
 
virtual ~CFGenerator ()
 
 CFGenerator ()
 
virtual ~CFGenerator ()
 
 CFGenerator ()
 
virtual ~CFGenerator ()
 

Private Attributes

int current
 

Detailed Description

generate all elements in GF starting from 0

Definition at line 74 of file cf_generator.h.

Constructor & Destructor Documentation

◆ GFGenerator() [1/3]

GFGenerator::GFGenerator ( )

Definition at line 57 of file cf_generator.cc.

58{
59 current = gf_zero();
60}
int gf_zero()
Definition gfops.h:99

◆ ~GFGenerator() [1/3]

GFGenerator::~GFGenerator ( )
inline

Definition at line 80 of file cf_generator.h.

80{}

◆ GFGenerator() [2/3]

GFGenerator::GFGenerator ( )

◆ ~GFGenerator() [2/3]

GFGenerator::~GFGenerator ( )
inline

Definition at line 745 of file factory.h.

745{}

◆ GFGenerator() [3/3]

GFGenerator::GFGenerator ( )

◆ ~GFGenerator() [3/3]

GFGenerator::~GFGenerator ( )
inline

Definition at line 745 of file factory.h.

745{}

Member Function Documentation

◆ clone() [1/3]

CFGenerator * GFGenerator::clone ( ) const
virtual

Reimplemented from CFGenerator.

Definition at line 89 of file cf_generator.cc.

90{
91 return new GFGenerator();
92}

◆ clone() [2/3]

CFGenerator * GFGenerator::clone ( ) const
virtual

Reimplemented from CFGenerator.

◆ clone() [3/3]

CFGenerator * GFGenerator::clone ( ) const
virtual

Reimplemented from CFGenerator.

◆ hasItems() [1/3]

bool GFGenerator::hasItems ( ) const
virtual

Reimplemented from CFGenerator.

Definition at line 62 of file cf_generator.cc.

63{
64 return ( current != gf_q + 1 );
65}
VAR int gf_q
Definition gfops.cc:47

◆ hasItems() [2/3]

bool GFGenerator::hasItems ( ) const
virtual

Reimplemented from CFGenerator.

◆ hasItems() [3/3]

bool GFGenerator::hasItems ( ) const
virtual

Reimplemented from CFGenerator.

◆ item() [1/3]

CanonicalForm GFGenerator::item ( ) const
virtual

Reimplemented from CFGenerator.

Definition at line 72 of file cf_generator.cc.

73{
74 ASSERT( current != gf_q + 1, "no more items" );
75 return CanonicalForm( int2imm_gf( current ) );
76}
#define ASSERT(expression, message)
Definition cf_assert.h:99
InternalCF * int2imm_gf(long i)
Definition imm.h:106

◆ item() [2/3]

CanonicalForm GFGenerator::item ( ) const
virtual

Reimplemented from CFGenerator.

◆ item() [3/3]

CanonicalForm GFGenerator::item ( ) const
virtual

Reimplemented from CFGenerator.

◆ next() [1/3]

void GFGenerator::next ( )
virtual

Reimplemented from CFGenerator.

Definition at line 78 of file cf_generator.cc.

79{
80 ASSERT( current != gf_q + 1, "no more items" );
81 if ( gf_iszero( current ) )
82 current = 0;
83 else if ( current == gf_q1 - 1 )
84 current = gf_q + 1;
85 else
86 current++;
87}
VAR int gf_q1
Definition gfops.cc:50
bool gf_iszero(int a)
Definition gfops.h:43

◆ next() [2/3]

void GFGenerator::next ( )
virtual

Reimplemented from CFGenerator.

◆ next() [3/3]

void GFGenerator::next ( )
virtual

Reimplemented from CFGenerator.

◆ operator++() [1/6]

void GFGenerator::operator++ ( )
inline

Definition at line 85 of file cf_generator.h.

85{ next(); }

◆ operator++() [2/6]

void GFGenerator::operator++ ( )
inline

Definition at line 750 of file factory.h.

750{ next(); }

◆ operator++() [3/6]

void GFGenerator::operator++ ( )
inline

Definition at line 750 of file factory.h.

750{ next(); }

◆ operator++() [4/6]

void GFGenerator::operator++ ( int )
inline

Definition at line 86 of file cf_generator.h.

86{ next(); }

◆ operator++() [5/6]

void GFGenerator::operator++ ( int )
inline

Definition at line 751 of file factory.h.

751{ next(); }

◆ operator++() [6/6]

void GFGenerator::operator++ ( int )
inline

Definition at line 751 of file factory.h.

751{ next(); }

◆ reset() [1/3]

void GFGenerator::reset ( )
virtual

Reimplemented from CFGenerator.

Definition at line 67 of file cf_generator.cc.

68{
69 current = gf_zero();
70}

◆ reset() [2/3]

void GFGenerator::reset ( )
virtual

Reimplemented from CFGenerator.

◆ reset() [3/3]

void GFGenerator::reset ( )
virtual

Reimplemented from CFGenerator.

Field Documentation

◆ current

int GFGenerator::current
private

Definition at line 77 of file cf_generator.h.


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