FEDEM Solver
R8.0
Source code of the dynamics solver
|
#include <FFaMathExpr.H>
Public Types | |
enum | ROperator { ErrOp , Juxt , Num , Var , Add , Sub , Opp , Mult , Div , Mod , Max , Min , Pow , Sqrt , NthRoot , Abs , Sin , Cos , Tg , Log , Ln , Exp , Acos , Asin , Atan , E10 , LogicalLess , LogicalGreater , LogicalAnd , LogicalOr , LogicalNotEqual , LogicalEqual , LogicalLessOrEqual , LogicalGreaterOrEqual , LogicalNot , Fun } |
Public Member Functions | |
FFaMathExpr () | |
Default constructor of class FFaMathExpr. More... | |
FFaMathExpr (double) | |
Constructor of class FFaMathExpr from a double value. More... | |
FFaMathExpr (const FFaMathExpr &) | |
Copy constructor of class FFaMathExpr. More... | |
FFaMathExpr (const FFaMathExpr &&) | |
Move constructor of class FFaMathExpr. More... | |
FFaMathExpr (const FFaMathVar &) | |
Constructor of class FFaMathExpr from a FFaMathVar object. More... | |
FFaMathExpr (const char *sp, int nvarp=0, FFaMathVar **ppvarp=0, int nfuncp=0, FFaMathFunction **ppfuncp=0) | |
Constructor of class FFaMathExpr from a text string. More... | |
~FFaMathExpr () | |
Destructor of class FFaMathExpr. More... | |
bool | HasError (const FFaMathExpr *=0) const |
Checks if this expression contains errors. More... | |
FFaMathExpr & | operator= (const FFaMathExpr &) |
Overloaded copy assignment operator. More... | |
FFaMathExpr & | operator= (const FFaMathExpr &&) |
Overloaded move assignment operator. More... | |
bool | operator== (const double v) const |
Overloaded equal-to operator for double values. More... | |
bool | operator== (const FFaMathExpr &) const |
Overloaded equal-to operator. More... | |
bool | operator!= (const FFaMathExpr &) const |
Overloaded not-equal-to operator. More... | |
FFaMathExpr | operator+ () const |
FFaMathExpr | operator- () const |
Overloaded negation operator. More... | |
FFaMathExpr | operator+ (const FFaMathExpr &) const |
Overload addition operator. More... | |
FFaMathExpr | operator- (const FFaMathExpr &) const |
Overloaded subtraction operator. More... | |
FFaMathExpr | operator* (const FFaMathExpr &) const |
Overload multiplication operator. More... | |
FFaMathExpr | operator/ (const FFaMathExpr &) const |
Overloaded division operator. More... | |
FFaMathExpr | operator^ (const FFaMathExpr &) const |
Overloaded power operator. More... | |
double | Val () const |
Returns the value of the total expression. More... | |
FFaMathExpr | Diff (const FFaMathVar &) const |
Differentiate the expression. More... | |
Public Attributes | |
ROperator | op |
FFaMathExpr * | mmb1 |
FFaMathExpr * | mmb2 |
FFaMathFunction * | pfunc |
Private Types | |
typedef void(* | DoublePtRefFuncType) (double *&) |
Private Member Functions | |
bool | ContainVar (const FFaMathVar &) const |
Checks for a variable in the expression. More... | |
bool | ContainFunc (const FFaMathFunction &) const |
Recursive check for a sub-function. More... | |
bool | ContainFuncNoRec (const FFaMathFunction &) const |
Checks if the operation is a sub-function. More... | |
int | NMembers () const |
Returns the number of members of an operation. More... | |
FFaMathExpr | NthMember (int) const |
Returns the n'th member of an operation. More... | |
FFaMathExpr | Substitute (const FFaMathVar &, const FFaMathExpr &) const |
Replaces the variable var with the expression rop. More... | |
void | Init () |
Initializes all members to zero. More... | |
void | BuildCode () |
Builds a tree of variables, numbers, operations and functions. More... | |
void | Destroy () |
Destructor of class FFaMathExpr. More... | |
Static Private Member Functions | |
static void | BCDouble (DoublePtRefFuncType *&pf, DoublePtRefFuncType *pf1, DoublePtRefFuncType *pf2, double **&pv, double **pv1, double **pv2, double *&pp, double *pp1, double *pp2, FFaMathFunction **&prf, FFaMathFunction **prf1, FFaMathFunction **prf2, DoublePtRefFuncType f) |
Sets a lot of parameters when the function has two operands. More... | |
static void | BCSimple (DoublePtRefFuncType *&pf, DoublePtRefFuncType *pf1, double **&pv, double **pv1, double *&pp, double *pp1, FFaMathFunction **&prf, FFaMathFunction **prf1, DoublePtRefFuncType f) |
Sets a lot of parameters when the function has two operands. More... | |
static void | BCFun (DoublePtRefFuncType *&pf, DoublePtRefFuncType *pf1, double **&pv, double **pv1, double *&pp, double *pp1, FFaMathFunction **&prf, FFaMathFunction **prf1, FFaMathFunction *rf) |
Sets a lot of parameters when the operation is a function. More... | |
Private Attributes | |
DoublePtRefFuncType * | pinstr |
double ** | pvals |
double * | ppile |
FFaMathFunction ** | pfuncpile |
bool | containfuncflag |
double | ValC |
const FFaMathVar * | pvar |
|
private |
FFaMathExpr::FFaMathExpr | ( | ) |
Default constructor of class FFaMathExpr.
FFaMathExpr::FFaMathExpr | ( | double | x | ) |
Constructor of class FFaMathExpr from a double value.
[in] | x | The double value this expression should evaluate to |
FFaMathExpr::FFaMathExpr | ( | const FFaMathExpr & | ROp | ) |
Copy constructor of class FFaMathExpr.
[in] | ROp | Object of type FFaMathExpr |
FFaMathExpr::FFaMathExpr | ( | const FFaMathExpr && | ROp | ) |
Move constructor of class FFaMathExpr.
[in] | ROp | Object of type FFaMathExpr |
FFaMathExpr::FFaMathExpr | ( | const FFaMathVar & | varp | ) |
Constructor of class FFaMathExpr from a FFaMathVar object.
[in] | varp | Object of type FFaMathVar |
FFaMathExpr::FFaMathExpr | ( | const char * | sp, |
int | nvarp = 0 , |
||
FFaMathVar ** | ppvarp = 0 , |
||
int | nfuncp = 0 , |
||
FFaMathFunction ** | ppfuncp = 0 |
||
) |
Constructor of class FFaMathExpr from a text string.
[in] | sp | An expression string |
[in] | nvarp | variable index |
ppvarp | object of type FFaMathVar | |
[in] | nfuncp | function index |
ppfuncp | object of type FFaMathFunction |
FFaMathExpr::~FFaMathExpr | ( | ) |
Destructor of class FFaMathExpr.
|
staticprivate |
Sets a lot of parameters when the function has two operands.
|
staticprivate |
Sets a lot of parameters when the operation is a function.
|
staticprivate |
Sets a lot of parameters when the function has two operands.
|
private |
Builds a tree of variables, numbers, operations and functions.
|
private |
Recursive check for a sub-function.
[in] | func | The FFaMathFunction object to check for |
|
private |
Checks if the operation is a sub-function.
[in] | func | The FFaMathFunction object to check for |
|
private |
Checks for a variable in the expression.
[in] | varp | The FFaMathVar object to check for existance of |
|
private |
Destructor of class FFaMathExpr.
FFaMathExpr FFaMathExpr::Diff | ( | const FFaMathVar & | var | ) | const |
Differentiate the expression.
[in] | var | The FFaMathVar object to differentiate with respect to |
bool FFaMathExpr::HasError | ( | const FFaMathExpr * | pop = 0 | ) | const |
Checks if this expression contains errors.
|
private |
Initializes all members to zero.
Used by the constructors only.
|
private |
Returns the number of members of an operation.
|
private |
Returns the n'th member of an operation.
[in] | n | Index of the member to return |
bool FFaMathExpr::operator!= | ( | const FFaMathExpr & | op2 | ) | const |
Overloaded not-equal-to operator.
[in] | op2 | The FFaMathExpr object to compare with |
FFaMathExpr FFaMathExpr::operator* | ( | const FFaMathExpr & | op2 | ) | const |
Overload multiplication operator.
[in] | op2 | The FFaMathExpr object to multiply this one with |
|
inline |
FFaMathExpr FFaMathExpr::operator+ | ( | const FFaMathExpr & | op2 | ) | const |
Overload addition operator.
[in] | op2 | The FFaMathExpr object to add to this one. |
FFaMathExpr FFaMathExpr::operator- | ( | ) | const |
Overloaded negation operator.
FFaMathExpr FFaMathExpr::operator- | ( | const FFaMathExpr & | op2 | ) | const |
Overloaded subtraction operator.
[in] | op2 | The FFaMathExpr object to subtract from this one |
FFaMathExpr FFaMathExpr::operator/ | ( | const FFaMathExpr & | op2 | ) | const |
Overloaded division operator.
[in] | op2 | The FFaMathExpr object to divide this one with |
FFaMathExpr & FFaMathExpr::operator= | ( | const FFaMathExpr && | ROp | ) |
Overloaded move assignment operator.
[in] | ROp | Object of type FFaMathExpr |
FFaMathExpr & FFaMathExpr::operator= | ( | const FFaMathExpr & | ROp | ) |
Overloaded copy assignment operator.
[in] | ROp | Object of type FFaMathExpr |
bool FFaMathExpr::operator== | ( | const double | v | ) | const |
Overloaded equal-to operator for double values.
[in] | v | The double value to compare with |
bool FFaMathExpr::operator== | ( | const FFaMathExpr & | op2 | ) | const |
Overloaded equal-to operator.
[in] | op2 | The FFaMathExpr object to compare with |
FFaMathExpr FFaMathExpr::operator^ | ( | const FFaMathExpr & | op2 | ) | const |
Overloaded power operator.
op2 | The FFaMathExpr object to raise this one with |
|
private |
Replaces the variable var with the expression rop.
[in] | var | The variable to be replaced |
[in] | rop | The expression to be inserted in place of the variable |
double FFaMathExpr::Val | ( | ) | const |
Returns the value of the total expression.
|
mutableprivate |
FFaMathExpr* FFaMathExpr::mmb1 |
FFaMathExpr * FFaMathExpr::mmb2 |
ROperator FFaMathExpr::op |
FFaMathFunction* FFaMathExpr::pfunc |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |