Class fit_base (o2scl)

O2scl : Class List

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

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

Public Functions

fit_base()
~fit_base()
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.

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.

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.

The covariance matrix for the parameters is returned in covar and the value of \( \chi^2 \) is returned in chi2.

const char *type()

Return string denoting type (“fit_base”)

Public Members

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.