Go to the documentation of this file.
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 last_ntrial
The number of iterations for in the most recent minimization.
double tol_rel
The maximum value of the functions for success (default 1.0e-8)
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.
int ntrial
Maximum number of iterations (default 100)
double tol_abs
The minimum allowable stepsize (default 1.0e-12)
virtual const char * type()
Return the type, "mroot".
virtual int msolve(size_t n, vec_t &x, func_t &func)=0
Solve func using x as an initial guess, returning x.
int verbose
Output control (default 0)
Multidimensional root-finding [abstract base].
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.
bool err_nonconv
If true, call the error handler if msolve() or msolve_de() does not converge (default true)
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) in src/root/jacobian.h.
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.
Documentation generated with Doxygen. Provided under the
GNU Free Documentation License (see License Information).