Bembel
 
Loading...
Searching...
No Matches
Pascal.hpp
1// This file is part of Bembel, the higher order C++ boundary element library.
2//
3// Copyright (C) 2022 see <http://www.bembel.eu>
4//
5// It was written as part of a cooperation of J. Doelz, H. Harbrecht, S. Kurz,
6// M. Multerer, S. Schoeps, and F. Wolf at Technische Universitaet Darmstadt,
7// Universitaet Basel, and Universita della Svizzera italiana, Lugano. This
8// source code is subject to the GNU General Public License version 3 and
9// provided WITHOUT ANY WARRANTY, see <http://www.bembel.eu> for further
10// information.
11#ifndef BEMBEL_SRC_SPLINE_PASCAL_HPP_
12#define BEMBEL_SRC_SPLINE_PASCAL_HPP_
13
14namespace Bembel {
15
22template <bool condition>
24template <>
26 enum { YOU_CALLED_BINOMIAL_WITH_KgtrN_OR_NEGATIVE_VALUES = 1 };
27};
28
29template <int K, int N>
30struct Binomial {
31 enum {
32 value = static_assertKlessseqN<(K >= 0 && N >= 0 && K <= N)>::
34 ? Binomial<K - 1, N - 1>::value + Binomial<K, N - 1>::value
35 : 0
36 };
37};
38template <>
39struct Binomial<0, 0> {
40 enum { value = 1 };
41};
42template <int N>
43struct Binomial<N, N> {
44 enum { value = 1 };
45};
46template <int N>
47struct Binomial<0, N> {
48 enum { value = 1 };
49};
50
51} // namespace Bembel
52#endif // BEMBEL_SRC_SPLINE_PASCAL_HPP_
Routines for the evalutation of pointwise errors.
constexpr int getFunctionSpaceOutputDimension()
Here we hardcode the binomial coefficients through template recursion and perform bounds checking,...
Definition Pascal.hpp:23