Frobby  0.9.0
Classes | Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
InputConsumer Class Reference

#include <InputConsumer.h>

Classes

struct  Entry
 

Public Member Functions

 InputConsumer ()
 
void consumeRing (const VarNames &names)
 
void requireSquareFree ()
 
void beginIdeal ()
 Start consuming an ideal. More...
 
void hintGenCount (size_t hintGenCount)
 Suggest that the current ideal will have the given number of generators. More...
 
void beginTerm ()
 Start consuming a term. More...
 
size_t consumeVar (Scanner &in)
 Reads variable and returns id. More...
 
size_t consumeVarNumber (Scanner &in)
 Reads variable as a number so that the first variable is 1. More...
 
void consumeVarExponentOne (size_t var, const Scanner &in)
 Consumes var raised to the exponent 1. More...
 
void consumeVarExponent (size_t var, Scanner &in)
 Consumes var raised to an exponent read from in. More...
 
void endTerm ()
 Done reading a term. More...
 
void consumeTermProductNotation (Scanner &in)
 Reads a term in a format like "a^4*b*c^2". More...
 
void endIdeal ()
 Done reading an ideal. More...
 
bool empty () const
 Returns true if there are ideals stored. More...
 
void releaseIdeal (auto_ptr< SquareFreeIdeal > &sqf, auto_ptr< BigIdeal > &big)
 Struct that keeps either a BigIdeal or a SquareFreeIdeal. More...
 
auto_ptr< BigIdealreleaseBigIdeal ()
 Returns the least recently read ideal that has not been released. More...
 
auto_ptr< SquareFreeIdealreleaseSquareFreeIdeal ()
 Returns the least recently read ideal that has not been released. More...
 
const VarNamesgetRing () const
 Returns the current ring. More...
 

Private Member Functions

void releaseIdeal (Entry &e)
 
void errorVariableAppearsTwice (const Scanner &in, size_t var)
 
void idealNotSquareFree ()
 

Static Private Member Functions

static void toBigIdeal (auto_ptr< SquareFreeIdeal > &sqf, auto_ptr< BigIdeal > &big)
 

Private Attributes

string _tmpString
 
VarNames _names
 
auto_ptr< BigIdeal_bigIdeal
 
auto_ptr< SquareFreeIdeal_sqfIdeal
 
vector< string > _term
 
std::list< Entry * > _ideals
 
ElementDeleter< std::list< Entry * > > _idealsDeleter
 
bool _inIdeal
 
bool _requireSquareFree
 

Detailed Description

Definition at line 30 of file InputConsumer.h.

Constructor & Destructor Documentation

InputConsumer::InputConsumer ( )

Definition at line 27 of file InputConsumer.cpp.

Member Function Documentation

void InputConsumer::beginIdeal ( )

Start consuming an ideal.

Definition at line 50 of file InputConsumer.cpp.

void InputConsumer::beginTerm ( )

Start consuming a term.

Definition at line 62 of file InputConsumer.cpp.

void InputConsumer::consumeRing ( const VarNames names)

Definition at line 33 of file InputConsumer.cpp.

void InputConsumer::consumeTermProductNotation ( Scanner in)

Reads a term in a format like "a^4*b*c^2".

Definition at line 148 of file InputConsumer.cpp.

size_t InputConsumer::consumeVar ( Scanner in)

Reads variable and returns id.

Does not return if there is an error.

Definition at line 90 of file InputConsumer.cpp.

void InputConsumer::consumeVarExponent ( size_t  var,
Scanner in 
)

Consumes var raised to an exponent read from in.

Does not return if there is an error.

Definition at line 122 of file InputConsumer.cpp.

void InputConsumer::consumeVarExponentOne ( size_t  var,
const Scanner in 
)

Consumes var raised to the exponent 1.

Definition at line 102 of file InputConsumer.cpp.

size_t InputConsumer::consumeVarNumber ( Scanner in)

Reads variable as a number so that the first variable is 1.

Does not return if there is an error.

Definition at line 76 of file InputConsumer.cpp.

bool InputConsumer::empty ( ) const
inline

Returns true if there are ideals stored.

Definition at line 74 of file InputConsumer.h.

void InputConsumer::endIdeal ( )

Done reading an ideal.

Definition at line 191 of file InputConsumer.cpp.

void InputConsumer::endTerm ( )

Done reading a term.

Definition at line 164 of file InputConsumer.cpp.

void InputConsumer::errorVariableAppearsTwice ( const Scanner in,
size_t  var 
)
private

Definition at line 234 of file InputConsumer.cpp.

const VarNames& InputConsumer::getRing ( ) const
inline

Returns the current ring.

Definition at line 91 of file InputConsumer.h.

void InputConsumer::hintGenCount ( size_t  hintGenCount)

Suggest that the current ideal will have the given number of generators.

This helps in preallocating the right amount of memory.

Definition at line 57 of file InputConsumer.cpp.

void InputConsumer::idealNotSquareFree ( )
private

Definition at line 241 of file InputConsumer.cpp.

auto_ptr< BigIdeal > InputConsumer::releaseBigIdeal ( )

Returns the least recently read ideal that has not been released.

Converts the ideal to a BigIdeal if it had been read as something else.

Definition at line 209 of file InputConsumer.cpp.

void InputConsumer::releaseIdeal ( auto_ptr< SquareFreeIdeal > &  sqf,
auto_ptr< BigIdeal > &  big 
)

Struct that keeps either a BigIdeal or a SquareFreeIdeal.

Assigns the least recently read ideal that has not been released to the parameter of the type that the ideal was read as.

Definition at line 200 of file InputConsumer.cpp.

void InputConsumer::releaseIdeal ( Entry e)
private

Definition at line 227 of file InputConsumer.cpp.

auto_ptr< SquareFreeIdeal > InputConsumer::releaseSquareFreeIdeal ( )

Returns the least recently read ideal that has not been released.

That ideal must have been read as a SquareFreeIdeal.

Definition at line 218 of file InputConsumer.cpp.

void InputConsumer::requireSquareFree ( )

Definition at line 45 of file InputConsumer.cpp.

void InputConsumer::toBigIdeal ( auto_ptr< SquareFreeIdeal > &  sqf,
auto_ptr< BigIdeal > &  big 
)
staticprivate

Definition at line 247 of file InputConsumer.cpp.

Member Data Documentation

auto_ptr<BigIdeal> InputConsumer::_bigIdeal
private

Definition at line 107 of file InputConsumer.h.

std::list<Entry*> InputConsumer::_ideals
private

Definition at line 111 of file InputConsumer.h.

ElementDeleter<std::list<Entry*> > InputConsumer::_idealsDeleter
private

Definition at line 112 of file InputConsumer.h.

bool InputConsumer::_inIdeal
private

Definition at line 113 of file InputConsumer.h.

VarNames InputConsumer::_names
private

Definition at line 106 of file InputConsumer.h.

bool InputConsumer::_requireSquareFree
private

Definition at line 114 of file InputConsumer.h.

auto_ptr<SquareFreeIdeal> InputConsumer::_sqfIdeal
private

Definition at line 108 of file InputConsumer.h.

vector<string> InputConsumer::_term
private

Definition at line 109 of file InputConsumer.h.

string InputConsumer::_tmpString
private

Definition at line 105 of file InputConsumer.h.


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