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

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

Definition at line 57 of file cf_generator.cc.

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

Definition at line 80 of file cf_generator.h.

80 {}

Member Function Documentation

CFGenerator * GFGenerator::clone ( ) const
virtual

Reimplemented from CFGenerator.

Definition at line 89 of file cf_generator.cc.

90 {
91  return new GFGenerator();
92 }
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 }
int gf_q
Definition: gfops.cc:47
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 }
factory&#39;s main class
Definition: canonicalform.h:75
int gf_q
Definition: gfops.cc:47
InternalCF * int2imm_gf(long i)
Definition: imm.h:102
#define ASSERT(expression, message)
Definition: cf_assert.h:99
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 }
int gf_q1
Definition: gfops.cc:50
int gf_q
Definition: gfops.cc:47
bool gf_iszero(int a)
Definition: gfops.h:43
#define ASSERT(expression, message)
Definition: cf_assert.h:99
void GFGenerator::operator++ ( )
inline

Definition at line 85 of file cf_generator.h.

85 { next(); }
void GFGenerator::operator++ ( int  )
inline

Definition at line 86 of file cf_generator.h.

86 { next(); }
void GFGenerator::reset ( )
virtual

Reimplemented from CFGenerator.

Definition at line 67 of file cf_generator.cc.

68 {
69  current = gf_zero();
70 }
int gf_zero()
Definition: gfops.h:99

Field Documentation

int GFGenerator::current
private

Definition at line 77 of file cf_generator.h.


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