3 #ifndef DUNE_COMMON_POWER_HH
4 #define DUNE_COMMON_POWER_HH
17 template <
int m,
int p>
35 template <
int p,
bool odd = p%2>
51 return PowerImp<p>::eval(a);
57 struct PowerImp<p,false>
60 static T eval(
const T & a)
62 T
t = Power<p/2>::eval(a);
68 struct PowerImp<p,true>
71 static T eval(
const T & a)
78 struct PowerImp<1,true>
81 static T eval(
const T & a)
T t
Definition: alignment.hh:38
Dune namespace.
Definition: alignment.hh:13
Compute power for a run-time mantissa and a compile-time integer exponent.
Definition: power.hh:46
static T eval(const T &a)
Definition: power.hh:49
Calculates m^p at compile time.
Definition: power.hh:19