fit_base Class Template Reference

#include <fit_base.h>

Inheritance diagram for fit_base:

gsl_fit min_fit

Detailed Description

template<class param_t, class func_t, class vec_t = ovector_view, class mat_t = omatrix_view>
class fit_base< param_t, func_t, vec_t, mat_t >

Non-linear least-squares fitting base class.

Definition at line 273 of file fit_base.h.


Public Member Functions

 fit_base ()
virtual ~fit_base ()
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.
virtual int fit (size_t ndat, vec_t &xdat, vec_t &ydat, vec_t &yerr, size_t npar, vec_t &par, mat_t &covar, double &chi2, param_t &pa, func_t &fitfun)
 Fit the data specified in (xdat,ydat) to the function fitfun with the parameters in par.
virtual const char * type ()
 Return string denoting type ("fit_base").

Data Fields

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.

Member Function Documentation

virtual int print_iter ( size_t  nv,
vec_t &  x,
double  y,
int  iter,
double  value = 0.0,
double  limit = 0.0 
) [inline, virtual]

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.

Definition at line 292 of file fit_base.h.

virtual int fit ( size_t  ndat,
vec_t &  xdat,
vec_t &  ydat,
vec_t &  yerr,
size_t  npar,
vec_t &  par,
mat_t &  covar,
double &  chi2,
param_t &  pa,
func_t &  fitfun 
) [inline, virtual]

Fit the data specified in (xdat,ydat) to the function fitfun with the parameters in par.

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

Reimplemented in fit_fix_pars, gsl_fit, and min_fit.

Definition at line 321 of file fit_base.h.


The documentation for this class was generated from the following file:
Documentation generated with Doxygen and provided under the GNU Free Documentation License. See License Information for details.