GiNaCRA
0.6.4
|
Class encapsulating the global variable and the global parameter list. More...
#include <SymbolDB.h>
Public Member Functions | |
SymbolDB (std::string stdname) | |
Constructs the lookup table for variables. | |
const symbol | operator[] (unsigned i) const |
Returns the i-th variable. | |
unsigned | operator[] (const symbol &v) const |
Returns the index belonging to the given variable s (in lexicographic order). | |
unsigned | addSymbol () |
Add a symbol with the standardname and a indexnumber. | |
unsigned | addSymbol (std::string name) |
Add a symbol with name name. | |
unsigned | addSymbol (symbol s) |
std::list< symbol > | getSymbolList () const |
std::vector< symbol > | getSymbolVector () const |
unsigned | size () |
Protected Attributes | |
vector< symbol > | mVariables |
std::map< symbol, unsigned, GiNaC::ex_is_less > | mSymbollist |
std::string | mStdName |
Class encapsulating the global variable and the global parameter list.
Notation is following http://www.possibility.com/Cpp/CppCodingStandard.html.
Definition at line 46 of file SymbolDB.h.
GiNaCRA::SymbolDB::SymbolDB | ( | std::string | stdname | ) |
Constructs the lookup table for variables.
The variables are sorted lexicographically.
stdname | The standard name new symbols get |
Definition at line 45 of file SymbolDB.cpp.
unsigned GiNaCRA::SymbolDB::addSymbol | ( | ) |
Add a symbol with the standardname and a indexnumber.
Definition at line 64 of file SymbolDB.cpp.
References mStdName, mSymbollist, mVariables, and size().
Referenced by GiNaCRA::VariableListPool::addParameter(), GiNaCRA::VariableListPool::addVariable(), GiNaCRA::VariableListPool::ensureNrVariables(), and GiNaCRA::VariableListPool::Initialize().
unsigned GiNaCRA::SymbolDB::addSymbol | ( | std::string | name | ) |
Add a symbol with name name.
name |
Definition at line 76 of file SymbolDB.cpp.
References mSymbollist, mVariables, and size().
unsigned GiNaCRA::SymbolDB::addSymbol | ( | symbol | s | ) |
s |
Definition at line 88 of file SymbolDB.cpp.
References mSymbollist, mVariables, and size().
std::list<symbol> GiNaCRA::SymbolDB::getSymbolList | ( | ) | const [inline] |
Definition at line 104 of file SymbolDB.h.
References mVariables.
Referenced by GiNaCRA::VariableListPool::getVariableList().
std::vector<symbol> GiNaCRA::SymbolDB::getSymbolVector | ( | ) | const [inline] |
Definition at line 113 of file SymbolDB.h.
References mVariables.
Referenced by GiNaCRA::VariableListPool::getVariables().
const symbol GiNaCRA::SymbolDB::operator[] | ( | unsigned | i | ) | const |
Returns the i-th variable.
i |
Definition at line 53 of file SymbolDB.cpp.
References mVariables.
unsigned GiNaCRA::SymbolDB::operator[] | ( | const symbol & | v | ) | const |
Returns the index belonging to the given variable s (in lexicographic order).
v |
throw(out_of_range); |
Definition at line 58 of file SymbolDB.cpp.
References mSymbollist.
unsigned GiNaCRA::SymbolDB::size | ( | ) | [inline] |
Definition at line 118 of file SymbolDB.h.
References mVariables.
Referenced by addSymbol(), and GiNaCRA::VariableListPool::ensureNrVariables().
std::string GiNaCRA::SymbolDB::mStdName [protected] |
Definition at line 126 of file SymbolDB.h.
Referenced by addSymbol().
std::map<symbol, unsigned, GiNaC::ex_is_less> GiNaCRA::SymbolDB::mSymbollist [protected] |
Definition at line 125 of file SymbolDB.h.
Referenced by addSymbol(), and operator[]().
vector<symbol> GiNaCRA::SymbolDB::mVariables [protected] |
Definition at line 124 of file SymbolDB.h.
Referenced by addSymbol(), getSymbolList(), getSymbolVector(), operator[](), and size().