Public Member Functions | Public Attributes | List of all members
o2scl::fit_base< func_t, vec_t, mat_t > Class Template Referenceabstract

Non-linear least-squares fitting [abstract base]. More...

#include <fit_base.h>

Inheritance diagram for o2scl::fit_base< func_t, vec_t, mat_t >:
o2scl::fit_fix_pars< bool_vec_t, func_t, vec_t, mat_t > o2scl::fit_min< func_t, vec_t, mat_t > o2scl::fit_nonlin< func_t, vec_t, mat_t >

Public Member Functions

virtual int print_iter (size_t nv, vec_t &x, double y, int iter, double value=0.0, double limit=0.0)
 Print out iteration information. More...
 
virtual int fit (size_t npar, vec_t &parms, mat_t &covar, double &chi2, func_t &fitfun)=0
 Fit function fitfun using parameters in parms as initial guesses. More...
 
virtual const char * type ()
 Return string denoting type ("fit_base")
 

Public Attributes

size_t ntrial
 Maximum number of iterations (default 500)
 
double tol_abs
 Absolute tolerance (default 1.0e-4)
 
double tol_rel
 (default 1.0e-4)
 
int verbose
 An integer describing the verbosity of the output.
 
size_t n_dat
 The number of data points.
 
size_t n_par
 The number of parameters.
 

Detailed Description

template<class func_t = fit_funct11, class vec_t = boost::numeric::ublas::vector<double>, class mat_t = boost::numeric::ublas::matrix<double>>
class o2scl::fit_base< func_t, vec_t, mat_t >

Definition at line 327 of file fit_base.h.

Member Function Documentation

◆ fit()

template<class func_t = fit_funct11, class vec_t = boost::numeric::ublas::vector<double>, class mat_t = boost::numeric::ublas::matrix<double>>
virtual int o2scl::fit_base< func_t, vec_t, mat_t >::fit ( size_t  npar,
vec_t &  parms,
mat_t &  covar,
double &  chi2,
func_t &  fitfun 
)
pure virtual

◆ print_iter()

template<class func_t = fit_funct11, class vec_t = boost::numeric::ublas::vector<double>, class mat_t = boost::numeric::ublas::matrix<double>>
virtual int o2scl::fit_base< func_t, vec_t, mat_t >::print_iter ( size_t  nv,
vec_t &  x,
double  y,
int  iter,
double  value = 0.0,
double  limit = 0.0 
)
inlinevirtual

Depending on the value of the variable verbose, this prints out the iteration information. If verbose=0, then no information is printed, while if verbose>1, then after each iteration, the present values of x and y are output to std::cout along with the iteration number. If verbose>=2 then each iteration waits for a character.

Definition at line 358 of file fit_base.h.


The documentation for this class was generated from the following file:

Documentation generated with Doxygen. Provided under the GNU Free Documentation License (see License Information).