Block-Structured AMR Software Framework
AMReX_Algorithm.H File Reference
#include <AMReX_Config.H>
#include <AMReX_GpuQualifiers.H>
#include <AMReX_Extension.H>
#include <AMReX_Dim3.H>
#include <AMReX_BLassert.H>
#include <AMReX_Math.H>
#include <algorithm>
#include <limits>
#include <type_traits>
#include <cstdint>
#include <climits>

Go to the source code of this file.

Classes

struct  amrex::detail::clzll_tag
 
struct  amrex::detail::clzl_tag
 
struct  amrex::detail::clz_tag
 

Namespaces

 amrex
 
 amrex::detail
 

Functions

template<class T >
AMREX_GPU_HOST_DEVICE constexpr AMREX_FORCE_INLINE const T & amrex::min (const T &a, const T &b) noexcept
 
template<class T , class ... Ts>
AMREX_GPU_HOST_DEVICE constexpr AMREX_FORCE_INLINE const T & amrex::min (const T &a, const T &b, const Ts &... c) noexcept
 
template<class T >
AMREX_GPU_HOST_DEVICE constexpr AMREX_FORCE_INLINE const T & amrex::max (const T &a, const T &b) noexcept
 
template<class T , class ... Ts>
AMREX_GPU_HOST_DEVICE constexpr AMREX_FORCE_INLINE const T & amrex::max (const T &a, const T &b, const Ts &... c) noexcept
 
template<class T >
AMREX_GPU_HOST_DEVICE constexpr AMREX_FORCE_INLINEamrex::elemwiseMin (T const &a, T const &b) noexcept
 
template<class T , class ... Ts>
AMREX_GPU_HOST_DEVICE constexpr AMREX_FORCE_INLINEamrex::elemwiseMin (const T &a, const T &b, const Ts &... c) noexcept
 
template<class T >
AMREX_GPU_HOST_DEVICE constexpr AMREX_FORCE_INLINEamrex::elemwiseMax (T const &a, T const &b) noexcept
 
template<class T , class ... Ts>
AMREX_GPU_HOST_DEVICE constexpr AMREX_FORCE_INLINEamrex::elemwiseMax (const T &a, const T &b, const Ts &... c) noexcept
 
template<typename T >
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void amrex::Swap (T &t1, T &t2) noexcept
 
template<typename T >
AMREX_GPU_HOST_DEVICE constexpr AMREX_FORCE_INLINE const T & amrex::Clamp (const T &v, const T &lo, const T &hi)
 
template<typename T >
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE std::enable_if_t< std::is_floating_point_v< T >, bool > amrex::almostEqual (T x, T y, int ulp=2)
 
template<class T , class F , std::enable_if_t< std::is_floating_point_v< T >, int > FOO = 0>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINEamrex::bisect (T lo, T hi, F f, T tol=1e-12, int max_iter=100)
 
template<typename T , typename I , std::enable_if_t< std::is_integral_v< I >, int > = 0>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINEamrex::bisect (T const *d, I lo, I hi, T const &v)
 
template<typename ItType , typename ValType >
AMREX_GPU_HOST_DEVICE ItType amrex::upper_bound (ItType first, ItType last, const ValType &val)
 
template<typename ItType , typename ValType >
AMREX_GPU_HOST_DEVICE ItType amrex::lower_bound (ItType first, ItType last, const ValType &val)
 
template<typename ItType , typename ValType , std::enable_if_t< std::is_floating_point_v< typename std::iterator_traits< ItType >::value_type > &&std::is_floating_point_v< ValType >, int > = 0>
AMREX_GPU_HOST_DEVICE void amrex::linspace (ItType first, const ItType &last, const ValType &start, const ValType &stop)
 
template<typename ItType , typename ValType , std::enable_if_t< std::is_floating_point_v< typename std::iterator_traits< ItType >::value_type > &&std::is_floating_point_v< ValType >, int > = 0>
AMREX_GPU_HOST_DEVICE void amrex::logspace (ItType first, const ItType &last, const ValType &start, const ValType &stop, const ValType &base)
 
template<class T , std::enable_if_t< std::is_same_v< std::decay_t< T >, std::uint8_t >||std::is_same_v< std::decay_t< T >, std::uint16_t >||std::is_same_v< std::decay_t< T >, std::uint32_t >||std::is_same_v< std::decay_t< T >, std::uint64_t >, int > = 0>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE int amrex::clz (T x) noexcept
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE int amrex::clz_generic (std::uint8_t x) noexcept
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE int amrex::clz_generic (std::uint16_t x) noexcept
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE int amrex::clz_generic (std::uint32_t x) noexcept
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE int amrex::clz_generic (std::uint64_t x) noexcept