My Project
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes
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
 
- Public Member Functions inherited from CFGenerator
 CFGenerator ()
 
virtual ~CFGenerator ()
 
virtual bool hasItems () const
 
virtual void reset ()
 
virtual CanonicalForm item () const
 
virtual void next ()
 
virtual CFGeneratorclone () const
 

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()

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()

GFGenerator::~GFGenerator ( )
inline

Definition at line 80 of file cf_generator.h.

80{}

Member Function Documentation

◆ clone()

CFGenerator * GFGenerator::clone ( ) const
virtual

Reimplemented from CFGenerator.

Definition at line 89 of file cf_generator.cc.

90{
91 return new GFGenerator();
92}

◆ hasItems()

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

◆ item()

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
factory's main class
Definition: canonicalform.h:86
InternalCF * int2imm_gf(long i)
Definition: imm.h:106

◆ next()

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

◆ operator++() [1/2]

void GFGenerator::operator++ ( )
inline

Definition at line 85 of file cf_generator.h.

85{ next(); }

◆ operator++() [2/2]

void GFGenerator::operator++ ( int  )
inline

Definition at line 86 of file cf_generator.h.

86{ next(); }

◆ reset()

void GFGenerator::reset ( )
virtual

Reimplemented from CFGenerator.

Definition at line 67 of file cf_generator.cc.

68{
69 current = gf_zero();
70}

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: