Skip to content
Snippets Groups Projects
Commit 3060885c authored by Adrian Burri's avatar Adrian Burri
Browse files

added power_m_p struct

[[Imported from SVN: r2268]]
parent 656b5a3f
No related branches found
No related tags found
No related merge requests found
......@@ -42,6 +42,28 @@ namespace Dune {
return t*t;
}
//! Calculates m^p at compile time
template <int m, int p>
struct Power_m_p
{
// power stores m^p
enum { power = (m * Power_m_p<m,p-1>::power ) };
};
// end of recursion via specialization
template <int m>
struct Power_m_p< m , 0>
{
// m^0 = 1
enum { power = 1 };
};
//********************************************************************
//
// generate filenames with timestep number in it
//
//********************************************************************
/** \brief Generate filenames with timestep number in it */
inline std::string genFilename(const std::string& path,
const std::string& fn,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment