23 #ifndef O2SCL_MULTI_FUNCT_H 24 #define O2SCL_MULTI_FUNCT_H 33 #include <boost/numeric/ublas/vector.hpp> 35 #include <o2scl/err_hnd.h> 36 #include <o2scl/shunting_yard.h> 38 #ifndef DOXYGEN_NO_O2NS 43 typedef std::function<
55 template<
class vec_
string_t=std::vector<std::
string> >
57 vec_string_t &var_arr) {
62 for (
int i=0;i<nv;i++) {
70 template<
class vec_
string_t=std::vector<std::
string> >
71 void set_function(std::string expr,
int nv, vec_string_t &var_arr) {
76 for (
int i=0;i<nv;i++) {
97 template<
class vec_t=boost::numeric::ublas::vector<
double> >
100 for(
int i=0;i<nv;i++) {
107 #ifndef DOXYGEN_INTERNAL 115 std::map<std::string,double>
vars;
128 #ifndef DOXYGEN_NO_O2NS 140 #ifndef DOXYGEN_NO_O2NS The main O<span style='position: relative; top: 0.3em; font-size: 0.8em'>2</span>scl O$_2$scl names...
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.
A multi-dimensional function from a string.
int st_nv
The number of variables.
multi_funct11_strings(std::string expr, int nv, vec_string_t &var_arr)
Specify the string and the parameters.
int set_parm(std::string name, double val)
Set the values of the auxilliary parameters that were specified in parms in the constructor.
void set_function(std::string expr, int nv, vec_string_t &var_arr)
Specify the string and the parameters.
double operator()(size_t nv, const vec_t &x)
Compute a function y of nv variables stored in x with parameter pa.
double eval(std::map< std::string, double > *vars=0)
Evalate the previously compiled expression using variables specified in vars.
std::string st_funct
The function string.
Evaluate a mathematical expression in a string.
std::map< std::string, double > vars
External variables to include in the function parsing.
std::vector< std::string > st_vars
The variable string.
calculator calc
The function parser.
std::function< double(size_t, const boost::numeric::ublas::vector< double > &)> multi_funct11
Multi-dimensional function typedef.