$extrastylesheet
#include <utility.h>
Static Public Member Functions | |
| static T | apply (const T &x) |
An efficient template instantiation for raising to an arbitrary integer power.
| static T libMesh::Utility::do_pow< N, T >::apply | ( | const T & | x | ) | [inline, static] |
Definition at line 154 of file utility.h.
References libMesh::libmesh_assert().
Referenced by libMesh::Utility::pow().
{
libmesh_assert(N>1);
if (N%2) // odd exponent
return x * do_pow<N-1,T>::apply(x);
const T xNover2 = do_pow<N/2,T>::apply(x);
return xNover2*xNover2;
}