7 #ifndef NIHU_FMM_INDEXED_HPP_INCLUDED
8 #define NIHU_FMM_INDEXED_HPP_INCLUDED
15 #include "p2p_indexed.hpp"
19 #include <type_traits>
26 template <class Op, class FmmTag = typename std::decay<Op>::type::fmm_tag>
32 template <
class TestIt,
class TrialIt,
class ClusterDerived>
33 static auto eval(Op &&op, TestIt test_begin, TestIt test_end, TrialIt trial_begin, TrialIt trial_end,
cluster_tree<ClusterDerived> const &tree)
35 return create_x2x_cluster_indexed(std::forward<Op>(op), tree);
42 template <
class TestIt,
class TrialIt,
class ClusterDerived>
43 static auto eval(Op &&op, TestIt test_begin, TestIt test_end, TrialIt trial_begin, TrialIt trial_end,
cluster_tree<ClusterDerived> const &tree)
45 return create_x2x_cluster_indexed(std::forward<Op>(op), tree);
52 template <
class TestIt,
class TrialIt,
class ClusterDerived>
53 static auto eval(Op &&op, TestIt test_begin, TestIt test_end, TrialIt trial_begin, TrialIt trial_end,
cluster_tree<ClusterDerived> const &tree)
55 return create_x2x_cluster_indexed(std::forward<Op>(op), tree);
63 template <
class TestIt,
class TrialIt,
class ClusterDerived>
64 static auto eval(Op &&op, TestIt test_begin, TestIt test_end, TrialIt trial_begin, TrialIt trial_end,
cluster_tree<ClusterDerived> const &tree)
66 return create_x2p_cluster_indexed(
78 template <
class TestIt,
class TrialIt,
class ClusterDerived>
79 static auto eval(Op &&op, TestIt test_begin, TestIt test_end, TrialIt trial_begin, TrialIt trial_end,
cluster_tree<ClusterDerived> const &tree)
81 return create_x2p_cluster_indexed(
93 template <
class TestIt,
class TrialIt,
class ClusterDerived>
94 static auto eval(Op &&op, TestIt test_begin, TestIt test_end, TrialIt trial_begin, TrialIt trial_end,
cluster_tree<ClusterDerived> const &tree)
96 return create_p2x_cluster_indexed(
99 trial_begin, trial_end
108 template <
class TestIt,
class TrialIt,
class ClusterDerived>
109 static auto eval(Op &&op, TestIt test_begin, TestIt test_end, TrialIt trial_begin, TrialIt trial_end,
cluster_tree<ClusterDerived> const &tree)
111 return create_p2x_cluster_indexed(
113 std::forward<Op>(op),
114 trial_begin, trial_end
123 template <
class TestIt,
class TrialIt,
class ClusterDerived>
124 static auto eval(Op &&op, TestIt test_begin, TestIt test_end, TrialIt trial_begin, TrialIt trial_end,
cluster_tree<ClusterDerived> const &)
126 return create_p2p_indexed(
127 std::forward<Op>(op),
128 test_begin, test_end,
129 trial_begin, trial_end);
136 template <
class Op,
class TestIt,
class TrialIt,
class ClusterDerived>
137 auto create_indexed(Op &&op, TestIt test_begin, TestIt test_end, TrialIt trial_begin, TrialIt trial_end,
cluster_tree<ClusterDerived> const &tree)
139 return indexed<Op>::eval(std::forward<Op>(op), test_begin, test_end, trial_begin, trial_end, tree);
143 template <
class TestIt,
class TrialIt,
class ClusterDerived>
147 TrialIt trial_begin, TrialIt trial_end,
149 : m_test_begin(test_begin)
150 , m_test_end(test_end)
151 , m_trial_begin(trial_begin)
152 , m_trial_end(trial_end)
158 auto operator()(Op &&op)
const
160 return create_indexed(std::forward<Op>(op), m_test_begin, m_test_end, m_trial_begin, m_trial_end, m_tree);
163 TestIt m_test_begin, m_test_end;
164 TrialIt m_trial_begin, m_trial_end;
168 template <
class TestIt,
class TrialIt,
class ClusterDerived>
170 create_indexed_functor(TestIt test_begin, TestIt test_end,
171 TrialIt trial_begin, TrialIt trial_end,
175 test_begin, test_end, trial_begin, trial_end,