Go to the documentation of this file.
23 #ifndef O2SCL_MM_FUNCT_H
24 #define O2SCL_MM_FUNCT_H
32 #include <boost/numeric/ublas/vector.hpp>
34 #include <o2scl/shunting_yard.h>
36 #ifndef DOXYGEN_NO_O2NS
41 typedef std::function<
53 template<
class vec_
string_t=std::vector<std::
string> >
55 vec_string_t &var_arr) {
61 for (
int i=0;i<nv;i++) {
62 calc[i].compile(exprs[i].c_str(),&
vars);
82 template<
class vec_t=boost::numeric::ublas::vector<
double> >
85 for(
size_t i=0;i<nv;i++) {
88 for(
size_t i=0;i<nv;i++) {
95 template<
class vec_
string_t=std::vector<std::
string> >
97 vec_string_t &var_arr) {
103 for (
int i=0;i<nv;i++) {
112 #ifndef DOXYGEN_INTERNAL
120 std::map<std::string,double>
vars;
142 #ifdef O2SCL_NEVER_DEFINED
146 template<
class vec_t>
147 class mm_funct_gsl :
public gsl_multiroot_function {
151 typedef std::function<int(
size_t,
const vec_t &, vec_t &)> func_t;
156 static int funct_wrap(
const gsl_vector *x,
void *params,
158 func_t *fp=(func_t *)params;
159 vec_t
x2(x->size), f2(x->size);
160 o2scl::vector_copy<double *,vec_t>(x->size,x.data,
x2);
161 int ret=(*fp)(x->size,
x2,f2);
162 o2scl::vector_copy<vec_t,double *>(x->size,f2,f.data);
169 funct_gsl(func_t &f) {
170 function=&funct_wrap;
177 #ifndef DOXYGEN_NO_O2NS
std::vector< std::string > st_vars
The variables.
void set_function(int nv, vec_string_t &exprs, vec_string_t &var_arr)
Set the functions.
int set_parm(std::string name, double val)
Set the values of the auxilliary parameters that were specified in 'parms' in the constructor.
The main O<span style='position: relative; top: 0.3em; font-size: 0.8em'>2</span>scl O$_2$scl names...
int st_nv
The number of variables.
int operator()(size_t nv, const vec_t &x, vec_t &y)
Compute nv functions, y, of nv variables stored in x with parameter pa.
std::vector< calculator > calc
The function parsers.
static const double x2[5]
std::map< std::string, double > vars
External variables to include in the function parsing.
Array of multi-dimensional functions in an array of strings.
std::function< int(size_t, const boost::numeric::ublas::vector< double > &, boost::numeric::ublas::vector< double > &) > mm_funct
Array of multi-dimensional functions typedef in src/base/mm_funct.h.
mm_funct_strings(int nv, vec_string_t &exprs, vec_string_t &var_arr)
Specify the strings.
std::vector< std::string > st_forms
The expressions.
Documentation generated with Doxygen. Provided under the
GNU Free Documentation License (see License Information).