13#include <gsl/gsl_blas.h>
14#include <gsl/gsl_multifit_nlin.h>
15#include <gsl/gsl_multimin.h>
16#include <gsl/gsl_statistics.h>
19namespace CurveFitting {
30 GSL_FitData(
const std::shared_ptr<CostFunctions::CostFuncLeastSquares> &cf);
49int gsl_f(
const gsl_vector *
x,
void *params, gsl_vector *f);
50int gsl_df(
const gsl_vector *
x,
void *params, gsl_matrix *J);
51int gsl_fdf(
const gsl_vector *
x,
void *params, gsl_vector *f, gsl_matrix *J);
60 return gsl_vector_const_view_array(v.data(), v.size());
64 return gsl_matrix_const_view_array(
m.data(),
m.cols(),
m.rows());
The implementation of Jacobian.
std::shared_ptr< IFunction > IFunction_sptr
shared pointer to the function base class
int gsl_fdf(const gsl_vector *x, void *params, gsl_vector *f, gsl_matrix *J)
Fit derivatives and function GSL wrapper.
Eigen::Map< Eigen::VectorXd, 0, dynamic_stride > vec_map_type
gsl_vector_view getGSLVectorView(vec_map_type &v)
take data from Eigen Vector and take a gsl view
int gsl_f(const gsl_vector *x, void *params, gsl_vector *f)
Fit GSL function wrapper.
gsl_matrix_const_view const getGSLMatrixView_const(const map_type m)
take data from a constEigen Matrix and return a transposed gsl view.
Eigen::Map< Eigen::MatrixXd, 0, dynamic_stride > map_type
gsl_matrix_view getGSLMatrixView(map_type &tr)
take data from an Eigen Matrix and return a transposed a gsl view.
int gsl_df(const gsl_vector *x, void *params, gsl_matrix *J)
Fit GSL derivative function wrapper.
gsl_vector_const_view const getGSLVectorView_const(const vec_map_type v)
take const data from Eigen Vector and take a gsl view
Helper class which provides the Collimation Length for SANS instruments.
Various GSL specific functions used GSL specific minimizers.
size_t n
number of points to be fitted (size of X, Y and sqrtWeightData arrays)
std::shared_ptr< CostFunctions::CostFuncLeastSquares > costFunction
~GSL_FitData()
Destructor.
API::IFunction_sptr function
Pointer to the function.
size_t p
number of (active) fit parameters
JacobianImpl1< EigenMatrix > J
Jacobi matrix interface.
gsl_vector * initFuncParams
Initial function parameters.