NiHu  2.0
unit_sphere_interpolator.h
Go to the documentation of this file.
1 
7 #ifndef NIHU_UNIT_SPHERE_INTERPOLATOR_H_INCLUDED
8 #define NIHU_UNIT_SPHERE_INTERPOLATOR_H_INCLUDED
9 
10 #include "unit_sphere.h"
11 
12 #include <boost/math/constants/constants.hpp>
13 #include <Eigen/Dense>
14 #include <fftw3.h>
15 
16 #include <complex>
17 #include <vector>
18 
19 namespace NiHu
20 {
21 namespace fmm
22 {
23 
26 {
27  typedef Eigen::Matrix<std::complex<double>, Eigen::Dynamic, Eigen::Dynamic> cmatrix_t;
28  typedef Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic> dmatrix_t;
29  typedef Eigen::Matrix<std::complex<double>, Eigen::Dynamic, 1> cvector_t;
30  typedef Eigen::Matrix<double, Eigen::Dynamic, 1> dvector_t;
31 
32 public:
33  interpolator()
34  : dft_plan(nullptr)
35  , idft_plan(nullptr)
36  {
37  }
38 
39  interpolator(unit_sphere const &Sfrom, unit_sphere const &Sto);
40 
41  ~interpolator()
42  {
43  fftw_destroy_plan(dft_plan);
44  fftw_destroy_plan(idft_plan);
45  }
46 
47  interpolator(interpolator const &other)
48  : dft_plan(nullptr)
49  , idft_plan(nullptr)
50  {
51  *this = other;
52  }
53 
54  interpolator(interpolator &&other);
55 
56  interpolator const &operator=(interpolator const &other);
57 
58  interpolator const &operator=(interpolator &&other);
59 
60  cvector_t const &interpolate(cvector_t const &other) const;
61 
62 private:
63  static dmatrix_t Amatrix(int L, int m,
64  dvector_t const &theta,
65  dvector_t const &xi,
66  dvector_t const &wxi);
67 
68  static double C(int l, int m);
69 
70 private:
71  size_t m_Lfrom, m_Lto;
72  std::vector<dmatrix_t> m_A;
73  fftw_plan dft_plan, idft_plan;
74 
75  mutable cmatrix_t m_Phi;
76  mutable cmatrix_t m_Q;
77  mutable cvector_t m_res;
78 };
79 
80 } // end of namespace fmm
81 } // namespace NiHu
82 
83 #endif
unit_sphere.h
Interface of class NiHu::fmm::unit_sphere.
C
Definition: bbfmm_covariance.cpp:47
NiHu::fmm::interpolator
class interpolating over the unit sphere
Definition: unit_sphere_interpolator.h:25
NiHu::fmm::interpolator::interpolate
const cvector_t & interpolate(cvector_t const &other) const
Definition: unit_sphere_interpolator.cpp:62
NiHu::fmm::unit_sphere
class performing interpolation and integration over the unit sphere
Definition: unit_sphere.h:18