14#include "MantidCurveFitting/DllConfig.h"
16#include <gsl/gsl_bspline.h>
17#include <gsl/gsl_multifit.h>
18#include <gsl/gsl_statistics.h>
21namespace CurveFitting {
32 const std::string
name()
const override {
return "SplineBackground"; }
34 int version()
const override {
return 1; }
35 const std::vector<std::string>
seeAlso()
const override {
return {
"Fit",
"SplineInterpolation",
"SplineSmoothing"}; }
37 const std::string
category()
const override {
return "Optimization;CorrectionFunctions\\BackgroundCorrections"; }
39 const std::string
summary()
const override {
return "Fit spectra background using b-splines."; }
47 void addWsDataToSpline(
const API::MatrixWorkspace *ws,
const size_t specNum,
int expectedNumBins);
50 void allocateBSplinePointers(
int numBins,
int ncoeffs);
53 double calculateBinWeight(
double errValue);
56 void freeBSplinePointers();
66 void setupSpline(
double xMin,
double xMax,
int numBins,
int ncoeff);
70 gsl_bspline_workspace *splineToProcess{
nullptr};
71 gsl_vector *inputSplineWs{
nullptr};
72 gsl_vector *xData{
nullptr}, *yData{
nullptr};
73 gsl_vector *coefficients{
nullptr}, *binWeights{
nullptr};
74 gsl_matrix *fittedWs{
nullptr}, *covariance{
nullptr};
75 gsl_multifit_linear_workspace *weightedLinearFitWs{
nullptr};
Base class from which all concrete algorithm classes should be derived.
Base MatrixWorkspace Abstract Class.
const std::string category() const override
Algorithm's category for identification overriding a virtual method.
const std::string name() const override
Algorithm's name for identification overriding a virtual method.
const std::string summary() const override
Summary of algorithms purpose.
const std::vector< std::string > seeAlso() const override
Function to return all of the seeAlso (these are not validated) algorithms related to this algorithm....
int version() const override
Algorithm's version for identification overriding a virtual method.
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
Helper class which provides the Collimation Length for SANS instruments.
Struct holding various pointers required by GSL.