FEDEM Solver  R8.0
Source code of the dynamics solver
Public Types | Public Member Functions | Public Attributes | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
FFaMathExpr Class Reference

#include <FFaMathExpr.H>

Collaboration diagram for FFaMathExpr:
Collaboration graph
[legend]

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...
 
FFaMathExproperator= (const FFaMathExpr &)
 Overloaded copy assignment operator. More...
 
FFaMathExproperator= (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
 
FFaMathExprmmb1
 
FFaMathExprmmb2
 
FFaMathFunctionpfunc
 

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

DoublePtRefFuncTypepinstr
 
double ** pvals
 
double * ppile
 
FFaMathFunction ** pfuncpile
 
bool containfuncflag
 
double ValC
 
const FFaMathVarpvar
 

Member Typedef Documentation

◆ DoublePtRefFuncType

typedef void(* FFaMathExpr::DoublePtRefFuncType) (double *&)
private

Member Enumeration Documentation

◆ ROperator

Enumerator
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 

Constructor & Destructor Documentation

◆ FFaMathExpr() [1/6]

FFaMathExpr::FFaMathExpr ( )

Default constructor of class FFaMathExpr.

◆ FFaMathExpr() [2/6]

FFaMathExpr::FFaMathExpr ( double  x)

Constructor of class FFaMathExpr from a double value.

Parameters
[in]xThe double value this expression should evaluate to

◆ FFaMathExpr() [3/6]

FFaMathExpr::FFaMathExpr ( const FFaMathExpr ROp)

Copy constructor of class FFaMathExpr.

Parameters
[in]ROpObject of type FFaMathExpr

◆ FFaMathExpr() [4/6]

FFaMathExpr::FFaMathExpr ( const FFaMathExpr &&  ROp)

Move constructor of class FFaMathExpr.

Parameters
[in]ROpObject of type FFaMathExpr

◆ FFaMathExpr() [5/6]

FFaMathExpr::FFaMathExpr ( const FFaMathVar varp)

Constructor of class FFaMathExpr from a FFaMathVar object.

Parameters
[in]varpObject of type FFaMathVar

◆ FFaMathExpr() [6/6]

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.

Parameters
[in]spAn expression string
[in]nvarpvariable index
ppvarpobject of type FFaMathVar
[in]nfuncpfunction index
ppfuncpobject of type FFaMathFunction

◆ ~FFaMathExpr()

FFaMathExpr::~FFaMathExpr ( )

Destructor of class FFaMathExpr.

Member Function Documentation

◆ BCDouble()

void FFaMathExpr::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 
)
staticprivate

Sets a lot of parameters when the function has two operands.

◆ BCFun()

void FFaMathExpr::BCFun ( DoublePtRefFuncType *&  pf,
DoublePtRefFuncType pf1,
double **&  pv,
double **  pv1,
double *&  pp,
double *  pp1,
FFaMathFunction **&  prf,
FFaMathFunction **  prf1,
FFaMathFunction rf 
)
staticprivate

Sets a lot of parameters when the operation is a function.

◆ BCSimple()

void FFaMathExpr::BCSimple ( DoublePtRefFuncType *&  pf,
DoublePtRefFuncType pf1,
double **&  pv,
double **  pv1,
double *&  pp,
double *  pp1,
FFaMathFunction **&  prf,
FFaMathFunction **  prf1,
DoublePtRefFuncType  f 
)
staticprivate

Sets a lot of parameters when the function has two operands.

◆ BuildCode()

void FFaMathExpr::BuildCode ( )
private

Builds a tree of variables, numbers, operations and functions.

◆ ContainFunc()

bool FFaMathExpr::ContainFunc ( const FFaMathFunction func) const
private

Recursive check for a sub-function.

Parameters
[in]funcThe FFaMathFunction object to check for

◆ ContainFuncNoRec()

bool FFaMathExpr::ContainFuncNoRec ( const FFaMathFunction func) const
private

Checks if the operation is a sub-function.

Parameters
[in]funcThe FFaMathFunction object to check for

◆ ContainVar()

bool FFaMathExpr::ContainVar ( const FFaMathVar varp) const
private

Checks for a variable in the expression.

Parameters
[in]varpThe FFaMathVar object to check for existance of

◆ Destroy()

void FFaMathExpr::Destroy ( )
private

Destructor of class FFaMathExpr.

