33 #include <gsl/gsl_math.h> 35 #include <boost/numeric/ublas/vector.hpp> 37 #include <o2scl/shunting_yard.h> 39 #ifndef DOXYGEN_NO_O2NS 44 typedef std::function<double(double)>
funct;
102 #ifndef DOXYGEN_INTERNAL 110 mutable std::map<std::string,double>
vars;
120 #ifndef DOXYGEN_NO_O2NS 140 funct *fp=(funct *)params;
148 function=&funct_wrap;
155 #ifndef DOXYGEN_NO_O2NS virtual double operator()(double x) const
Compute the function at point x and return the result.
calculator calc
The object for evaluating strings.
The main O<span style='position: relative; top: 0.3em; font-size: 0.8em'>2</span>scl O$_2$scl names...
funct_gsl(funct &f)
Create an object based on the specified function, f.
void compile(const char *expr, std::map< std::string, double > *vars=0, bool debug=false, std::map< std::string, int > opPrec=opPrecedence)
Compile expression expr using variables specified in vars.
static double funct_wrap(double x, void *params)
The function wrapper.
One-dimensional function from a string.
funct_string(std::string expr, std::string var)
Specify the string and the parameters.
int set_function(std::string expr, std::string var)
Specify the string and the parameters.
A wrapper to specify o2scl::funct objects to GSL.
int set_parm(std::string name, double val)
Set the values of the auxilliary parameters that were specified in parms in the constructor.
std::string st_var
The variable.
double eval(std::map< std::string, double > *vars=0)
Evalate the previously compiled expression using variables specified in vars.
std::string st_form
The expr.
Evaluate a mathematical expression in a string.
std::function< double(double)> funct
One-dimensional function typedef.
std::map< std::string, double > vars
Parameter map.