OpenFPM  5.2.0
Project that contain the implementation of distributed structures
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 
11 template <unsigned int dim, typename T, typename MonomialBasis_type = MonomialBasis<dim>>
13 {
14 private:
15  const MonomialBasis_type& monomialBasis;
16 
17 public:
18  VandermondeRowBuilder(const MonomialBasis_type &monomialBasis) : monomialBasis(monomialBasis) {}
19 
20  template <typename MatrixType>
21  void buildRow(MatrixType &V, unsigned int row, Point<dim, T> x);
22 };
23 
24 template<unsigned int dim, typename T,typename MonomialBasis_type>
25 template <typename MatrixType>
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  V(row, col) = m.evaluate(x);
34  }
35 }
36 
37 
38 #endif //OPENFPM_PDATA_VANDERMONDEROW_HPP
This class implement the point shape in an N-dimensional space.
Definition: Point.hpp:28