Commit a3128bf4 authored by Albert Astals Cid's avatar Albert Astals Cid

erf and erfc implementation by Gregory LEGRAIN

CCMAIL: gregory.legrain@crans.org

svn path=/trunk/KDE/kdeedu/kmplot/; revision=877564
parent d06ed0db
......@@ -105,6 +105,8 @@ ScalarFunction Parser::scalarFunctions[ ScalarCount ]=
{"gamma", 0, tgamma}, // gamma function
{"lgamma", 0, lgamma}, // log-gamma function
{"factorial", 0, factorial}, // factorial
{"erfc", 0, lerfc}, // error function
{"erf", 0, lerf}, // complementary error function
// legendre
{"P_0", 0, legendre0}, // lengedre polynomial (n=0)
......@@ -1415,6 +1417,15 @@ double mod( const Vector & args )
return std::sqrt( squared );
}
double lerf(double x) {
return erf(x);
}
double lerfc(double x) {
return erfc(x);
}
//END predefined mathematical functions
......
......@@ -85,7 +85,7 @@ enum Token
const int legendreCount = 7; // number of legendre polynomials we allow for
const int ScalarCount = 38+legendreCount; // number of mathematical scalar functions
const int ScalarCount = 40+legendreCount; // number of mathematical scalar functions
const int VectorCount = 3; // number of vector functions
//@}
......@@ -126,6 +126,8 @@ double legendre5(double x);
double legendre6(double x);
double factorial(double x);
double lerf(double x);
double lerfc(double x);
/** Predefined mathematical functions with an indefinite number of variables. */
double min( const Vector & x );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment