Class chi_fit_funct (o2scl)¶
-
template<class vec_t = boost::numeric::ublas::vector<double>, class mat_t = boost::numeric::ublas::matrix<double>, class fit_func_t = fit_funct>
class chi_fit_funct : public o2scl::gen_fit_funct<boost::numeric::ublas::vector<double>, boost::numeric::ublas::matrix<double>>¶ Standard fitting function based on one-dimensional data with a numerical Jacobian.
This class specifies the deviations (in
operator()
) and Jacobian (in jac()) for a fitting class like fit_nonlin. It assumes a one-dimensional data set with no uncertainty in the abcissae and a fitting function specified in a form similar to fit_funct.The default method for numerically computing the Jacobian is from jacobian_gsl. This default is identical to the GSL approach, except that the default value of jacobian_gsl::epsmin is non-zero. See jacobian_gsl for more details.
Default template arguments
vec_t
- boost::numeric::ublas::vector < double >mat_t
- boost::numeric::ublas::matrix < double >func_t
- fit_funct- Idea for Future:
Allow a user-specified Jacobian or make that into a separate class?
Default constructor?
Data and uncertainties
-
size_t ndat_¶
-
fit_func_t *fun_¶
Fitting function.
-
chi_fit_funct(const chi_fit_funct&)¶
-
chi_fit_funct &operator=(const chi_fit_funct&)¶
Public Functions
-
inline chi_fit_funct(size_t ndat, const vec_t &xdat, const vec_t &ydat, const vec_t &yerr, fit_func_t &fun)¶
Create an object with specified data and specified fitting function.
-
inline void set_data(size_t ndat, const vec_t &xdat, const vec_t &ydat, const vec_t &yerr)¶
Set the data to be fit.
-
inline void set_func(fit_func_t &fun)¶
Set the fitting function.
-
inline virtual void operator()(size_t np, const vec_t &p, size_t nd, vec_t &f)¶
Using parameters in
p
, compute the relative deviations inf
.
-
inline virtual void jac(size_t np, vec_t &p, size_t nd, vec_t &f, mat_t &J)¶
Using parameters in
p
, compute the Jacobian inJ
.
-
inline virtual size_t get_ndata()¶
Return the number of data points.
Public Members
Protected Functions