laura is hosted by Hepforge, IPPP Durham
Laura++  v3r5
A maximum likelihood fitting package for performing Dalitz-plot analysis.
Lau1DCubicSpline.hh
Go to the documentation of this file.
1 
2 /*
3 Copyright 2015 University of Warwick
4 
5 Licensed under the Apache License, Version 2.0 (the "License");
6 you may not use this file except in compliance with the License.
7 You may obtain a copy of the License at
8 
9  http://www.apache.org/licenses/LICENSE-2.0
10 
11 Unless required by applicable law or agreed to in writing, software
12 distributed under the License is distributed on an "AS IS" BASIS,
13 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 See the License for the specific language governing permissions and
15 limitations under the License.
16 */
17 
18 /*
19 Laura++ package authors:
20 John Back
21 Paul Harrison
22 Thomas Latham
23 */
24 
77 #ifndef LAU_1DCUBICSPLINE
78 #define LAU_1DCUBICSPLINE
79 
80 #include <vector>
81 
82 #include "Rtypes.h"
83 
85 
86  public:
92  };
93 
95 
102  };
103 
105 
113  Lau1DCubicSpline(const std::vector<Double_t>& xs, const std::vector<Double_t>& ys,
117  Double_t dydx0 = 0.0, Double_t dydxn = 0.0);
118 
120  virtual ~Lau1DCubicSpline();
121 
123 
127  Double_t evaluate(Double_t x) const;
128 
130 
133  void updateYValues(const std::vector<Double_t>& ys);
134 
136 
139  void updateType(LauSplineType type);
140 
142 
149  LauSplineBoundaryType rightBound,
150  Double_t dydx0 = 0.0,
151  Double_t dydxn = 0.0);
152 
153  private:
155  Lau1DCubicSpline( const Lau1DCubicSpline& rhs );
156 
159 
161  void init();
162 
164  void calcDerivatives();
165 
169  void calcDerivativesAkima();
170 
172  const UInt_t nKnots_;
173 
175  std::vector<Double_t> x_;
177  std::vector<Double_t> y_;
179  std::vector<Double_t> dydx_;
180 
182  std::vector<Double_t> a_;
184  std::vector<Double_t> b_;
186  std::vector<Double_t> c_;
188  std::vector<Double_t> d_;
189 
192 
197 
199  Double_t dydx0_;
201  Double_t dydxn_;
202 
203  ClassDef(Lau1DCubicSpline, 0); // Class for defining a 1D cubic spline
204 };
205 
206 #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.