NiHu  2.0
p2p.hpp
Go to the documentation of this file.
1 
7 #ifndef NIHU_P2P_HPP_INCLUDED
8 #define NIHU_P2P_HPP_INCLUDED
9 
10 #include "fmm_operator.hpp"
11 
12 #include "util/matrix_traits.hpp"
13 
14 namespace NiHu
15 {
16 namespace fmm
17 {
18 
19 template <class Kernel>
20 class p2p
21  : public fmm_operator<p2p_tag>
22 {
23 public:
24  typedef Kernel kernel_t;
25  typedef typename kernel_t::test_input_t test_input_t;
26  typedef typename kernel_t::trial_input_t trial_input_t;
27  typedef typename kernel_t::result_t result_t;
28 
29  p2p(kernel_t const &kernel)
30  : m_kernel(kernel)
31  {
32  }
33 
34  size_t rows(test_input_t const &) const
35  {
37  }
38 
39  size_t cols(trial_input_t const &) const
40  {
42  }
43 
44  result_t operator()(test_input_t const &x, trial_input_t const &y) const
45  {
46  return m_kernel(x, y);
47  }
48 
49  template <class TSI, class TRI>
50  result_t operator()(TSI const &tsi, TRI const &tri) const
51  {
52  return m_kernel(test_input_t(tsi), trial_input_t(tri));
53  }
54 
55  kernel_t const &get_kernel() const
56  {
57  return m_kernel;
58  }
59 
60 private:
61  kernel_t m_kernel;
62 };
63 
64 } // end of namespace fmm
65 } // namespace NiHu
66 
67 #endif /* NIHU_P2P_HPP_INCLUDED */
fmm_operator.hpp
FMM operator types and tags.
NiHu::num_rows
metafunction returning the number of compile time rows
Definition: matrix_traits.hpp:16
NiHu::fmm::fmm_operator
Operator defining its tag type.
Definition: fmm_operator.hpp:85
NiHu::num_cols
metafunction returning the number of compile time columns
Definition: matrix_traits.hpp:41
NiHu::fmm::p2p
Definition: p2p.hpp:20
matrix_traits.hpp
compile time properties of matrices