C++ main module for gpm Package  1.0
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | List of all members
MATH_Variable Class Reference

This class decribes a variable class for evaluation. More...

#include <MATH_Variable.h>

Inheritance diagram for MATH_Variable:
Inheritance graph
[legend]
Collaboration diagram for MATH_Variable:
Collaboration graph
[legend]

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...
 

Detailed Description

This class decribes a variable class for evaluation.

Author
Stéphane Despréaux
Version
1.0

Constructor & Destructor Documentation

MATH_Variable::MATH_Variable ( const int &  cap)
protected

create

References REAL.

Referenced by New().

Here is the caller graph for this function:

MATH_Variable::~MATH_Variable ( void  )
protectedvirtual

destroy

Member Function Documentation

void MATH_Variable::clear ( )
inline

clear the variable

References UNDEFINED.

void MATH_Variable::copy ( const MATH_Variable v)
virtual

copy the variable

References getFirstIndex(), getSize(), getType(), and setSize().

Referenced by MATH_Environment::copy().

Here is the call graph for this function:

Here is the caller graph for this function:

int MATH_Variable::getCapacity ( ) const
inline

return the capacity of the variable

static tString CORE_Object::getClassName ( const tString identityString)
inlinestaticinherited

return the class name of the object using only the identity string

Referenced by CORE_Object::printObjectsInMemory().

Here is the caller graph for this function:

tString CORE_Object::getClassName ( ) const
inherited

return the class name of the object

Returns
the class name of the object

References tString.

Referenced by CORE_Object::getIdentityString().

Here is the caller graph for this function:

int MATH_Variable::getFirstIndex ( ) const
inline

get the first index

Referenced by copy().

Here is the caller graph for this function:

tString CORE_Object::getIdentityString ( ) const
inlineinherited

return the identity string of the object of the form className_at_address

Returns
the identity string of the object

References CORE_Object::getClassName(), CORE_Object::pointer2String(), and tString.

Referenced by CORE_Object::toString().

Here is the call graph for this function:

Here is the caller graph for this function:

static ostream& CORE_Object::getOutput ( )
inlinestaticinherited

get output

tString CORE_Object::getPointerAddress ( ) const
inlineinherited

return the identity string of the object

Returns
the identity string of the object

References CORE_Object::pointer2String().

Here is the call graph for this function:

void CORE_Object::getSharedPointer ( SP::CORE_Object &  p)
inlineinherited
void CORE_Object::getSharedPointer ( SPC::CORE_Object &  p) const
inlineinherited

get the shared pointer of this class into p

int MATH_Variable::getSize ( ) const
inline
int MATH_Variable::getStartIndex ( ) const
inline
tFlag MATH_Variable::getType ( ) const
inline
template<class T >
static tString CORE_Object::getTypeName ( )
inlinestaticinherited

get type name

References tString.

void MATH_Variable::getValue ( double *  v,
int &  n 
) const
inline

get value : n is the real size of v the max size is the value of n at INPUT

Referenced by getValue().

Here is the caller graph for this function:

void MATH_Variable::getValue ( int *  v,
int &  n 
) const
inline

get value: n is the real size of v the max size is the value of n at INPUT

void MATH_Variable::getValue ( const int &  index,
int &  v 
) const
inline

get value

void MATH_Variable::getValue ( const int &  index,
double &  v 
) const
inline

get value

void MATH_Variable::getValue ( double &  v) const
inline

get value

References getValue().

Here is the call graph for this function:

void MATH_Variable::getValue ( int &  v) const
inline

get value

References getValue().

Here is the call graph for this function:

void MATH_Variable::getValue ( tString v) const
inline

get value

static tBoolean CORE_Object::is32Architecture ( )
inlinestaticinherited

return true if the machine is a 32 bits machine

References CORE_Object::is64Architecture().

Here is the call graph for this function:

tBoolean CORE_Object::is64Architecture ( )
staticinherited

return true if the machine is a 64 bits machine

Referenced by CORE_Object::is32Architecture().

Here is the caller graph for this function:

tBoolean MATH_Variable::isBoolean ( ) const
inline

retrun true if the type is boolean

Referenced by MATH_AndOperator::evaluate(), MATH_OrOperator::evaluate(), and MATH_MinusOperator::evaluate().

Here is the caller graph for this function:

tBoolean MATH_Variable::isEqual ( const MATH_Variable var,
const tReal eps 
) const

return true if the variable are equal

References getSize(), getType(), and tBoolean.

Referenced by isEqual().

Here is the call graph for this function:

Here is the caller graph for this function:

tBoolean MATH_Variable::isEqual ( const MATH_Variable var) const
inline

return true if the variable are equal

References isEqual().

Here is the call graph for this function:

template<class T >
tBoolean CORE_Object::isInstanceOf ( ) const
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().

Here is the caller graph for this function:

tBoolean MATH_Variable::isInteger ( ) const
inline

retrun true if the type is integer

static tBoolean MATH_Variable::isNumericalType ( const tFlag type)
inlinestatic

retrun true if the type is numerical

Referenced by MATH_NumericalFunction::evaluate(), and MATH_ArrayFunction::evaluate().

Here is the caller graph for this function:

tBoolean MATH_Variable::isNumericalType ( ) const
inline

retrun true if the type is numerical

tBoolean MATH_Variable::isReal ( ) const
inline

retrun true if the type is real

Referenced by MATH_SetTransformer::evaluate().

Here is the caller graph for this function:

tBoolean MATH_Variable::isString ( ) const
inline
static SP::MATH_Variable MATH_Variable::New ( )
inlinestatic

create a node expression

References MATH_Variable().

