9 #ifndef __Pulsar_SplineFit_h
10 #define __Pulsar_SplineFit_h
13 #include "Reference.h"
15 #include <gsl/gsl_bspline.h>
16 #include <gsl/gsl_matrix.h>
60 std::vector<double> x;
63 std::vector< Estimate<double> > y;
66 std::vector<double> bp;
96 gsl_bspline_workspace * bwork;
void add_data(double x, Estimate< double > y) Add a data point. Definition: SplineFit.C:68
double evaluate_deriv(double x) Evaluate the fit solution's derivative at the given x. Definition: SplineFit.C:117
int ndof Fit NDOF. Definition: SplineFit.h:80
SplineFit() Default constructor. Definition: SplineFit.C:18
A convenient exception handling class. Definition: Error.h:54
void free_workspaces() Free spline workspaces. Definition: SplineFit.C:45
double evaluate(double x) Evaluate the fit solution at the given x. Definition: SplineFit.C:89
void compute() Compute the fit using current data. Definition: SplineFit.C:198
std::vector< double > bp The spline breakpoints. Definition: SplineFit.h:71
void interval_check(bool fix=false) Check if spline intervals and data make sense. Definition: SplineFit.C:141
double get_rchi2() Get the reduced chi2 of the fit. Definition: SplineFit.C:133
bool calculated Has the fit been calculated? Definition: SplineFit.h:83
std::vector< double > x The x values for the fit. Definition: SplineFit.h:65
void reset() Clear all current data, results. Definition: SplineFit.C:34
gsl_bspline_workspace * bwork bspline temp space Definition: SplineFit.h:101
gsl_matrix * cov The fit cov matrix. Definition: SplineFit.h:89
Manages Reference::To references to the instance. Definition: ReferenceAble.h:40
std::vector< Estimate< double > > y The y values/errors for the fit. Definition: SplineFit.h:68
void set_order(int n) Set the degree of the fit. Definition: SplineFit.h:39
int get_order() Get the current degree. Definition: SplineFit.h:42
gsl_vector * coeffs The fitted coeffs. Definition: SplineFit.h:86
int order Spline order (0=const, 3=cubic, etc) Definition: SplineFit.h:74
virtual ~SplineFit() Destructor. Definition: SplineFit.C:29
double chi2 The fit chi2. Definition: SplineFit.h:77
Spline fitting for smoothing and/or interpolation, using GSL's bspline routines. Definition: SplineFit.h:20
void set_uniform_breaks(int nint) Set uniform breakpoints to span the data. Definition: SplineFit.C:75
bool check_range(double x) Check if a requested x val is in the fit range. Definition: SplineFit.C:55
Generated using doxygen 1.8.17
|