C++ main module for gpm Package
1.0
|
This class decribes a variable class for evaluation. More...
#include <MATH_Variable.h>
Public Member Functions | |
const double & | operator[] (const int &index) const |
operator get for reading More... | |
double & | operator[] (const int &index) |
operator get for writing More... | |
virtual void | copy (const MATH_Variable &v) |
copy the variable More... | |
void | clear () |
clear the variable More... | |
tBoolean | setSize (const int &n) |
set the size of the variable be careful of the used of operator[] : the values may be reallocated which turn the operator[] out of date More... | |
void | setFirstIndex (const int &index) |
set the first index More... | |
void | setStartIndex (const int &index) |
set the start index More... | |
void | setValue (const int &index, const double &v) |
set the value More... | |
void | setValue (const tString &symbol) |
set the value More... | |
void | setValue (const double &v) |
set the value More... | |
void | setValue (const double *v, const int &n) |
set the value More... | |
void | setValue (const long double *v, const int &n) |
set the value More... | |
void | setValue (const int &v) |
set the value More... | |
void | setValue (const int *v, const int &n) |
set the value More... | |
void | setValue (const tBoolean &v) |
set the value More... | |
void | setType (const tFlag &type) |
set the type More... | |
void | getValue (double *v, int &n) const |
get value : n is the real size of v the max size is the value of n at INPUT More... | |
void | getValue (int *v, int &n) const |
get value: n is the real size of v the max size is the value of n at INPUT More... | |
void | getValue (const int &index, int &v) const |
get value More... | |
void | getValue (const int &index, double &v) const |
get value More... | |
void | getValue (double &v) const |
get value More... | |
void | getValue (int &v) const |
get value More... | |
void | getValue (tString &v) const |
get value More... | |
tFlag | getType () const |
get the type More... | |
int | getSize () const |
get the size More... | |
int | getFirstIndex () const |
get the first index More... | |
int | getStartIndex () const |
get the first index More... | |
int | getCapacity () const |
return the capacity of the variable More... | |
tBoolean | isNumericalType () const |
retrun true if the type is numerical More... | |
tBoolean | isBoolean () const |
retrun true if the type is boolean More... | |
tBoolean | isInteger () const |
retrun true if the type is integer More... | |
tBoolean | isReal () const |
retrun true if the type is real More... | |
tBoolean | isString () const |
retrun true if the type is string More... | |
tBoolean | isEqual (const MATH_Variable &var, const tReal &eps) const |
return true if the variable are equal More... | |
tBoolean | isEqual (const MATH_Variable &var) const |
return true if the variable are equal More... | |
virtual tString | toString () const |
print the environment class in a string More... | |
void | getSharedPointer (SP::CORE_Object &p) |
get the shared pointer of this class into p More... | |
void | getSharedPointer (SPC::CORE_Object &p) const |
get the shared pointer of this class into p More... | |
tString | getClassName () const |
return the class name of the object More... | |
tString | getIdentityString () const |
return the identity string of the object of the form className_at_address More... | |
tString | getPointerAddress () const |
return the identity string of the object More... | |
template<class T > | |
tBoolean | isInstanceOf () const |
return true if the object is an instance of T More... | |
virtual void | print () |
print the class More... | |
virtual ostream & | print (ostream &out) const |
print the class More... | |
virtual void | print (const tString &message) |
print the class More... | |
virtual void | print (const tInteger &str) |
print More... | |
virtual void | print (const tRelativeInteger &str) |
print More... | |
virtual void | print (const tReal &str) |
print More... | |
virtual void | print (const int &str) |
print More... | |
Static Public Member Functions | |
static SP::MATH_Variable | New () |
create a node expression More... | |
static SP::MATH_Variable | New (const int &cap) |
create a node expression More... | |
static tBoolean | isNumericalType (const tFlag &type) |
retrun true if the type is numerical More... | |
static int | toInteger (const double &v) |
to int More... | |
static tBoolean | toBoolean (const double &v) |
to boolean More... | |
static tString | getClassName (const tString &identityString) |
return the class name of the object using only the identity string More... | |
template<class T > | |
static tString | getTypeName () |
get type name More... | |
static tBoolean | is64Architecture () |
return true if the machine is a 64 bits machine More... | |
static tBoolean | is32Architecture () |
return true if the machine is a 32 bits machine More... | |
static tString | pointer2String (const void *obj) |
return the string represantation of a pointer More... | |
static void | setOutput (ostream &out) |
set output More... | |
static ostream & | getOutput () |
get output More... | |
static void | printObjectsInMemory () |
print object in memory More... | |
static ostream & | print (ostream &out, const tString &message) |
print the class More... | |
static void | outputPrint (const tString &message) |
Static Public Attributes | |
static const tFlag | BOUND_POINT [] ={0,1,2} |
static const tFlag | BOUND_SIZE [] ={3,4,5} |
static const tFlag | UNDEFINED =0 |
static const tFlag | REAL =1 |
static const tFlag | BOOLEAN =3 |
static const tFlag | INTEGER =2 |
static const tFlag | STRING =4 |
static tBoolean | mIsMemoryTesting =false |
indicator to store all classes created and deleted only for debuging version More... | |
Protected Member Functions | |
MATH_Variable (const int &cap) | |
create More... | |
virtual | ~MATH_Variable (void) |
destroy More... | |
void | setThis (SP::CORE_Object p) |
set this weak shared pointer called toDoAfterThis setting method More... | |
virtual void | setType (tString type) |
set the type of the object More... | |
virtual void | toDoAfterThisSetting () |
method called after setThis() method this method can oly be called once. More... | |
This class decribes a variable class for evaluation.
|
protected |
|
protectedvirtual |
destroy
|
inline |
clear the variable
References UNDEFINED.
|
virtual |
copy the variable
References getFirstIndex(), getSize(), getType(), and setSize().
Referenced by MATH_Environment::copy().
|
inline |
return the capacity of the variable
return the class name of the object using only the identity string
Referenced by CORE_Object::printObjectsInMemory().
|
inherited |
return the class name of the object
References tString.
Referenced by CORE_Object::getIdentityString().
|
inline |
|
inlineinherited |
return the identity string of the object of the form className_at_address
References CORE_Object::getClassName(), CORE_Object::pointer2String(), and tString.
Referenced by CORE_Object::toString().
|
inlinestaticinherited |
get output
|
inlineinherited |
return the identity string of the object
References CORE_Object::pointer2String().
|
inlineinherited |
get the shared pointer of this class into p
Referenced by MATH_ParentExpression::addArgument(), GPMG_EnvironmentPanel::componentClicked(), GPM_GraphElement::copy(), CORE_Map< Key, Value >::getSharedPointer(), CORE_Array< T >::getSharedPointer(), CORE_Vector< T >::getSharedPointer(), CORE_Matrix< T >::getSharedPointer(), CORE_Object::printObjectsInMemory(), MATH_ParentExpression::setArgument(), GPMG_EnvironmentPanel::setEnvironment(), GPM_GraphElement::setGraph(), GPMG_GraphElementWindow::setGraphElement(), GPMG_ShowGraphDrawPanel::showGraph(), and GPMG_RuleGraphDrawPanel::showRule().
|
inlineinherited |
get the shared pointer of this class into p
|
inline |
get the size
Referenced by copy(), MATH_NumericalFunction::evaluate(), MATH_DivideOperator::evaluate(), MATH_ModuloOperator::evaluate(), MATH_SetTransformer::evaluate(), MATH_EOperator::evaluate(), MATH_MultiplyOperator::evaluate(), MATH_AddOperator::evaluate(), MATH_NotOperator::evaluate(), MATH_OrOperator::evaluate(), MATH_LEOperator::evaluate(), MATH_AndOperator::evaluate(), MATH_EQOperator::evaluate(), MATH_NotBitwiseOperator::evaluate(), MATH_ArrayFunction::evaluate(), MATH_AndBitwiseOperator::evaluate(), MATH_OrBitwiseOperator::evaluate(), MATH_NEQOperator::evaluate(), MATH_XorBitwiseOperator::evaluate(), MATH_LTOperator::evaluate(), MATH_MinusOperator::evaluate(), MATH_GEOperator::evaluate(), MATH_GTOperator::evaluate(), MATH_LeafExpression::evaluate(), MATH_Environment::getVariable(), isEqual(), and toString().
|
inline |
get the first index
Referenced by MATH_DivideOperator::evaluate(), MATH_ModuloOperator::evaluate(), MATH_NumericalFunction::evaluate(), MATH_MultiplyOperator::evaluate(), MATH_AddOperator::evaluate(), MATH_LEOperator::evaluate(), MATH_OrOperator::evaluate(), MATH_AndOperator::evaluate(), MATH_ArrayFunction::evaluate(), MATH_EQOperator::evaluate(), MATH_NEQOperator::evaluate(), MATH_AndBitwiseOperator::evaluate(), MATH_XorBitwiseOperator::evaluate(), MATH_OrBitwiseOperator::evaluate(), MATH_LTOperator::evaluate(), MATH_GEOperator::evaluate(), and MATH_GTOperator::evaluate().
|
inline |
get the type
Referenced by copy(), MATH_NotOperator::evaluate(), MATH_ArrayFunction::evaluate(), MATH_NotBitwiseOperator::evaluate(), MATH_Environment::getVariable(), and isEqual().
|
inlinestaticinherited |
get type name
References tString.
|
inline |
get value : n is the real size of v the max size is the value of n at INPUT
Referenced by getValue().
|
inline |
get value: n is the real size of v the max size is the value of n at INPUT
|
inline |
get value
|
inline |
get value
|
inline |
|
inline |
|
inline |
get value
|
inlinestaticinherited |
return true if the machine is a 32 bits machine
References CORE_Object::is64Architecture().
|
staticinherited |
return true if the machine is a 64 bits machine
Referenced by CORE_Object::is32Architecture().
|
inline |
retrun true if the type is boolean
Referenced by MATH_AndOperator::evaluate(), MATH_OrOperator::evaluate(), and MATH_MinusOperator::evaluate().
tBoolean MATH_Variable::isEqual | ( | const MATH_Variable & | var, |
const tReal & | eps | ||
) | const |
|
inline |
return true if the variable are equal
References isEqual().
|
inlineinherited |
return true if the object is an instance of T
References null.
Referenced by MATH_BinaryOperator::insertInTree(), MATH_UnaryOperator::insertInTree(), and MATH_EndBlock::insertInTree().
|
inline |
retrun true if the type is integer
retrun true if the type is numerical
Referenced by MATH_NumericalFunction::evaluate(), and MATH_ArrayFunction::evaluate().
|
inline |
retrun true if the type is numerical
|
inline |
retrun true if the type is real
Referenced by MATH_SetTransformer::evaluate().
|
inline |
retrun true if the type is string
Referenced by MATH_DivideOperator::evaluate(), MATH_ModuloOperator::evaluate(), MATH_MultiplyOperator::evaluate(), MATH_XorBitwiseOperator::evaluate(), MATH_AndBitwiseOperator::evaluate(), MATH_OrBitwiseOperator::evaluate(), and MATH_MinusOperator::evaluate().
|
inlinestatic |
create a node expression
References MATH_Variable().
Referenced by MATH_Environment::addVariable(), MATH_Environment::copy(), MATH_RootExpression::MATH_RootExpression(), and MATH_Environment::setVariable().
|
inlinestatic |
|
inline |
operator get for reading
References ASSERT_IN.
|
inline |
operator get for writing
References ASSERT_IN.
|
staticinherited |
print on output
References null, and CORE_Object::print().
Referenced by CORE_Exception::CORE_Exception().
|
staticinherited |
return the string represantation of a pointer
References tString.
Referenced by CORE_Object::CORE_Object(), CORE_Object::getIdentityString(), CORE_Object::getPointerAddress(), and CORE_Object::~CORE_Object().
|
inlinevirtualinherited |
print the class
References CORE_Object::toString().
Referenced by CORE_Object::outputPrint(), CORE_Out::print(), CORE_Object::print(), CORE_Out::printInt(), CORE_Out::println(), CORE_Out::printReal(), CORE_Out::printString(), and CORE_Out::setAction().
|
inlinevirtualinherited |
print the class
References CORE_Object::print(), and CORE_Object::toString().
|
virtualinherited |
print the class
Reimplemented in CORE_Out.
References null, and CORE_Object::print().
|
virtualinherited |
References null.
|
virtualinherited |
References null.
|
inlinestaticinherited |
print the class
|
staticinherited |
print object in memory
References CORE_Object::getClassName(), CORE_Object::getSharedPointer(), and CORE_Object::mIsMemoryTesting.
Referenced by main().
|
inline |
set the first index
References setSize().
Referenced by MATH_NumericalFunction::evaluate(), MATH_AddOperator::evaluate(), MATH_LEOperator::evaluate(), MATH_AndOperator::evaluate(), MATH_OrOperator::evaluate(), MATH_ArrayFunction::evaluate(), MATH_EQOperator::evaluate(), MATH_OrBitwiseOperator::evaluate(), MATH_AndBitwiseOperator::evaluate(), MATH_NEQOperator::evaluate(), MATH_XorBitwiseOperator::evaluate(), MATH_LTOperator::evaluate(), MATH_GEOperator::evaluate(), and MATH_GTOperator::evaluate().
|
inlinestaticinherited |
set output
tBoolean MATH_Variable::setSize | ( | const int & | n | ) |
set the size of the variable be careful of the used of operator[] : the values may be reallocated which turn the operator[] out of date
size of the variable If getStartIndex()+n >= getCapacity() the values are reallocated |
References tBoolean.
Referenced by copy(), MATH_DivideOperator::evaluate(), MATH_NumericalFunction::evaluate(), MATH_ModuloOperator::evaluate(), MATH_MultiplyOperator::evaluate(), MATH_AddOperator::evaluate(), MATH_Set::evaluate(), MATH_OrOperator::evaluate(), MATH_LEOperator::evaluate(), MATH_AndOperator::evaluate(), MATH_ArrayFunction::evaluate(), MATH_EQOperator::evaluate(), MATH_AndBitwiseOperator::evaluate(), MATH_OrBitwiseOperator::evaluate(), MATH_XorBitwiseOperator::evaluate(), MATH_NEQOperator::evaluate(), MATH_VectorFunction::evaluate(), MATH_LTOperator::evaluate(), MATH_GEOperator::evaluate(), MATH_GTOperator::evaluate(), MATH_LeafExpression::evaluate(), MATH_Environment::getVariable(), setFirstIndex(), setStartIndex(), and setValue().
|
inline |
set the start index
References setSize().
Referenced by MATH_DivideOperator::evaluate(), MATH_ModuloOperator::evaluate(), and MATH_MultiplyOperator::evaluate().
|
inlineprotectedinherited |
set this weak shared pointer called toDoAfterThis setting method
References CORE_Object::toDoAfterThisSetting().
|
inlineprotectedvirtualinherited |
set the type of the object
Referenced by CORE_CommandLine::CORE_CommandLine(), CORE_IO::CORE_IO(), GPM_2DSnowGraph::GPM_2DSnowGraph(), GPM_BGLTest::GPM_BGLTest(), GPM_ClassFactory::GPM_ClassFactory(), GPM_ConwayFunction::GPM_ConwayFunction(), GPM_ConwayGraph::GPM_ConwayGraph(), GPM_CoreRun::GPM_CoreRun(), GPM_CoreTest::GPM_CoreTest(), GPM_Edge::GPM_Edge(), GPM_ExamplesRun::GPM_ExamplesRun(), GPM_Function::GPM_Function(), GPM_Graph::GPM_Graph(), GPM_GraphElement::GPM_GraphElement(), GPM_ModelGraph::GPM_ModelGraph(), GPM_Node::GPM_Node(), GPM_Object::GPM_Object(), GPM_PatternFunction::GPM_PatternFunction(), GPM_Port::GPM_Port(), GPM_PortGraph::GPM_PortGraph(), GPM_Snow2DFunction::GPM_Snow2DFunction(), GPM_Snow3DFunction::GPM_Snow3DFunction(), GPM_Vertex::GPM_Vertex(), and MATH_ExpressionRun::MATH_ExpressionRun().
|
inline |
set the type
Referenced by MATH_DivideOperator::evaluate(), MATH_MultiplyOperator::evaluate(), MATH_Set::evaluate(), MATH_LEOperator::evaluate(), MATH_EQOperator::evaluate(), MATH_NEQOperator::evaluate(), MATH_LTOperator::evaluate(), MATH_GEOperator::evaluate(), MATH_GTOperator::evaluate(), and MATH_Environment::getVariable().
|
inline |
set the value
References setSize().
Referenced by MATH_Environment::getVariable().
void MATH_Variable::setValue | ( | const tString & | symbol | ) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinestatic |
to boolean
References tBoolean, and toInteger().
Referenced by MATH_AndOperator::evaluate(), and MATH_OrOperator::evaluate().
|
inlineprotectedvirtualinherited |
method called after setThis() method this method can oly be called once.
Reimplemented in GPM_2DSnowGraph, GPMG_EnvironmentWindow, GPM_GraphElement, GPM_ModelFunction, GPM_ModelGraph, GPMG_RuleGraphWindow, GPMG_MovieGraphWindow, GPMG_ShowGraphWindow, and GPM_Function.
Referenced by CORE_Object::setThis(), GPM_ModelGraph::toDoAfterThisSetting(), GPM_GraphElement::toDoAfterThisSetting(), and GPM_2DSnowGraph::toDoAfterThisSetting().
|
inlinestatic |
to int
Referenced by MATH_AndBitwiseOperator::evaluate(), MATH_XorBitwiseOperator::evaluate(), MATH_OrBitwiseOperator::evaluate(), and toBoolean().
|
virtual |
print the environment class in a string
Reimplemented from CORE_Object.
References getSize(), CORE_Real::toString(), and tString.
|
static |
Referenced by MATH_DivideOperator::evaluate(), MATH_MultiplyOperator::evaluate(), MATH_Set::evaluate(), MATH_LEOperator::evaluate(), MATH_EQOperator::evaluate(), MATH_NEQOperator::evaluate(), MATH_LTOperator::evaluate(), MATH_GEOperator::evaluate(), MATH_GTOperator::evaluate(), setValue(), and MATH_Environment::setVariable().
|
static |
|
static |
|
static |
Referenced by setValue(), and MATH_Environment::setVariable().
|
staticinherited |
indicator to store all classes created and deleted only for debuging version
Referenced by CORE_Object::CORE_Object(), main(), CORE_Object::printObjectsInMemory(), and CORE_Object::~CORE_Object().
|
static |
|
static |
|
static |
Referenced by clear(), MATH_ArrayFunction::evaluate(), and MATH_Environment::getVariableType().