Class funct_string (o2scl)¶
-
class funct_string¶
One-dimensional function from a string.
For example,
will print out the area of circles having radii between 1 and 2.funct_string f("pi*r^2","r"); f.set_parm("pi",o2scl_const::pi); for(double r=1.0;r<=2.0;r+=0.1) { cout << f(x) << endl; }
Public Functions
-
inline funct_string(std::string expr, std::string var)¶
Specify the string and the parameters.
-
inline virtual ~funct_string()¶
-
inline int set_function(std::string expr, std::string var)¶
Specify the string and the parameters.
-
inline int set_parm(std::string name, double val)¶
Set the values of the auxilliary parameters that were specified in
parms
in the constructor.
-
inline virtual double operator()(double x) const¶
Compute the function at point
x
and return the result.
Protected Functions
-
inline funct_string()¶
-
inline funct_string(std::string expr, std::string var)¶