3#ifndef DUNE_COMMON_POWER_HH
4#define DUNE_COMMON_POWER_HH
18 template <
int m,
int p>
35 template <
int p,
bool odd = p%2>
49 static T eval(
const T & a)
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)
73 return a*Power<p-1>::eval(a);;
78 struct PowerImp<1,true>
81 static T eval(
const T & a)
Dune namespace.
Definition: alignment.hh:10
Compute power for a run-time mantissa and a compile-time integer exponent.
Definition: power.hh:47
Calculates m^p at compile time.
Definition: power.hh:20