7 #ifndef NIHU_X2P_CLUSTER_INDEXED_HPP_INCLUDED
8 #define NIHU_X2P_CLUSTER_INDEXED_HPP_INCLUDED
14 #include <type_traits>
21 template <
class Operator>
23 :
public fmm_operator<typename std::decay<Operator>::type::fmm_tag>
26 typedef typename std::decay<Operator>::type operator_t;
27 typedef typename operator_t::trial_input_t cluster_t;
29 typedef typename operator_t::result_t op_result_t;
30 typedef typename scalar<op_result_t>::type scalar_t;
31 typedef Eigen::Matrix<scalar_t, Eigen::Dynamic, Eigen::Dynamic> result_t;
33 static size_t const num_dof_per_rec = rows;
36 : m_op(std::forward<Operator>(op))
43 cluster_t
const &clus_to = m_tree[to];
44 cluster_t
const &clus_from = m_tree[from];
51 for (
size_t ii = 0; ii < clus_to.get_n_rec_nodes(); ++ii)
53 size_t i = clus_to.get_rec_node_idx()[ii];
54 typename operator_t::result_t res = m_op(i, clus_from);
58 mat.resize(clus_to.get_n_rec_nodes() * rows, cols);
61 mat.block(rows * ii, 0, rows, cols) = res;
69 return (*
this)(idx, idx);
72 tree_t
const &get_tree()
const
83 template <
class Operator>
84 x2p_cluster_indexed<Operator>
85 create_x2p_cluster_indexed(Operator &&op,
86 cluster_tree<
typename std::decay<Operator>::type::trial_input_t>
const &tree)
88 return x2p_cluster_indexed<Operator>(std::forward<Operator>(op), tree);