36 #include <gsl/gsl_bspline.h>
37 #include <gsl/gsl_multifit.h>
39 #ifndef DOXYGEN_NO_O2NS
98 void set_x(
const gsl_vector *ix) {
105 int smooth_data(
const gsl_vector *y,
const gsl_vector *e, gsl_vector *ys);
109 int smooth_data(
const gsl_vector *y, gsl_vector *ys);
126 gsl_bspline_workspace *
bw;
135 gsl_multifit_linear_workspace *
mw;
147 int fit(
const gsl_vector *y);
150 int fit_errors(
const gsl_vector *y,
const gsl_vector *e);
172 #ifndef DOXYGEN_NO_O2NS
double calc_for_x(double xi)
calculate smoothed curve value for a certain xi
void init_pointers_and_defs()
Set default values and zero pointers.
const gsl_vector * x
Values of the independent variable.
void set_order(int order)
Set order.
void set_x(const gsl_vector *ix)
Set the x-values.
int smooth_data(const gsl_vector *y, const gsl_vector *e, gsl_vector *ys)
Smooth data in y with errors e returning result ys.
gsl_matrix * X
Workspace for spline fitting.
size_t nbreak
internally calculated, number of "segment" to split the data into
void set_pars(int incoeffs, int order)
Set parameters.
gsl_matrix * cov
Covariance matrix.
size_t ncoeffs
Number of free coefficients for spline.
bool x_set
True of the x values have been set.
int fit(const gsl_vector *y)
Construct un-weighted fit.
gsl_bspline_workspace * bw
Spline workspace.
size_t norder
Order of spline to be used (4=cubic)
gsl_vector * B
Spline temporary vector.
void set_ncoeff(int incoeffs)
Set the number of coefficients.
int fit_errors(const gsl_vector *y, const gsl_vector *e)
Construct weighted fit.
Smooth a GSL vector using GSL bsplines.
smooth_gsl(const gsl_vector *ix)
Begin using x-values from vector ix.
gsl_vector * c
Parameters of linear fit, y=X*c.
gsl_multifit_linear_workspace * mw
Linear fit workspace.
int init()
Allocate memory and initialize splines.