Interpolation.h
1 //-*-C++-*-
2 /***************************************************************************
3  *
4  * Copyright (C) 2008 by Willem van Straten
5  * Licensed under the Academic Free License version 2.1
6  *
7  ***************************************************************************/
8 
9 #ifndef __Pulsar_Interpolation_h
10 #define __Pulsar_Interpolation_h
11 
12 #include "Reference.h"
13 
14 #include <gsl/gsl_interp.h>
15 #include <gsl/gsl_spline.h>
16 
17 #include <vector>
18 
21 {
22 
23 public:
24 
26  Interpolation ();
27 
29  virtual ~Interpolation ();
30 
32  void init (const std::vector<double>& x, const std::vector<double>& y);
33 
35  double eval (double x);
36 
37 protected:
38 
39  const double* xa;
40  const double* ya;
41  size_t size;
42 
43  gsl_interp* interp;
44  gsl_interp_accel* acc;
45 
46  void destroy ();
47 };
48 
49 #endif
virtual ~Interpolation()
Destructor.
Definition: Interpolation.C:23
double eval(double x)
Evaluate at the given abscissa.
Definition: Interpolation.C:59
Interpolation()
Default constructor.
Definition: Interpolation.C:14
Interface to GSL interpolation routines.
Definition: Interpolation.h:20
Manages Reference::To references to the instance.
Definition: ReferenceAble.h:40
void init(const std::vector< double > &x, const std::vector< double > &y)
Initialize interpolation object.
Definition: Interpolation.C:29

Generated using doxygen 1.8.17