|
Frobby 0.10.0
|
#include <VarNames.h>
Public Member Functions | |
| VarNames (size_t varCount) | |
| VarNames (const VarNames &names) | |
| bool | addVar (const string &name) |
| void | addVarSyntaxCheckUnique (const Scanner &in, const string &name) |
| bool | operator< (const VarNames &names) const |
| size_t | getIndex (const string &name) const |
| bool | contains (const string &name) const |
| bool | namesAreDefault () const |
| const string & | getName (size_t index) const |
| size_t | getVarCount () const |
| void | clear () |
| bool | empty () const |
| 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) |
| 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) |
Defines the variables of a polynomial ring and facilities IO involving them.
| 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).
| void VarNames::addVarSyntaxCheckUnique | ( | const Scanner & | in, |
| const string & | name ) |
As addvar, except it reports a syntax error if name is already a variable.
| void VarNames::clear | ( | ) |
Resets the number of variables to zero.
| bool VarNames::contains | ( | const string & | name | ) | const |
Returns true if name is the name of a variable.
| bool VarNames::empty | ( | ) | const |
Returns true if the number of variables is zero.
| size_t VarNames::getIndex | ( | const string & | name | ) | const |
Returns VarNames::invalidIndex() if name is not known.
| const string & VarNames::getName | ( | size_t | index | ) | const |
The returned reference can become invalid next time addVar is called.
|
inline |
Returns the current number of variables.
| bool VarNames::namesAreDefault | ( | ) | const |
Returns true if the names are x1, x2 and so on.
| bool VarNames::operator< | ( | const VarNames & | names | ) | const |
This also depends on the order of the names.
| void VarNames::swapVariables | ( | size_t | a, |
| size_t | b ) |
Swaps the variables with indexes a and b.
|
static |
Returns a fixed variable offset that is always invalid.