/home/runner/work/DiFfRG_current/DiFfRG_current/DiFfRG/include/DiFfRG/common/math.hh File Reference#

DiFfRG: /home/runner/work/DiFfRG_current/DiFfRG_current/DiFfRG/include/DiFfRG/common/math.hh File Reference
DiFfRG
math.hh File Reference
#include <DiFfRG/common/complex_math.hh>
#include <DiFfRG/common/kokkos.hh>
#include <cmath>
#include <autodiff/forward/real.hpp>
#include <type_traits>

Go to the source code of this file.

Namespaces

namespace  DiFfRG
 
namespace  DiFfRG::compute
 

Functions

template<size_t N, typename T >
bool DiFfRG::isfinite (const autodiff::Real< N, T > &x)
 Finite-ness check for autodiff::real.
 
template<int n, typename NumberType >
requires requires(NumberType x) { x * x; NumberType(1.) / x; }
constexpr KOKKOS_INLINE_FUNCTION NumberType DiFfRG::powr (const NumberType x)
 A compile-time evaluatable power function for whole number exponents.
 
template<typename NumberType >
requires std::is_integral_v<NumberType>
constexpr KOKKOS_INLINE_FUNCTION NumberType DiFfRG::factorial (const NumberType &x)
 
template<typename NT >
constexpr KOKKOS_INLINE_FUNCTION double DiFfRG::V_d (NT d)
 Volume of a d-dimensional sphere.
 
template<typename NT1 , typename NT2 >
constexpr KOKKOS_INLINE_FUNCTION double DiFfRG::V_d (NT1 d, NT2 extent)
 Volume of a d-dimensional sphere with extent.
 
template<typename NT >
constexpr KOKKOS_INLINE_FUNCTION double DiFfRG::S_d (NT d)
 Surface of a d-dimensional sphere.
 
template<typename NT >
consteval NT DiFfRG::S_d_prec (uint d)
 Surface of a d-dimensional sphere (precompiled)
 
template<typename NumberType >
requires requires(NumberType x) { x >= 0; }
constexpr KOKKOS_INLINE_FUNCTION auto DiFfRG::heaviside_theta (const NumberType x)
 A compile-time evaluatable theta function.
 
template<typename NumberType >
requires requires(NumberType x) { x >= 0; }
constexpr KOKKOS_INLINE_FUNCTION auto DiFfRG::sign (const NumberType x)
 A compile-time evaluatable sign function.
 
template<typename T1 , typename T2 , typename T3 >
requires (std::is_floating_point<T1>::value || std::is_same_v<T1, autodiff::real> || is_complex<T1>::value) && (std::is_floating_point<T2>::value || std::is_same_v<T2, autodiff::real> || is_complex<T2>::value) && std::is_floating_point<T3>::value
bool KOKKOS_INLINE_FUNCTION DiFfRG::is_close (T1 a, T2 b, T3 eps_)
 Function to evaluate whether two floats are equal to numerical precision. Tests for both relative and absolute equality.
 
template<typename T1 , typename T2 >
requires (std::is_floating_point<T1>::value || std::is_same_v<T1, autodiff::real> || is_complex<T1>::value) && (std::is_floating_point<T2>::value || std::is_same_v<T2, autodiff::real> || is_complex<T1>::value)
bool KOKKOS_INLINE_FUNCTION DiFfRG::is_close (T1 a, T2 b)
 Function to evaluate whether two floats are equal to numerical precision. Tests for both relative and absolute equality.
 
template<uint n, typename NT , typename A1 , typename A2 >
requires requires(A1 a1, A2 a2) { a1[0] * a2[0]; }
NT DiFfRG::dot (const A1 &a1, const A2 &a2)
 A dot product which takes the dot product between a1 and a2, assuming each has n entries which can be accessed via the [] operator.
 
template<typename T1 , typename T2 , typename T3 >
requires (!std::is_arithmetic_v<T1> || !std::is_arithmetic_v<T2> || !std::is_arithmetic_v<T3>)
constexpr KOKKOS_FORCEINLINE_FUNCTION auto DiFfRG::compute::fma (const T1 &a, const T2 &b, const T3 &c)
 
template<size_t N, typename T >
requires std::is_arithmetic_v<T>
constexpr KOKKOS_FORCEINLINE_FUNCTION T DiFfRG::compute::conj (const autodiff::Real< N, T > x)
 
template<size_t N, typename T >
requires std::is_arithmetic_v<T>
constexpr KOKKOS_FORCEINLINE_FUNCTION T DiFfRG::compute::conj (const cxReal< N, T > x)
 
template<typename T >
requires std::is_arithmetic_v<T>
constexpr KOKKOS_FORCEINLINE_FUNCTION T DiFfRG::compute::conj (const T x)
 
template<typename T >
requires is_complex<T>::value
constexpr KOKKOS_FORCEINLINE_FUNCTION T DiFfRG::compute::conj (const T x)
 
template<typename NT >
constexpr auto DiFfRG::compute::cot (const NT x)
 
template<typename NT >
constexpr auto DiFfRG::compute::coth (const NT x)