interpolate.h Source File

LibRPA: interpolate.h Source File
LibRPA
interpolate.h
Go to the documentation of this file.
1 
9 #pragma once
10 #include <vector>
11 
12 namespace LIBRPA
13 {
14 namespace utils
15 {
16 
19 {
20 private:
21  const std::vector<double> d_xs;
22  const std::vector<double> d_ys;
23  std::vector<double> d_a;
24  std::vector<double> d_b;
25  std::vector<double> d_c;
26  std::vector<double> d_d;
27 public:
28  // default constructor
29  CubicSpline(const std::vector<double>& xs, const std::vector<double>& ys);
30  // destructor
31  ~CubicSpline() {};
32  // copy & move constructor
33  CubicSpline(const CubicSpline& s) = delete;
34  CubicSpline(CubicSpline&& s) = delete;
35  // copy & move assignment operator
36  CubicSpline& operator=(const CubicSpline& s) = delete;
37  CubicSpline& operator=(CubicSpline&& s) = delete;
38 
40  double operator()(double x) const;
42  std::vector<double> operator()(const std::vector<double>& xs) const;
43 }; /* end of class CubicSpline */
44 
52 std::vector<double> interp_cubic_spline(const std::vector<double> &xs,
53  const std::vector<double> &ys,
54  const std::vector<double> &xs_new);
55 
56 } /* end of namepsace utils */
57 
58 } /* end of namespace LIBRPA */
Class to perform cubic spline interolation.
Definition: interpolate.h:19
double operator()(double x) const
interpolate on individual x
Definition: interpolate.cpp:71
std::vector< double > interp_cubic_spline(const std::vector< double > &xs, const std::vector< double > &ys, const std::vector< double > &xs_new)
Helper function to performance cubic spline interpolation.
Definition: interpolate.cpp:149
Definition: analycont.cpp:14