|
template<typename List , Requires< not tt::is_a_v< tmpl::list, tmpl::front< List > > > = nullptr> |
KOKKOS_FUNCTION constexpr auto | make_cpp20_array_from_list () -> cpp20::array< std::decay_t< decltype(tmpl::front< List >::value)>, tmpl::size< List >::value > |
| Make an array from a typelist that holds std::integral_constant's all of which have the same value_type More...
|
|
template<typename T , Requires< tt::is_integer_v< T > and std::is_unsigned_v< T > > = nullptr> |
constexpr T | two_to_the (T n) |
| Compute 2 to the n for integral types. More...
|
|
constexpr size_t | get_nth_bit (const size_t i, const size_t N) |
| Get the nth bit from the right, counting from zero. More...
|
|
template<typename T > |
constexpr decltype(auto) | square (const T &x) |
| Compute the square of x
|
|
template<typename T > |
constexpr decltype(auto) | cube (const T &x) |
| Compute the cube of x
|
|
KOKKOS_FUNCTION constexpr uint64_t | falling_factorial (const uint64_t x, const uint64_t n) |
| Compute the falling factorial of \((x)_{n}\). More...
|
|
KOKKOS_FUNCTION constexpr uint64_t | factorial (const uint64_t n) |
| Compute the factorial of \(n!\).
|
|
template<int N, typename T > |
constexpr decltype(auto) | pow (const T &t) |
| Compute t^N where N is an integer (positive or negative) More...
|
|
template<typename T , Requires< tt::is_integer_v< T > or std::is_floating_point_v< T > > = nullptr> |
KOKKOS_FUNCTION constexpr T | ce_abs (const T &x) |
| Compute the absolute value of of its argument. More...
|
|
KOKKOS_FUNCTION constexpr double | ce_fabs (const double x) |
| Compute the absolute value of its argument.
|
|
template<size_t NumTerms, typename Function , Requires< NumTerms==1 > = nullptr> |
constexpr decltype(auto) | constexpr_sum (Function &&f) |
| Returns f(ic<0>{}) + f(ic<1>{}) + ... + f(ic<NumTerms-1>{}) where ic<N> stands for std::integral_constant<size_t, N> . This function allows the result types of each operation to be different, and so works efficiently with expression templates. More...
|
|
template<typename List , Requires< not tt::is_a_v< tmpl::list, tmpl::front< List > > > = nullptr> |
constexpr auto | make_array_from_list () -> std::array< std::decay_t< decltype(tmpl::front< List >::value)>, tmpl::size< List >::value > |
| Make an array from a typelist that holds std::integral_constant's all of which have the same value_type More...
|
|
constexpr size_t | cstring_length (const char *str) |
| Compute the length of a const char* at compile time.
|
|
constexpr size_t | cstring_hash (const char *str) |
| Compute a hash of a const char* at compile time.
|
|
template<size_t I, typename T , size_t Size> |
constexpr std::array< std::decay_t< T >, Size > | replace_at (const std::array< T, Size > &arr, T value) |
| Replace at compile time the I th entry in the array with value
|
|
template<typename T , typename S , size_t size> |
constexpr bool | array_equal (const std::array< T, size > &lhs, const std::array< S, size > &rhs, const size_t i=0) |
| Check at compile time if two std::array s are equal.
|
|
template<typename T > |
constexpr const T & | max_by_magnitude (const T &a, const T &b) |
| Return the argument with the largest magnitude. More...
|
|
template<typename T > |
constexpr T | max_by_magnitude (std::initializer_list< T > ilist) |
| Return the argument with the largest magnitude. More...
|
|
template<typename T > |
constexpr const T & | min_by_magnitude (const T &a, const T &b) |
| Return the argument with the smallest magnitude. More...
|
|
template<typename T > |
constexpr T | min_by_magnitude (std::initializer_list< T > ilist) |
| Return the argument with the smallest magnitude. More...
|
|
Contains an assortment of constexpr functions.
Contains an assortment of constexpr functions that are useful for metaprogramming, or efficient mathematical computations, such as exponentiating to an integer power, where the power is known at compile time.
Contains an assortment of constexpr functions that are useful for metaprogramming, or efficient mathematical computations, such as exponentiating to an integer power, where the power is known at compile time.