#pragma once #include namespace bts { struct MathUtils { /** * Compute 'N!' */ template static constexpr std::uint32_t factorial(); /** * Compute 'n!' */ template static T factorial(T n); /** * Compute 'n!/(n-a)!' */ template static T factorial_trunc(T n, T a); /** * Compute 'N choose A' */ template static constexpr std::uint32_t choose(); /** * Compute 'n choose a' */ template static T choose(T n, T a); }; } // namespace bts #include "MathUtils.cc"