16 #include <deal.II/base/polynomials_bernstein.h> 18 DEAL_II_DISABLE_EXTRA_DIAGNOSTICS
19 #include <boost/math/special_functions/binomial.hpp> 20 DEAL_II_ENABLE_EXTRA_DIAGNOSTICS
24 DEAL_II_NAMESPACE_OPEN
28 template <
typename number>
30 get_bernstein_coefficients (
31 const unsigned int k,
const unsigned int n)
35 std::vector<number> coeff(n + 1, number(0.0));
36 for (
unsigned int i = k; i < n + 1; ++i)
38 coeff[i] = ((i - k) % 2 == 0 ? 1 : -1)
39 * boost::math::binomial_coefficient<number>(n, i)
40 * boost::math::binomial_coefficient<number>(i, k);
46 template <
typename number>
48 const unsigned int index,
const unsigned int degree)
51 get_bernstein_coefficients<number>(index, degree))
56 #include "polynomials_bernstein.inst" 58 DEAL_II_NAMESPACE_CLOSE
#define AssertIndexRange(index, range)
PolynomialsBernstein(const unsigned int index, const unsigned int degree)
static ::ExceptionBase & ExcMessage(std::string arg1)
#define Assert(cond, exc)