Referenced by MATH_Environment::addVariable(), MATH_Environment::copy(), MATH_RootExpression::MATH_RootExpression(), and MATH_Environment::setVariable().

Here is the call graph for this function:

Here is the caller graph for this function:

static SP::MATH_Variable MATH_Variable::New ( const int &  cap)
inlinestatic

create a node expression

References MATH_Variable().

Here is the call graph for this function:

const double& MATH_Variable::operator[] ( const int &  index) const
inline

operator get for reading

References ASSERT_IN.

double& MATH_Variable::operator[] ( const int &  index)
inline

operator get for writing

References ASSERT_IN.

void CORE_Object::outputPrint ( const tString message)
staticinherited

print on output

References null, and CORE_Object::print().

Referenced by CORE_Exception::CORE_Exception().

Here is the call graph for this function:

Here is the caller graph for this function:

tString CORE_Object::pointer2String ( const void *  obj)
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().

Here is the caller graph for this function:

virtual void CORE_Object::print ( )
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().

Here is the call graph for this function:

Here is the caller graph for this function:

virtual ostream& CORE_Object::print ( ostream &  out) const
inlinevirtualinherited

print the class

References CORE_Object::print(), and CORE_Object::toString().

Here is the call graph for this function:

void CORE_Object::print ( const tString message)
virtualinherited

print the class

Reimplemented in CORE_Out.

References null, and CORE_Object::print().

Here is the call graph for this function:

void CORE_Object::print ( const tInteger str)
virtualinherited

print

References null.

void CORE_Object::print ( const tRelativeInteger str)
virtualinherited

print

References null.

void CORE_Object::print ( const tReal str)
virtualinherited

print

References null.

void CORE_Object::print ( const int &  str)
virtualinherited

print

References null.

static ostream& CORE_Object::print ( ostream &  out,
const tString message 
)
inlinestaticinherited

print the class

void CORE_Object::printObjectsInMemory ( )
staticinherited

print object in memory

References CORE_Object::getClassName(), CORE_Object::getSharedPointer(), and CORE_Object::mIsMemoryTesting.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

void MATH_Variable::setFirstIndex ( const int &  index)
inline
static void CORE_Object::setOutput ( ostream &  out)
inlinestaticinherited

set output

tBoolean MATH_Variable::setSize ( const int &  n)
void MATH_Variable::setStartIndex ( const int &  index)
inline

set the start index

References setSize().

Referenced by MATH_DivideOperator::evaluate(), MATH_ModuloOperator::evaluate(), and MATH_MultiplyOperator::evaluate().

Here is the call graph for this function:

Here is the caller graph for this function:

void CORE_Object::setThis ( SP::CORE_Object  p)
inlineprotectedinherited

set this weak shared pointer called toDoAfterThis setting method

References CORE_Object::toDoAfterThisSetting().

Here is the call graph for this function:

virtual void CORE_Object::setType ( tString  type)
inlineprotectedvirtualinherited
void MATH_Variable::setType ( const tFlag type)
inline
void MATH_Variable::setValue ( const int &  index,
const double &  v 
)
inline

set the value

References setSize().

Referenced by MATH_Environment::getVariable().

Here is the call graph for this function:

Here is the caller graph for this function:

void MATH_Variable::setValue ( const tString symbol)

set the value

References BOOLEAN, CORE_Real::parseReal(), REAL, setSize(), STRING, and tString.

Here is the call graph for this function:

void MATH_Variable::setValue ( const double &  v)
inline

set the value

References REAL, and setSize().

Here is the call graph for this function:

void MATH_Variable::setValue ( const double *  v,
const int &  n 
)
inline

set the value

References REAL, and setSize().

Here is the call graph for this function:

void MATH_Variable::setValue ( const long double *  v,
const int &  n 
)
inline

set the value

References REAL, and setSize().

Here is the call graph for this function:

void MATH_Variable::setValue ( const int &  v)
inline

set the value

References INTEGER, and setSize().

Here is the call graph for this function:

void MATH_Variable::setValue ( const int *  v,
const int &  n 
)
inline

set the value

References INTEGER, and setSize().

Here is the call graph for this function:

void MATH_Variable::setValue ( const tBoolean v)
inline

set the value

References BOOLEAN, and setSize().

Here is the call graph for this function:

static tBoolean MATH_Variable::toBoolean ( const double &  v)
inlinestatic

to boolean

References tBoolean, and toInteger().

Referenced by MATH_AndOperator::evaluate(), and MATH_OrOperator::evaluate().

Here is the call graph for this function:

Here is the caller graph for this function:

virtual void CORE_Object::toDoAfterThisSetting ( )
inlineprotectedvirtualinherited
static int MATH_Variable::toInteger ( const double &  v)
inlinestatic

to int

Referenced by MATH_AndBitwiseOperator::evaluate(), MATH_XorBitwiseOperator::evaluate(), MATH_OrBitwiseOperator::evaluate(), and toBoolean().

Here is the caller graph for this function:

tString MATH_Variable::toString ( ) const
virtual

print the environment class in a string

Reimplemented from CORE_Object.

References getSize(), CORE_Real::toString(), and tString.

Here is the call graph for this function:

Member Data Documentation

const tFlag MATH_Variable::BOOLEAN =3
static
const tFlag MATH_Variable::BOUND_POINT ={0,1,2}
static
const tFlag MATH_Variable::BOUND_SIZE ={3,4,5}
static
const tFlag MATH_Variable::INTEGER =2
static
tBoolean CORE_Object::mIsMemoryTesting =false
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().

const tFlag MATH_Variable::REAL =1
static
const tFlag MATH_Variable::STRING =4
static
const tFlag MATH_Variable::UNDEFINED =0
static

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