NiHu  2.0
hat_matrix.h
Go to the documentation of this file.
1 
7 #ifndef NIHU_HAT_MATRIX_H_INCLUDED
8 #define NIHU_HAT_MATRIX_H_INCLUDED
9 
10 #include <Eigen/Dense>
11 
12 namespace NiHu
13 {
14 namespace fmm
15 {
16 
18  : private Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic>
19 {
20  typedef Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic> base_t;
21 
22  base_t const &base() const
23  {
24  return *(static_cast<base_t const *>(this));
25  }
26 
27  base_t &base()
28  {
29  return *(static_cast<base_t *>(this));
30  }
31 
32 public:
33  hat_matrix()
34  {
35  }
36 
37  explicit hat_matrix(size_t N)
38  : base_t(base_t::Zero(N+1, 2*N+1))
39  , m_N(N)
40  {
41  }
42 
43  double &operator()(Eigen::Index n, Eigen::Index m)
44  {
45  return base()(n + 1, m_N + 1 + m);
46  }
47 
48  double operator()(Eigen::Index n, Eigen::Index m) const
49  {
50  return base()(n + 1, m_N + 1 + m);
51  }
52 
53 private:
54  size_t m_N;
55 };
56 
57 } // end of namespace fmm
58 } // end of namespace NiHu
59 
60 #endif /* NIHU_HAT_MATRIX_H_INCLUDED */
NiHu::fmm::hat_matrix
Definition: hat_matrix.h:17