|
Awards |
It's a fast equation parser/evaluator with parse-tree builder and
user-friendly interface for parsing and evaluation a run-time
defined string as a math expression.
The math expressions is represented as string in a function
style
F(x1, x2,..., xn) =f(x1, x2,..., xn)
, where
F(x1, x2,..., xn) - declares number
and names of the variables;
f(x1, x2,..., xn) - math expression may contain:
For example:
F(x, y) = 3*iif(x>y, x^2,y^2)+e/4,
F(x1, x2, y) = (x1-sin(x2))/y,
F() = 5+6+pi.
The algorithm, which is used here, has been developed and implemented by Easy Math Solution as managed and unmanaged components. The unmanaged implementation is represented in static and dynamic library (both as procedural and object oriented) and works with either ANSI or UNICODE string. It allows to use EquTranslator in any languagies (C/C++, Delphi, VB, C#,..) and systems that knows how to comunicate with dll or .NET platform.
The main characteristics of EquTranslator are:
One of the major enhancement and attractive value of EquTranslator algorithm is speed. This essential feature, that already has deserved recognition of our clients, gives you competitive advantage and power to make your application more efficient. On computer AMD AthlonTM 2000 XP EquTranslator is getting result of
, |
TCalc EvaluateEqu(const char *mathFunc, const double*args ); TCalc Evaluate(const char *varList, const char *mathExp, const double *args ); void BuildEqu(const char * mathFunc); void Build(const char *varList, const char *mathExp,); TCalc CalcFor(const double *args); bool AddFunction(const char*funName, const double (__stdcall*)(const double&)); bool RemoveFunction(const char*funName); bool AddConst(const char*constName, double constVal); bool RemoveConst(const char*constName); ...
double arg[]={5.1, 3};
double res;
res=EvaluateEqu("F(x,y)=sin(x)+3*y^2+(x+y)", arg); or
double arg[]={5.1, 3};
EquTranslator equTr;
double res=equTr.Evaluate("x,y", "sin(x)+3*y^2+(x+y)", arg);
double arg[]={5.1, 3, -1.8, 11.7, 10001};
double res;
BuildEqu("F(x1,x2,x3,x4,x5)=x1+sin(x2)/x3+5*x4+cos(x5)");
res=CalcFor(arg);
double arg[]={5.1, 3, -0.3};
double res;
try{
Build("x,y,z", "sin(x)+cos(y)^2-z");
res=CalcFor(arg);
}
catch(EquException &e) {
std::cout<< e.what();
}
double arg[]={5.1, 3, -0.3};
double res;
TCHAR *mathF=_T("F(x,y,z)=sin(x)+cos(y)^2-z");
res=EvaluateEqu(mathF, arg);
//User defined function
const double __stdcall toRad(const double& x)
{
return x*3.14/180;
}
int main(int argc, char* argv[])
{
double arg[] = {2, 5.6, -11};
double two_pi = 2*3.14;
double res;
char *mathF="F(x,y,z)=3*x^2-y^2+sin(toRad(45))/4+two_pi";
AddFunction("toRad", toRad);
AddConst("twoPi", two_pi);
BuildEqu(mathF);
res = CalcFor(arg);
For details, please read the Adobe Acrobat format document.
|
EquTranslator Documentation |
Feel free, try DEMO version of EquTranslator and check it out if your calculation algorithm needs some improvements. The zip file also includes MS Word format manual and sample projects for VC++, C++Builder, Delphi, VB, C# and VB.NET.
| EquTranslator.zip |
For price and licenses, please check : Price&Conditions
Please, review our web site www.e-MathSolution.com regularly for new products and services. For more information, please contact us at: info@e-MathSolution.com
| EquTranslator Awards |
math parser string arithmetic equation formula function expression scientific evaluator evaluate calculate parse c c++ "c/c++" source delphi vb net c# interpretator programming statistics science computation calculator engineering solver fast component dll