My Project
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes
FFGenerator Class Reference

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

#include <cf_generator.h>

Public Member Functions

 FFGenerator ()
 
 ~FFGenerator ()
 
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 F_p starting from 0

Definition at line 55 of file cf_generator.h.

Constructor & Destructor Documentation

◆ FFGenerator()

FFGenerator::FFGenerator ( )
inline

Definition at line 60 of file cf_generator.h.

60: current(0) {}

◆ ~FFGenerator()

FFGenerator::~FFGenerator ( )
inline

Definition at line 61 of file cf_generator.h.

61{}

Member Function Documentation

◆ clone()

CFGenerator * FFGenerator::clone ( ) const
virtual

Reimplemented from CFGenerator.

Definition at line 52 of file cf_generator.cc.

53{
54 return new FFGenerator();
55}

◆ hasItems()

bool FFGenerator::hasItems ( ) const
virtual

Reimplemented from CFGenerator.

Definition at line 35 of file cf_generator.cc.

36{
37 return current < ff_prime;
38}
VAR int ff_prime
Definition: ffops.cc:14

◆ item()

CanonicalForm FFGenerator::item ( ) const
virtual

Reimplemented from CFGenerator.

Definition at line 40 of file cf_generator.cc.

41{
42 ASSERT( current < ff_prime, "no more items" );
43 return CanonicalForm( int2imm_p( current ) );
44}
#define ASSERT(expression, message)
Definition: cf_assert.h:99
factory's main class
Definition: canonicalform.h:86
InternalCF * int2imm_p(long i)
Definition: imm.h:101

◆ next()

void FFGenerator::next ( )
virtual

Reimplemented from CFGenerator.

Definition at line 46 of file cf_generator.cc.

47{
48 ASSERT( current < ff_prime, "no more items" );
49 current++;
50}

◆ operator++() [1/2]

void FFGenerator::operator++ ( )
inline

Definition at line 66 of file cf_generator.h.

66{ next(); }

◆ operator++() [2/2]

void FFGenerator::operator++ ( int  )
inline

Definition at line 67 of file cf_generator.h.

67{ next(); }

◆ reset()

void FFGenerator::reset ( )
inlinevirtual

Reimplemented from CFGenerator.

Definition at line 63 of file cf_generator.h.

63{ current = 0; }

Field Documentation

◆ current

int FFGenerator::current
private

Definition at line 58 of file cf_generator.h.


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