#include <compute.h>

Public Types | |
| enum | TYPE_VARIABLE { TYPE_X, TYPE_Y, TYPE_Z } |
Public Member Functions | |
| virtual CValue * | GetCopy () const =0 |
| virtual float | Compute (const CVector3f &) const =0 |
| virtual CValue * | Derive (TYPE_VARIABLE Type) const =0 |
| virtual void | Print (std::ostream &) const =0 |
| virtual void | Compile (std::vector< char > &v, int &i) const =0 |
| virtual | ~CValue () |
| virtual bool | IsConstant (float *pNumber=NULL) const |
Static Public Member Functions | |
| static CValue * | GetNewAddition (CValue *pLeftOperand, CValue *pRightOperand) |
| static CValue * | GetNewSubstraction (CValue *pLeftOperand, CValue *pRightOperand) |
| static CValue * | GetNewProduct (CValue *pLeftOperand, CValue *pRightOperand) |
| static CValue * | GetNewDivision (CValue *pLeftOperand, CValue *pRightOperand) |
| static CValue * | GetNewOpposite (CValue *pLeftOperand) |
| static CValue * | GetNewSqrt (CValue *pLeftOperand) |
| static CValue * | GetNewSin (CValue *pLeftOperand) |
| static CValue * | GetNewCos (CValue *pLeftOperand) |
| static CValue * | GetNewTan (CValue *pLeftOperand) |
| static CValue * | GetNewExp (CValue *pLeftOperand) |
| static CValue * | GetNewLn (CValue *pLeftOperand) |
| static CValue * | GetNewPow (CValue *pLeftOperand, CValue *pRightOperand) |
Protected Member Functions | |
| virtual bool | IsMultAbsorbElem () const |
| virtual bool | IsMultNeutralElem () const |
| virtual bool | IsAddNeutralElem () const |
By containing pointers to other CValue objects, it helps building a tree representing a mathematical expression.
Definition at line 34 of file compute.h.
| virtual CValue::~CValue | ( | ) | [inline, virtual] |
| virtual CValue* CValue::GetCopy | ( | ) | const [pure virtual] |
This pure virtual function returns a copy of the tree represented by this object.
Implemented in COperation, CAddition, CSubstraction, CProduct, CDivision, COpposite, CSqrt, CSin, CCos, CTan, CExp, CLn, CPow, CVariable, and CNumber.
Referenced by CMathExpression::CMathExpression(), CLn::Derive(), CPow::Derive(), CExp::Derive(), CTan::Derive(), CCos::Derive(), CSin::Derive(), CSqrt::Derive(), CDivision::Derive(), CProduct::Derive(), CPow::GetCopy(), CLn::GetCopy(), CExp::GetCopy(), CTan::GetCopy(), CCos::GetCopy(), CSin::GetCopy(), CSqrt::GetCopy(), COpposite::GetCopy(), CDivision::GetCopy(), CProduct::GetCopy(), CSubstraction::GetCopy(), CAddition::GetCopy(), and CMathExpression::operator=().
| virtual float CValue::Compute | ( | const CVector3f & | ) | const [pure virtual] |
This pure virtual function returns the numerical value of the CValue object.
Implemented in COperation, CAddition, CSubstraction, CProduct, CDivision, COpposite, CSqrt, CSin, CCos, CTan, CExp, CLn, CPow, CVariable, and CNumber.
Referenced by CPow::Compute(), CLn::Compute(), CExp::Compute(), CTan::Compute(), CCos::Compute(), CSin::Compute(), CSqrt::Compute(), COpposite::Compute(), CDivision::Compute(), CProduct::Compute(), CSubstraction::Compute(), CAddition::Compute(), and CMathExpression::GetValue().
| virtual CValue* CValue::Derive | ( | TYPE_VARIABLE | Type | ) | const [pure virtual] |
This pure virtual function returns a newly allocated pointer to the CValue object representing the derivative of the object.
Implemented in COperation, CAddition, CSubstraction, CProduct, CDivision, COpposite, CSqrt, CSin, CCos, CTan, CExp, CLn, CPow, CVariable, and CNumber.
Referenced by CLn::Derive(), CPow::Derive(), CExp::Derive(), CTan::Derive(), CCos::Derive(), CSin::Derive(), CSqrt::Derive(), COpposite::Derive(), CDivision::Derive(), CProduct::Derive(), CSubstraction::Derive(), CAddition::Derive(), and CMathExpression::GetDerivative().
| virtual void CValue::Print | ( | std::ostream & | ) | const [pure virtual] |
This pure virtual function fills the stream with the expression of the CValue object.
Implemented in COperation, CAddition, CSubstraction, CProduct, CDivision, COpposite, CSqrt, CSin, CCos, CTan, CExp, CLn, CPow, CVariable, and CNumber.
Referenced by CMathExpression::GetString(), CPow::Print(), CLn::Print(), CExp::Print(), CTan::Print(), CCos::Print(), CSin::Print(), CSqrt::Print(), COpposite::Print(), CDivision::Print(), CProduct::Print(), CSubstraction::Print(), CAddition::Print(), and CMathExpression::Print().
| virtual void CValue::Compile | ( | std::vector< char > & | v, | |
| int & | i | |||
| ) | const [pure virtual] |
This pure virtual function fills the vector with code to compute the formula.
Implemented in COperation, CAddition, CSubstraction, CProduct, CDivision, COpposite, CSqrt, CSin, CCos, CTan, CExp, CLn, CPow, CVariable, and CNumber.
Referenced by CPow::Compile(), CLn::Compile(), CExp::Compile(), CTan::Compile(), CCos::Compile(), CSin::Compile(), CSqrt::Compile(), COpposite::Compile(), CDivision::Compile(), CProduct::Compile(), CSubstraction::Compile(), CAddition::Compile(), and CMathExpression::Compile().
| virtual bool CValue::IsConstant | ( | float * | pNumber = NULL |
) | const [inline, virtual] |
This function is used to know if the object can be evaluated to a constant. It is overloaded only in the CNumber class, where Number is set to the value of the object.
Reimplemented in CNumber.
Definition at line 97 of file compute.h.
Referenced by CPow::Compile(), CPow::Derive(), GetNewAddition(), GetNewCos(), GetNewDivision(), GetNewExp(), GetNewLn(), GetNewOpposite(), GetNewPow(), GetNewProduct(), GetNewSin(), GetNewSqrt(), GetNewSubstraction(), and GetNewTan().
| virtual bool CValue::IsMultAbsorbElem | ( | ) | const [inline, protected, virtual] |
This function is used to know if the object is the absorbing element of the multiplication, which is 0. It is overloaded only in the CNumber class.
Reimplemented in CNumber.
Definition at line 106 of file compute.h.
Referenced by GetNewDivision(), GetNewPow(), and GetNewProduct().
| virtual bool CValue::IsMultNeutralElem | ( | ) | const [inline, protected, virtual] |
This function is used to know if the object is the neutral element of the multiplication, which is 1. It is overloaded only in the CNumber class.
Reimplemented in CNumber.
Definition at line 113 of file compute.h.
Referenced by GetNewDivision(), GetNewPow(), and GetNewProduct().
| virtual bool CValue::IsAddNeutralElem | ( | ) | const [inline, protected, virtual] |
This function is used to know if the object is the neutral element of the addition, which is 0. It is overloaded only in the CNumber class.
Reimplemented in CNumber.
Definition at line 120 of file compute.h.
Referenced by GetNewAddition(), and GetNewSubstraction().
1.5.4