8 #ifndef FFA_MATH_EXPR_H
9 #define FFA_MATH_EXPR_H
29 ErrOp,
Juxt,
Num,
Var,
Add,
Sub,
Opp,
Mult,
Div,
Mod,
Max,
Min,
Pow,
Sqrt,
30 NthRoot,
Abs,
Sin,
Cos,
Tg,
Log,
Ln,
Exp,
Acos,
Asin,
Atan,
E10,
128 double Val(
double*)
const;
Definition: FFaMathExpr.H:16
bool ContainVar(const FFaMathVar &) const
Checks for a variable in the expression.
Definition: FFaMathExpr.C:948
void(* DoublePtRefFuncType)(double *&)
Definition: FFaMathExpr.H:17
FFaMathFunction * pfunc
Definition: FFaMathExpr.H:39
void Init()
Initializes all members to zero.
Definition: FFaMathExpr.C:24
ROperator op
Definition: FFaMathExpr.H:36
bool operator==(const double v) const
Overloaded equal-to operator for double values.
Definition: FFaMathExpr.C:200
bool operator!=(const FFaMathExpr &) const
Overloaded not-equal-to operator.
Definition: FFaMathExpr.C:245
FFaMathExpr * mmb1
Definition: FFaMathExpr.H:38
int NMembers() const
Returns the number of members of an operation.
Definition: FFaMathExpr.C:1037
ROperator
Definition: FFaMathExpr.H:28
@ Opp
Definition: FFaMathExpr.H:29
@ Add
Definition: FFaMathExpr.H:29
@ Sqrt
Definition: FFaMathExpr.H:29
@ LogicalNotEqual
Definition: FFaMathExpr.H:32
@ LogicalOr
Definition: FFaMathExpr.H:31
@ Min
Definition: FFaMathExpr.H:29
@ Exp
Definition: FFaMathExpr.H:30
@ Acos
Definition: FFaMathExpr.H:30
@ Sin
Definition: FFaMathExpr.H:30
@ LogicalGreater
Definition: FFaMathExpr.H:31
@ Fun
Definition: FFaMathExpr.H:33
@ LogicalGreaterOrEqual
Definition: FFaMathExpr.H:33
@ Tg
Definition: FFaMathExpr.H:30
@ Num
Definition: FFaMathExpr.H:29
@ Mult
Definition: FFaMathExpr.H:29
@ LogicalLessOrEqual
Definition: FFaMathExpr.H:33
@ NthRoot
Definition: FFaMathExpr.H:30
@ LogicalNot
Definition: FFaMathExpr.H:33
@ Pow
Definition: FFaMathExpr.H:29
@ Ln
Definition: FFaMathExpr.H:30
@ Max
Definition: FFaMathExpr.H:29
@ E10
Definition: FFaMathExpr.H:30
@ Asin
Definition: FFaMathExpr.H:30
@ LogicalLess
Definition: FFaMathExpr.H:31
@ Log
Definition: FFaMathExpr.H:30
@ LogicalAnd
Definition: FFaMathExpr.H:31
@ Var
Definition: FFaMathExpr.H:29
@ Sub
Definition: FFaMathExpr.H:29
@ Abs
Definition: FFaMathExpr.H:30
@ Div
Definition: FFaMathExpr.H:29
@ Mod
Definition: FFaMathExpr.H:29
@ LogicalEqual
Definition: FFaMathExpr.H:32
@ ErrOp
Definition: FFaMathExpr.H:29
@ Juxt
Definition: FFaMathExpr.H:29
@ Atan
Definition: FFaMathExpr.H:30
@ Cos
Definition: FFaMathExpr.H:30
bool ContainFuncNoRec(const FFaMathFunction &) const
Checks if the operation is a sub-function.
Definition: FFaMathExpr.C:967
double * ppile
Definition: FFaMathExpr.H:21
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.
Definition: FFaMathExpr.C:1258
FFaMathExpr Substitute(const FFaMathVar &, const FFaMathExpr &) const
Replaces the variable var with the expression rop.
Definition: FFaMathExpr.C:1087
void Destroy()
Destructor of class FFaMathExpr.
Definition: FFaMathExpr.C:902
double Val() const
Returns the value of the total expression.
Definition: FFaMathExpr.C:1228
double ** pvals
Definition: FFaMathExpr.H:20
FFaMathExpr operator-() const
Overloaded negation operator.
Definition: FFaMathExpr.C:279
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.
Definition: FFaMathExpr.C:1374
FFaMathFunction ** pfuncpile
Definition: FFaMathExpr.H:22
bool containfuncflag
Definition: FFaMathExpr.H:24
FFaMathExpr Diff(const FFaMathVar &) const
Differentiate the expression.
Definition: FFaMathExpr.C:1117
FFaMathExpr * mmb2
Definition: FFaMathExpr.H:38
bool HasError(const FFaMathExpr *=0) const
Checks if this expression contains errors.
Definition: FFaMathExpr.C:1011
FFaMathExpr operator/(const FFaMathExpr &) const
Overloaded division operator.
Definition: FFaMathExpr.C:392
FFaMathExpr NthMember(int) const
Returns the n'th member of an operation.
Definition: FFaMathExpr.C:1055
FFaMathExpr & operator=(const FFaMathExpr &)
Overloaded copy assignment operator.
Definition: FFaMathExpr.C:145
void BuildCode()
Builds a tree of variables, numbers, operations and functions.
Definition: FFaMathExpr.C:1421
double ValC
Definition: FFaMathExpr.H:42
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.
Definition: FFaMathExpr.C:1326
FFaMathExpr()
Default constructor of class FFaMathExpr.
Definition: FFaMathExpr.C:43
bool ContainFunc(const FFaMathFunction &) const
Recursive check for a sub-function.
Definition: FFaMathExpr.C:986
FFaMathExpr operator^(const FFaMathExpr &) const
Overloaded power operator.
Definition: FFaMathExpr.C:425
DoublePtRefFuncType * pinstr
Definition: FFaMathExpr.H:19
~FFaMathExpr()
Destructor of class FFaMathExpr.
Definition: FFaMathExpr.C:53
FFaMathExpr operator*(const FFaMathExpr &) const
Overload multiplication operator.
Definition: FFaMathExpr.C:359
const FFaMathVar * pvar
Definition: FFaMathExpr.H:43
FFaMathExpr operator+() const
Definition: FFaMathExpr.H:89
Definition: FFaMathExpr.H:104
int nvars
Definition: FFaMathExpr.H:113
signed char type
Definition: FFaMathExpr.H:111
double * buf
Definition: FFaMathExpr.H:105
double(* pfuncval)(double)
Definition: FFaMathExpr.H:108
FFaMathFunction(const FFaMathFunction &)=delete
FFaMathFunction()
An object of type FFaMathFunction is created. Constructor.
Definition: FFaMathFunction.C:19
bool operator==(const FFaMathFunction &) const
Overloaded equal-to operator.
Definition: FFaMathFunction.C:165
char * name
Definition: FFaMathExpr.H:110
~FFaMathFunction()
Destructor.
Definition: FFaMathFunction.C:97
double Val(double *) const
Returns the function value.
Definition: FFaMathFunction.C:127
FFaMathVar ** ppvar
Definition: FFaMathExpr.H:114
FFaMathFunction & operator=(const FFaMathFunction &)=delete
void SetName(const char *)
Sets the name of the function.
Definition: FFaMathFunction.C:114
FFaMathExpr operator()(const FFaMathExpr &)
Definition: FFaMathFunction.C:151
FFaMathExpr op
Definition: FFaMathExpr.H:112
Definition: FFaMathVar.H:15
integer, parameter sp
4-byte real (single)
Definition: kindModule.f90:25