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/fparser.h>
38 #ifndef DOXYGEN_NO_O2NS
43 typedef std::function<
49 template<
class vec_t=boost::numeric::ublas::vector<
double> >
57 int np=0, std::string parms=
"") {
60 fpw.Parse(formula,vars);
64 std::string all=vars+
","+parms;
65 fpw.Parse(formula,all);
78 int np=0, std::string parms=
"") {
81 fpw.Parse(formula,vars);
85 std::string all=vars+
","+parms;
86 fpw.Parse(formula,all);
107 for(
int i=0;i<
st_np;i++) {
123 for(i=0;i<
st_nv;i++) {
135 #ifndef DOXYGEN_INTERNAL
157 #ifndef DOXYGEN_NO_O2NS
169 #ifndef DOXYGEN_NO_O2NS
FunctionParser fpw
The object for evaluating strings.
Parse a mathematical function specified in a string.
double * arr
Storage for the parameters for fpw.
A multi-dimensional function from a string.
std::string st_vars
The variable string.
int set_function(std::string formula, int nv, std::string vars, int np=0, std::string parms="")
Specify the string and the parameters.
virtual double operator()(size_t nv, const vec_t &x)
Compute a function y of nv variables stored in x with parameter pa.
std::string st_parms
The parameter string.
int set_parms(const vec_t &p)
Set the values of the auxilliary parameters that were specified in parms in the constructor.
std::string st_form
The formula string.
int st_np
The number of parameters.
multi_funct11_strings(std::string formula, int nv, std::string vars, int np=0, std::string parms="")
Specify the string and the parameters.
int st_nv
The number of variables.
std::function< double(size_t, const boost::numeric::ublas::vector< double > &)> multi_funct11
Multi-dimensional function typedef.