manpagez: man pages & more
info mathgl_en
Home | html | info | man
[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.12 Evaluate expression

MathGL have a special class mglExpr for evaluating of formula specified by the string. This class is defined in #include <mgl2/mgl.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.

Constructor on mglExpr: mglExpr (const char *expr)
C function: HMEX mgl_create_expr (const char *expr)

Parses the formula expr 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() or CalcD() functions.

Destructor on mglExpr: ~mglExpr ()
C function: HMEX mgl_delete_expr (HMEX ex)

Deletes the instance of class mglExpr.

Method on mglExpr: float Eval (float x, float y, float z)
C function: float mgl_expr_eval (HMEX ex, float x, float y, float z)

Evaluates the formula for 'x','r'=x, 'y','n'=y, 'z','t'=z, 'a','u'=u.

Method on mglExpr: float Eval (float var[26])
C function: float mgl_expr_eval_v (HMEX ex, float *var)

Evaluates the formula for variables in array var[0,...,’z’-’a’].

Method on mglExpr: float Diff (char dir, float x, float y, float z)
C function: float mgl_expr_diff (HMEX ex, char dir, float x, float y, float z)

Evaluates the formula derivation respect to dir for 'x','r'=x, 'y','n'=y, 'z','t'=z, 'a','u'=u.

Method on mglExpr: float Diff (char dir, float var[26])
C function: float mgl_expr_diff_v (HMEX ex, char dir, float *var)

Evaluates the formula derivation respect to dir for variables in array var[0,...,’z’-’a’].


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated on April 13, 2012 using texi2html 5.0.

© manpagez.com 2000-2024
Individual documents may contain additional copyright information.