| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
7.2 mglFormula class
Class for evaluating of formula specified by the string. This class is defined in #include <mgl/mgl_eval.h>.
It is the fast variant of formula evaluation. At creation it will be recognized and compiled to tree-like internal code. At evaluation stage only fast calculations are performed. There is no difference between lower or upper case in formulas. If argument value lie outside the range of function definition then function returns NaN. See section Textual formulas.
- Method on mglFormula:
mglFormula (const char *str) Parses the formula str and creates formula-tree. Constructor recursively parses the formula and creates a tree-like structure containing functions and operators for fast further evaluating by
Calc()orCalcD()functions.
- Method on mglFormula:
floatCalc (floatx,floaty=0,floatz=0,floatu=0) Evaluates the formula for
'x','r'=x,'y','n'=y,'z','t'=z,'a','u'=u. Error code (if one) can be obtained from functionGetError().
- Method on mglFormula:
floatCalc (floatx,floaty,floatz,floatu,floatv,floatw) Evaluates the formula for
'x'=x,'y'=y,'z'=z,'u'=u,'v'=v,'w'=w. Error code (if one) can be obtained from functionGetError().
- Method on mglFormula:
floatCalc (floatvar['z'-'a'+1]) Evaluates the formula for variables in array var[’z’-’a’]. Error code (if one) can be obtained from function
GetError().
- Method on mglFormula:
floatCalcD (floatvar['z'-'a'+1],chardiff) Evaluates the formula derivation respect to diff for variables in array var[’z’-’a’]. Error code (if one) can be obtained from function
GetError().
- Method on mglFormula:
intGetError () Returns error code:
0means no error;ERR_LOGmeans error in logarithm or power functions;ERR_ARCmeans error in inverse functions (like asin);ERR_SQRTmeans error in sqrt function.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
