Object-oriented Scientific Computing Library: Version 0.910
Public Member Functions | Data Fields
fit_base< func_t, vec_t, mat_t > Class Template Reference

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

#include <fit_base.h>

Inheritance diagram for fit_base< func_t, vec_t, mat_t >:
fit_fix_pars< bool_vec_t > gsl_fit< func_t, vec_t, mat_t, bool_vec_t > min_fit< func_t, vec_t, mat_t >

Detailed Description

template<class func_t = fit_funct<>, class vec_t = ovector_base, class mat_t = omatrix_base>
class fit_base< func_t, vec_t, mat_t >

Definition at line 185 of file fit_base.h.

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.
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, func_t &fitfun)=0
 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

template<class func_t = fit_funct<>, class vec_t = ovector_base, class mat_t = omatrix_base>
virtual int 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 
) [inline, virtual]

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 204 of file fit_base.h.

template<class func_t = fit_funct<>, class vec_t = ovector_base, class mat_t = omatrix_base>
virtual int fit_base< func_t, vec_t, mat_t >::fit ( size_t  ndat,
vec_t &  xdat,
vec_t &  ydat,
vec_t &  yerr,
size_t  npar,
vec_t &  par,
mat_t &  covar,
double &  chi2,
func_t &  fitfun 
) [pure virtual]

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

Implemented in gsl_fit< func_t, vec_t, mat_t, bool_vec_t >, and min_fit< func_t, vec_t, mat_t >.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

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

Get Object-oriented Scientific Computing
Lib at SourceForge.net. Fast, secure and Free Open Source software
downloads.