18 #include <boost/math/special_functions/binomial.hpp>
26 template <
typename number>
28 get_bernstein_coefficients(
const unsigned int k,
const unsigned int n)
31 ExcMessage(
"Bernstein polynomial needs to be of degree > 0."));
33 std::vector<number> coeff(n + 1, number(0.0));
34 for (
unsigned int i = k; i < n + 1; ++i)
36 coeff[i] = ((i - k) % 2 == 0 ? 1 : -1) *
37 boost::math::binomial_coefficient<number>(n, i) *
38 boost::math::binomial_coefficient<number>(i, k);
44 template <
typename number>
46 const unsigned int degree)
48 get_bernstein_coefficients<number>(index, degree))
52 #include "polynomials_bernstein.inst"