7 #ifndef NIHU_P2X_CLUSTER_INDEXED_HPP_INCLUDED
8 #define NIHU_P2X_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::test_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_src = cols;
36 : m_op(std::forward<Operator>(op))
46 cluster_t
const &clus_to = m_tree[to];
47 cluster_t
const &clus_from = m_tree[from];
50 for (
size_t jj = 0; jj < clus_from.get_n_src_nodes(); ++jj)
52 size_t j = clus_from.get_src_node_idx()[jj];
53 typename operator_t::result_t res = m_op(clus_to, j);
57 mat.resize(rows, clus_from.get_n_src_nodes() * cols);
60 mat.block(0, cols * jj, rows, cols) = res;
68 return (*
this)(idx, idx);
71 tree_t
const &get_tree()
const
82 template <
class Operator>
83 p2x_cluster_indexed<Operator>
84 create_p2x_cluster_indexed(Operator &&op,
85 cluster_tree<
typename std::decay<Operator>::type::test_input_t>
const &tree)
87 return p2x_cluster_indexed<Operator>(std::forward<Operator>(op), tree);