29 #include <o2scl/mm_funct.h> 30 #include <o2scl/jacobian.h> 102 virtual const char *
type() {
return "mroot"; }
105 virtual int msolve(
size_t n, vec_t &x, func_t &func)=0;
132 template<
class vec2_t,
class vec3_t>
134 int iter,
double value=0.0,
double limit=0.0,
135 std::string comment=
"")
141 std::cout << comment <<
" Iteration: " << iter << std::endl;
142 for(
size_t i=0;i<n;i++) {
146 std::cout <<
" " << x[i];
148 std::cout <<
" " << x[i];
151 std::cout <<
" " << y[i] << std::endl;
153 std::cout <<
" " << y[i] << std::endl;
156 std::cout <<
"Val: " << value <<
" Lim: " << limit << std::endl;
158 std::cout <<
"Press a key and type enter to continue. ";
The main O<span style='position: relative; top: 0.3em; font-size: 0.8em'>2</span>scl O$_2$scl names...
int verbose
Output control (default 0)
std::function< int(size_t, const boost::numeric::ublas::vector< double > &, boost::numeric::ublas::vector< double > &) > mm_funct
Array of multi-dimensional functions typedef.
std::function< int(size_t, boost::numeric::ublas::vector< double > &, size_t, boost::numeric::ublas::vector< double > &, boost::numeric::ublas::matrix< double > &) > jac_funct
Jacobian function (not necessarily square)
virtual int msolve(size_t n, vec_t &x, func_t &func)=0
Solve func using x as an initial guess, returning x.
Multidimensional root-finding [abstract base].
int print_iter(size_t n, const vec2_t &x, const vec3_t &y, int iter, double value=0.0, double limit=0.0, std::string comment="")
Print out iteration information.
int ntrial
Maximum number of iterations (default 100)
bool err_nonconv
If true, call the error handler if msolve() or msolve_de() does not converge (default true) ...
int last_ntrial
The number of iterations for in the most recent minimization.
virtual int msolve_de(size_t n, vec_t &x, func_t &func, jfunc_t &dfunc)
Solve func with derivatives dfunc using x as an initial guess, returning x.
double tol_abs
The minimum allowable stepsize (default 1.0e-12)
virtual const char * type()
Return the type, "mroot".
double tol_rel
The maximum value of the functions for success (default 1.0e-8)