|
Frobby
0.9.5
|
Defines the variables of a polynomial ring and facilities IO involving them. More...
#include <VarNames.h>
Public Member Functions | |
| VarNames () | |
| VarNames (size_t varCount) | |
| VarNames (const VarNames &names) | |
| ~VarNames () | |
| bool | addVar (const string &name) |
| Adds the variable and returns true if name is not already a variable. More... | |
| void | addVarSyntaxCheckUnique (const Scanner &in, const string &name) |
| As addvar, except it reports a syntax error if name is already a variable. More... | |
| bool | operator< (const VarNames &names) const |
| This also depends on the order of the names. More... | |
| size_t | getIndex (const string &name) const |
| Returns VarNames::invalidIndex() if name is not known. More... | |
| bool | contains (const string &name) const |
| Returns true if name is the name of a variable. More... | |
| bool | namesAreDefault () const |
| Returns true if the names are x1, x2 and so on. More... | |
| const string & | getName (size_t index) const |
| The returned reference can become invalid next time addVar is called. More... | |
| size_t | getVarCount () const |
| Returns the current number of variables. More... | |
| void | clear () |
| Resets the number of variables to zero. More... | |
| bool | empty () const |
| Returns true if the number of variables is zero. More... | |
| VarNames & | operator= (const VarNames &names) |
| bool | operator== (const VarNames &names) const |
| bool | operator!= (const VarNames &names) const |
| void | swapVariables (size_t a, size_t b) |
| Swaps the variables with indexes a and b. More... | |
| void | projectVar (size_t index) |
| void | toString (string &str) const |
| void | print (FILE *file) const |
| void | swap (VarNames &names) |
Static Public Attributes | |
| static const size_t | invalidIndex = static_cast<size_t>(-1) |
| Returns a fixed variable offset that is always invalid. More... | |
Private Types | |
| typedef unordered_map< string, size_t > | VarNameMap |
Static Private Member Functions | |
| static bool | compareNames (const string *a, const string *b) |
Private Attributes | |
| VarNameMap | _nameToIndex |
| vector< const string * > | _indexToName |
Defines the variables of a polynomial ring and facilities IO involving them.
Definition at line 40 of file VarNames.h.
|
private |
Definition at line 105 of file VarNames.h.
| VarNames::VarNames | ( | ) |
Definition at line 25 of file VarNames.cpp.
| VarNames::VarNames | ( | size_t | varCount | ) |
Definition at line 28 of file VarNames.cpp.
| VarNames::VarNames | ( | const VarNames & | names | ) |
Definition at line 36 of file VarNames.cpp.
| VarNames::~VarNames | ( | ) |
Definition at line 40 of file VarNames.cpp.
| bool VarNames::addVar | ( | const string & | name | ) |
Adds the variable and returns true if name is not already a variable.
Otherwise it returns false without adding the variable (again).
Definition at line 44 of file VarNames.cpp.
| void VarNames::addVarSyntaxCheckUnique | ( | const Scanner & | in, |
| const string & | name | ||
| ) |
As addvar, except it reports a syntax error if name is already a variable.
Definition at line 68 of file VarNames.cpp.
| void VarNames::clear | ( | ) |
Resets the number of variables to zero.
Definition at line 106 of file VarNames.cpp.
|
staticprivate |
Definition at line 195 of file VarNames.cpp.
| bool VarNames::contains | ( | const string & | name | ) | const |
Returns true if name is the name of a variable.
Definition at line 91 of file VarNames.cpp.
| bool VarNames::empty | ( | ) | const |
Returns true if the number of variables is zero.
Definition at line 111 of file VarNames.cpp.
| size_t VarNames::getIndex | ( | const string & | name | ) | const |
Returns VarNames::invalidIndex() if name is not known.
Definition at line 83 of file VarNames.cpp.
| const string & VarNames::getName | ( | size_t | index | ) | const |
The returned reference can become invalid next time addVar is called.
Definition at line 100 of file VarNames.cpp.
|
inline |
Returns the current number of variables.
Definition at line 113 of file VarNames.h.
| bool VarNames::namesAreDefault | ( | ) | const |
Returns true if the names are x1, x2 and so on.
Definition at line 95 of file VarNames.cpp.
| bool VarNames::operator!= | ( | const VarNames & | names | ) | const |
Definition at line 139 of file VarNames.cpp.
| bool VarNames::operator< | ( | const VarNames & | names | ) | const |
This also depends on the order of the names.
Definition at line 75 of file VarNames.cpp.
Definition at line 115 of file VarNames.cpp.
| bool VarNames::operator== | ( | const VarNames & | names | ) | const |
Definition at line 128 of file VarNames.cpp.
| void VarNames::print | ( | FILE * | file | ) | const |
Definition at line 180 of file VarNames.cpp.
| void VarNames::projectVar | ( | size_t | index | ) |
Definition at line 161 of file VarNames.cpp.
| void VarNames::swap | ( | VarNames & | names | ) |
Definition at line 190 of file VarNames.cpp.
| void VarNames::swapVariables | ( | size_t | a, |
| size_t | b | ||
| ) |
Swaps the variables with indexes a and b.
Definition at line 143 of file VarNames.cpp.
| void VarNames::toString | ( | string & | str | ) | const |
Definition at line 171 of file VarNames.cpp.
|
private |
Definition at line 108 of file VarNames.h.
|
private |
Definition at line 107 of file VarNames.h.
|
static |
Returns a fixed variable offset that is always invalid.
Definition at line 100 of file VarNames.h.