laura is hosted by Hepforge, IPPP Durham
Laura++  v3r2
A maximum likelihood fitting package for performing Dalitz-plot analysis.
Lau1DCubicSpline.hh
Go to the documentation of this file.
1 
2 // Copyright University of Warwick 2006 - 2015.
3 // Distributed under the Boost Software License, Version 1.0.
4 // (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
5 
6 // Authors:
7 // Thomas Latham
8 // John Back
9 // Paul Harrison
10 
63 #ifndef LAU_1DCUBICSPLINE
64 #define LAU_1DCUBICSPLINE
65 
66 #include <vector>
67 
68 #include "Rtypes.h"
69 
71 
72  public:
78  };
79 
81 
88  };
89 
91 
99  Lau1DCubicSpline(const std::vector<Double_t>& xs, const std::vector<Double_t>& ys,
103  Double_t dydx0 = 0.0, Double_t dydxn = 0.0);
104 
106  virtual ~Lau1DCubicSpline();
107 
109 
113  Double_t evaluate(Double_t x) const;
114 
116 
119  void updateYValues(const std::vector<Double_t>& ys);
120 
122 
125  void updateType(LauSplineType type);
126 
128 
135  LauSplineBoundaryType rightBound,
136  Double_t dydx0 = 0.0,
137  Double_t dydxn = 0.0);
138 
139  private:
141  Lau1DCubicSpline( const Lau1DCubicSpline& rhs );
142 
145 
147  void init();
148 
150  void calcDerivatives();
151 
155  void calcDerivativesAkima();
156 
158  const UInt_t nKnots_;
159 
161  std::vector<Double_t> x_;
163  std::vector<Double_t> y_;
165  std::vector<Double_t> dydx_;
166 
168  std::vector<Double_t> a_;
170  std::vector<Double_t> b_;
172  std::vector<Double_t> c_;
174  std::vector<Double_t> d_;
175 
178 
183 
185  Double_t dydx0_;
187  Double_t dydxn_;
188 
189  ClassDef(Lau1DCubicSpline, 0); // Class for defining a 1D cubic spline
190 };
191 
192 #endif
std::vector< Double_t > c_
The &#39;c&#39; coefficients used to determine the derivatives.
LauSplineBoundaryType
Define the allowed boundary condition types.
std::vector< Double_t > b_
The &#39;b&#39; coefficients used to determine the derivatives.
Double_t dydxn_
The gradient at the right boundary for a clamped spline.
Lau1DCubicSpline & operator=(const Lau1DCubicSpline &rhs)
Copy assignment operator - not implemented.
Double_t evaluate(Double_t x) const
Evaluate the function at given point.
void updateType(LauSplineType type)
Update the type of interpolation to perform.
void calcDerivatives()
Calculate the first derivative at each knot.
void init()
Initialise the class.
std::vector< Double_t > d_
The &#39;d&#39; coefficients used to determine the derivatives.
void calcDerivativesAkima()
Calculate the first derivatives according to the Akima method.
LauSplineType type_
The type of interpolation to be performed.
std::vector< Double_t > dydx_
The first derivative at each knot.
std::vector< Double_t > a_
The &#39;a&#39; coefficients used to determine the derivatives.
LauSplineBoundaryType leftBound_
The left-hand boundary condition on the spline.
Class for defining a 1D cubic spline based on a set of knots.
ClassDef(Lau1DCubicSpline, 0)
void updateYValues(const std::vector< Double_t > &ys)
Update the y-values of the knots.
const UInt_t nKnots_
The number of knots in the spline.
Lau1DCubicSpline(const std::vector< Double_t > &xs, const std::vector< Double_t > &ys, LauSplineType type=Lau1DCubicSpline::StandardSpline, LauSplineBoundaryType leftBound=Lau1DCubicSpline::NotAKnot, LauSplineBoundaryType rightBound=Lau1DCubicSpline::NotAKnot, Double_t dydx0=0.0, Double_t dydxn=0.0)
Constructor.
Double_t dydx0_
The gradient at the left boundary for a clamped spline.
LauSplineBoundaryType rightBound_
The right-hand boundary condition on the spline.
void updateBoundaryConditions(LauSplineBoundaryType leftBound, LauSplineBoundaryType rightBound, Double_t dydx0=0.0, Double_t dydxn=0.0)
Update the boundary conditions for the spline.
std::vector< Double_t > y_
The y-value at each knot.
LauSplineType
Define the allowed interpolation types.
void calcDerivativesStandard()
Calculate the first derivatives according to the standard method.
std::vector< Double_t > x_
The x-value at each knot.
virtual ~Lau1DCubicSpline()
Destructor.