16#include "dune/common/fvector.hh"
38 template <
int d,
class Real>
47 auto ks = multiIndex<d>(p,i);
49 std::array<size_t,d+1> Ks;
50 std::copy(begin(ks),end(ks),begin(Ks));
51 Ks[d] = p - std::accumulate(begin(ks),end(ks),0);
56 for (
int j=0; j<=d; ++j)
57 r *=
power(b[j],Ks[j]);
61 static_assert(d<=2,
"not yet implemented");
Dune::FieldVector< CoordType, dim+1 > barycentric2(Dune::FieldVector< CoordType, dim > const &x)
Computes barycentric coordinates of a point in the unit simplex.
size_t multinomial(std::array< size_t, m > const &ks)
Computes the multinomial coefficient , where .
constexpr int binomial(int n, int k)
Computes the binomial coefficient .
R power(R base, int exp)
Computes integral powers of values in a multiplicative half-group.
Real bezier(int p, int i, Dune::FieldVector< Real, d > const &x)
Computes the i-th Bezier function of order p at the given point in the unit simplex.