◆ Diff()

FFaMathExpr FFaMathExpr::Diff ( const FFaMathVar var) const

Differentiate the expression.

Parameters
[in]varThe FFaMathVar object to differentiate with respect to
Returns
A tree of objects of the differentiated expression

◆ HasError()

bool FFaMathExpr::HasError ( const FFaMathExpr pop = 0) const

Checks if this expression contains errors.

◆ Init()

void FFaMathExpr::Init ( )
private

Initializes all members to zero.

Used by the constructors only.

◆ NMembers()

int FFaMathExpr::NMembers ( ) const
private

Returns the number of members of an operation.

◆ NthMember()

FFaMathExpr FFaMathExpr::NthMember ( int  n) const
private

Returns the n'th member of an operation.

Parameters
[in]nIndex of the member to return

◆ operator!=()

bool FFaMathExpr::operator!= ( const FFaMathExpr op2) const

Overloaded not-equal-to operator.

Parameters
[in]op2The FFaMathExpr object to compare with

◆ operator*()

FFaMathExpr FFaMathExpr::operator* ( const FFaMathExpr op2) const

Overload multiplication operator.

Parameters
[in]op2The FFaMathExpr object to multiply this one with

◆ operator+() [1/2]

FFaMathExpr FFaMathExpr::operator+ ( ) const
inline

◆ operator+() [2/2]

FFaMathExpr FFaMathExpr::operator+ ( const FFaMathExpr op2) const

Overload addition operator.

Parameters
[in]op2The FFaMathExpr object to add to this one.

◆ operator-() [1/2]

FFaMathExpr FFaMathExpr::operator- ( ) const

Overloaded negation operator.

◆ operator-() [2/2]

FFaMathExpr FFaMathExpr::operator- ( const FFaMathExpr op2) const

Overloaded subtraction operator.

Parameters
[in]op2The FFaMathExpr object to subtract from this one

◆ operator/()

FFaMathExpr FFaMathExpr::operator/ ( const FFaMathExpr op2) const

Overloaded division operator.

Parameters
[in]op2The FFaMathExpr object to divide this one with

◆ operator=() [1/2]

FFaMathExpr & FFaMathExpr::operator= ( const FFaMathExpr &&  ROp)

Overloaded move assignment operator.

Parameters
[in]ROpObject of type FFaMathExpr

◆ operator=() [2/2]

FFaMathExpr & FFaMathExpr::operator= ( const FFaMathExpr ROp)

Overloaded copy assignment operator.

Parameters
[in]ROpObject of type FFaMathExpr

◆ operator==() [1/2]

bool FFaMathExpr::operator== ( const double  v) const

Overloaded equal-to operator for double values.

Parameters
[in]vThe double value to compare with

◆ operator==() [2/2]

bool FFaMathExpr::operator== ( const FFaMathExpr op2) const

Overloaded equal-to operator.

Parameters
[in]op2The FFaMathExpr object to compare with

◆ operator^()

FFaMathExpr FFaMathExpr::operator^ ( const FFaMathExpr op2) const

Overloaded power operator.

Parameters
op2The FFaMathExpr object to raise this one with

◆ Substitute()

FFaMathExpr FFaMathExpr::Substitute ( const FFaMathVar var,
const FFaMathExpr rop 
) const
private

Replaces the variable var with the expression rop.

Parameters
[in]varThe variable to be replaced
[in]ropThe expression to be inserted in place of the variable

◆ Val()

double FFaMathExpr::Val ( ) const

Returns the value of the total expression.

Member Data Documentation

◆ containfuncflag

bool FFaMathExpr::containfuncflag
mutableprivate

◆ mmb1

FFaMathExpr* FFaMathExpr::mmb1

◆ mmb2

FFaMathExpr * FFaMathExpr::mmb2

◆ op

ROperator FFaMathExpr::op

◆ pfunc

FFaMathFunction* FFaMathExpr::pfunc

◆ pfuncpile

FFaMathFunction** FFaMathExpr::pfuncpile
private

◆ pinstr

DoublePtRefFuncType* FFaMathExpr::pinstr
private

◆ ppile

double* FFaMathExpr::ppile
private

◆ pvals

double** FFaMathExpr::pvals
private

◆ pvar

const FFaMathVar* FFaMathExpr::pvar
private

◆ ValC

double FFaMathExpr::ValC
private

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