13namespace CurveFitting {
32 SimpleChebfun(
const std::vector<double> &
x,
const std::vector<double> &
y);
34 size_t size()
const {
return m_base->size(); }
36 size_t order()
const {
return m_base->order(); }
38 bool isGood()
const {
return !m_badFit; }
40 double startX()
const {
return m_base->startX(); }
42 double endX()
const {
return m_base->endX(); }
44 double width()
const {
return m_base->width(); }
46 const std::vector<double> &
xPoints()
const {
return m_base->xPoints(); }
48 const std::vector<double> &
yPoints()
const {
return m_P; }
50 const std::vector<double> &coeffs()
const;
52 double operator()(
double x)
const;
54 std::vector<double> operator()(
const std::vector<double> &x)
const;
56 std::vector<double> linspace(
size_t n)
const;
58 double accuracy()
const;
64 std::vector<double> roughRoots(
double level = 0.0)
const;
66 double integrate()
const;
76 std::vector<double>
m_P;
78 mutable std::vector<double>
m_A;
This is an interface to a fitting function - a semi-abstarct class.
SimpleChebfun : approximates smooth 1d functions and provides methods to manipulate them.
const std::vector< double > & yPoints() const
Get a reference to the y-points.
ChebfunBase_sptr m_base
Underlying base that does actual job.
std::vector< double > m_P
Function values at the chebfun x-points.
double width() const
Get the width of the interval.
double startX() const
Start of the interval.
bool isGood() const
Check if approximation is good.
std::vector< double > m_A
Chebyshev expansion coefficients.
const std::vector< double > & xPoints() const
Get a reference to the x-points.
double endX() const
End of the interval.
bool m_badFit
Set in a case of a bad fit.
size_t order() const
Order of the approximating polynomial.
size_t size() const
Number of points in the approximation.
MatrixWorkspace_sptr MANTID_API_DLL operator+=(const MatrixWorkspace_sptr &lhs, const MatrixWorkspace_sptr &rhs)
Adds two workspaces.
std::shared_ptr< ChebfunBase > ChebfunBase_sptr
std::function< double(double)> ChebfunFunctionType
Type of the approximated function.
double integral(double func(const double, const double, const double), const double a, const double b, const double g, const double w0)
Helper class which provides the Collimation Length for SANS instruments.