6#ifndef OPENFPM_PDATA_DCPSEDIAGONALSCALINGMATRIX_HPP
7#define OPENFPM_PDATA_DCPSEDIAGONALSCALINGMATRIX_HPP
9#include "MonomialBasis.hpp"
13template <
unsigned int dim,
typename monomialBasis_type = MonomialBasis<dim>>
17 const monomialBasis_type& monomialBasis;
22 template <
typename T,
typename MatrixType,
typename vector_type,
typename vector_type2>
26 assert(support.size() >= monomialBasis.size());
27 assert(M.rows() == support.size());
28 assert(M.cols() == support.size());
34 const auto& support_keys = support.getKeys();
35 size_t N = support_keys.size();
36 for (
size_t i = 0; i < N; ++i)
38 const auto& pt = support_keys.get(i);
42 M(i,i) = exp(- norm2(p) / (2.0 * eps * eps));
46 template <
typename T,
typename vector_type,
typename vector_type2>
47 __host__ __device__
void buildMatrix(T* M,
size_t supportRefKey,
size_t supportKeysSize,
const size_t* supportKeys, T eps,
vector_type & particlesFrom,
vector_type2 & particlesTo)
50 assert(supportKeysSize >= monomialBasis.size());
54 for (
size_t i = 0; i < supportKeysSize; ++i)
56 size_t pt = supportKeys[i];
58 p -= particlesFrom.
getPos(pt);
60 M[i] = exp(- norm2(p) / (2.0 * eps * eps));
This class implement the point shape in an N-dimensional space.
auto getPosOrig(vect_dist_key_dx vec_key) -> decltype(vd.getPos(vec_key))
Get the position of an element.
auto getPos(vect_dist_key_dx vec_key) -> decltype(vd.getPos(vec_key))
Get the position of an element.
auto getPos(vect_dist_key_dx vec_key) -> decltype(v_pos.template get< 0 >(vec_key.getKey()))
Get the position of an element.
auto getPosOrig(vect_dist_key_dx vec_key) const -> decltype(v_pos.template get< 0 >(vec_key.getKey()))
Get the position of an element.