OpenFPM_pdata  4.1.0
Project that contain the implementation of distributed structures
 
Loading...
Searching...
No Matches
VandermondeRowBuilder.hpp
1//
2// Created by tommaso on 22/03/19.
3// Modified by Serhii
4//
5
6#ifndef OPENFPM_PDATA_VANDERMONDEROW_HPP
7#define OPENFPM_PDATA_VANDERMONDEROW_HPP
8
9#include "MonomialBasis.hpp"
10
11template <unsigned int dim, typename T, typename MonomialBasis_type = MonomialBasis<dim>>
13{
14private:
15 const MonomialBasis_type& monomialBasis;
16
17public:
18 VandermondeRowBuilder(const MonomialBasis_type &monomialBasis) : monomialBasis(monomialBasis) {}
19
20 template <typename MatrixType>
21 void buildRow(MatrixType &M, unsigned int row, Point<dim, T> x, T eps);
22};
23
24template<unsigned int dim, typename T,typename MonomialBasis_type>
25template <typename MatrixType>
26void VandermondeRowBuilder<dim, T, MonomialBasis_type>::buildRow(MatrixType &M, unsigned int row, Point<dim, T> x, T eps)
27{
28 auto& basisElements = monomialBasis.getElements();
29
30 for (size_t col = 0; col < basisElements.size(); ++col)
31 {
32 Monomial<dim> m = basisElements.get(col);
33 M(row, col) = m.evaluate(x);
34 M(row, col) /= openfpm::math::intpowlog(eps, m.order());
35 }
36}
37
38
39#endif //OPENFPM_PDATA_VANDERMONDEROW_HPP
This class implement the point shape in an N-dimensional space.
Definition Point.hpp:28