MCKL
Monte Carlo Kernel Library
Namespaces | Macros | Functions
Floating point classification

Namespaces

 mckl::internal
 

Macros

#define MCKL_DEFINE_MATH_VMF_FPCLASSIFY_COUNT(func, test)
 
#define MCKL_DEFINE_MATH_VMF_FPCLASSIFY_FIND(func, test)
 

Functions

template<typename T >
std::size_t mckl::count_finite (std::size_t n, const T *a)
 Return the number of elements that are finite. More...
 
template<typename T >
std::size_t mckl::count_finite (std::size_t n, const std::complex< T > *a)
 
template<typename T >
std::size_t mckl::count_inf (std::size_t n, const T *a)
 Return the number of elements that are infinity. More...
 
template<typename T >
std::size_t mckl::count_inf (std::size_t n, const std::complex< T > *a)
 
template<typename T >
std::size_t mckl::count_nan (std::size_t n, const T *a)
 Return the number of elements that are nan. More...
 
template<typename T >
std::size_t mckl::count_nan (std::size_t n, const std::complex< T > *a)
 
template<typename T >
std::size_t mckl::count_normal (std::size_t n, const T *a)
 Return the number of elements that are normal. More...
 
template<typename T >
std::size_t mckl::count_normal (std::size_t n, const std::complex< T > *a)
 
template<typename T >
std::size_t mckl::count_not_finite (std::size_t n, const T *a)
 Return the number of elements that are not finite. More...
 
template<typename T >
std::size_t mckl::count_not_finite (std::size_t n, const std::complex< T > *a)
 
template<typename T >
std::size_t mckl::count_not_inf (std::size_t n, const T *a)
 Return the number of elements that are not infinity. More...
 
template<typename T >
std::size_t mckl::count_not_inf (std::size_t n, const std::complex< T > *a)
 
template<typename T >
std::size_t mckl::count_not_nan (std::size_t n, const T *a)
 Return the number of elements that are not nan. More...
 
template<typename T >
std::size_t mckl::count_not_nan (std::size_t n, const std::complex< T > *a)
 
template<typename T >
std::size_t mckl::count_not_normal (std::size_t n, const T *a)
 Return the number of elements that are not normal. More...
 
template<typename T >
std::size_t mckl::count_not_normal (std::size_t n, const std::complex< T > *a)
 
template<typename T >
std::size_t mckl::count_not_subnormal (std::size_t n, const T *a)
 Return the number of elements that are not subnormal. More...
 
template<typename T >
std::size_t mckl::count_not_subnormal (std::size_t n, const std::complex< T > *a)
 
template<typename T >
std::size_t mckl::count_not_zero (std::size_t n, const std::complex< T > *a)
 
template<typename T >
std::size_t mckl::count_not_zero (std::size_t n, const T *a)
 Return the number of elements that are not zero. More...
 
template<typename T >
std::size_t mckl::count_subnormal (std::size_t n, const std::complex< T > *a)
 
template<typename T >
std::size_t mckl::count_subnormal (std::size_t n, const T *a)
 Return the number of elements that are subnormal. More...
 
template<typename T >
std::size_t mckl::count_zero (std::size_t n, const T *a)
 Return the number of elements that are zero. More...
 
template<typename T >
std::size_t mckl::count_zero (std::size_t n, const std::complex< T > *a)
 
template<typename T >
std::size_t mckl::find_finite (std::size_t n, const std::complex< T > *a)
 
template<typename T >
std::size_t mckl::find_finite (std::size_t n, const T *a)
 Return the index of the first element that is finite. More...
 
template<typename T >
std::size_t mckl::find_inf (std::size_t n, const T *a)
 Return the index of the first element that is infinity. More...
 
template<typename T >
std::size_t mckl::find_inf (std::size_t n, const std::complex< T > *a)
 
template<typename T >
std::size_t mckl::find_nan (std::size_t n, const T *a)
 Return the index of the first element that is nan. More...
 
template<typename T >
std::size_t mckl::find_nan (std::size_t n, const std::complex< T > *a)
 
template<typename T >
std::size_t mckl::find_normal (std::size_t n, const std::complex< T > *a)
 
template<typename T >
std::size_t mckl::find_normal (std::size_t n, const T *a)
 Return the index of the first element that is normal. More...
 
template<typename T >
std::size_t mckl::find_not_finite (std::size_t n, const T *a)
 Return the index of the first element that is not finite. More...
 
template<typename T >
std::size_t mckl::find_not_finite (std::size_t n, const std::complex< T > *a)
 
template<typename T >
std::size_t mckl::find_not_inf (std::size_t n, const std::complex< T > *a)
 
template<typename T >
std::size_t mckl::find_not_inf (std::size_t n, const T *a)
 Return the index of the first element that is not infinity. More...
 
template<typename T >
std::size_t mckl::find_not_nan (std::size_t n, const std::complex< T > *a)
 
template<typename T >
std::size_t mckl::find_not_nan (std::size_t n, const T *a)
 Return the index of the first element that is not nan. More...
 
template<typename T >
std::size_t mckl::find_not_normal (std::size_t n, const std::complex< T > *a)
 
template<typename T >
std::size_t mckl::find_not_normal (std::size_t n, const T *a)
 Return the index of the first element that is not normal. More...
 
template<typename T >
std::size_t mckl::find_not_subnormal (std::size_t n, const T *a)
 Return the index of the first element that is not subnormal. More...
 
template<typename T >
std::size_t mckl::find_not_subnormal (std::size_t n, const std::complex< T > *a)
 
template<typename T >
std::size_t mckl::find_not_zero (std::size_t n, const T *a)
 Return the index of the first element that is not zero. More...
 
template<typename T >
std::size_t mckl::find_not_zero (std::size_t n, const std::complex< T > *a)
 
template<typename T >
std::size_t mckl::find_subnormal (std::size_t n, const std::complex< T > *a)
 
template<typename T >
std::size_t mckl::find_subnormal (std::size_t n, const T *a)
 Return the index of the first element that is subnormal. More...
 
template<typename T >
std::size_t mckl::find_zero (std::size_t n, const T *a)
 Return the index of the first element that is zero. More...
 
template<typename T >
std::size_t mckl::find_zero (std::size_t n, const std::complex< T > *a)
 

Detailed Description

Macro Definition Documentation

◆ MCKL_DEFINE_MATH_VMF_FPCLASSIFY_COUNT

#define MCKL_DEFINE_MATH_VMF_FPCLASSIFY_COUNT (   func,
  test 
)
Value:
template <typename T> \
inline std::size_t count_##func(std::size_t n, const T *a) \
{ \
std::size_t c = 0; \
for (std::size_t i = 0; i != n; ++i, ++a) \
if (test(*a)) \
++c; \
return c; \
} \
\
template <typename T> \
inline std::size_t count_##func(std::size_t n, const std::complex<T> *a) \
{ \
return count_##func(n * 2, reinterpret_cast<const T *>(a)) / 2; \
}

Definition at line 1497 of file vmf.hpp.

◆ MCKL_DEFINE_MATH_VMF_FPCLASSIFY_FIND

#define MCKL_DEFINE_MATH_VMF_FPCLASSIFY_FIND (   func,
  test 
)
Value:
template <typename T> \
inline std::size_t find_##func(std::size_t n, const T *a) \
{ \
for (std::size_t i = 0; i != n; ++i, ++a) \
if (test(*a)) \
return i; \
return n; \
} \
\
template <typename T> \
inline std::size_t find_##func(std::size_t n, const std::complex<T> *a) \
{ \
return find_##func(n * 2, reinterpret_cast<const T *>(a)) / 2; \
}

Definition at line 1481 of file vmf.hpp.

Function Documentation

◆ count_finite() [1/2]

template<typename T >
std::size_t mckl::count_finite ( std::size_t  n,
const T *  a 
)
inline

Return the number of elements that are finite.

Definition at line 1573 of file vmf.hpp.

◆ count_finite() [2/2]

template<typename T >
std::size_t mckl::count_finite ( std::size_t  n,
const std::complex< T > *  a 
)
inline

Definition at line 1573 of file vmf.hpp.

◆ count_inf() [1/2]

template<typename T >
std::size_t mckl::count_inf ( std::size_t  n,
const T *  a 
)
inline

Return the number of elements that are infinity.

Definition at line 1567 of file vmf.hpp.

◆ count_inf() [2/2]

template<typename T >
std::size_t mckl::count_inf ( std::size_t  n,
const std::complex< T > *  a 
)
inline

Definition at line 1567 of file vmf.hpp.

◆ count_nan() [1/2]

template<typename T >
std::size_t mckl::count_nan ( std::size_t  n,
const T *  a 
)
inline

Return the number of elements that are nan.

Definition at line 1570 of file vmf.hpp.

◆ count_nan() [2/2]

template<typename T >
std::size_t mckl::count_nan ( std::size_t  n,
const std::complex< T > *  a 
)
inline

Definition at line 1570 of file vmf.hpp.

◆ count_normal() [1/2]

template<typename T >
std::size_t mckl::count_normal ( std::size_t  n,
const T *  a 
)
inline

Return the number of elements that are normal.

Definition at line 1558 of file vmf.hpp.

◆ count_normal() [2/2]

template<typename T >
std::size_t mckl::count_normal ( std::size_t  n,
const std::complex< T > *  a 
)
inline

Definition at line 1558 of file vmf.hpp.

◆ count_not_finite() [1/2]

template<typename T >
std::size_t mckl::count_not_finite ( std::size_t  n,
const T *  a 
)
inline

Return the number of elements that are not finite.

Definition at line 1609 of file vmf.hpp.

◆ count_not_finite() [2/2]

template<typename T >
std::size_t mckl::count_not_finite ( std::size_t  n,
const std::complex< T > *  a 
)
inline

Definition at line 1609 of file vmf.hpp.

◆ count_not_inf() [1/2]

template<typename T >
std::size_t mckl::count_not_inf ( std::size_t  n,
const T *  a 
)
inline

Return the number of elements that are not infinity.

Definition at line 1603 of file vmf.hpp.

◆ count_not_inf() [2/2]

template<typename T >
std::size_t mckl::count_not_inf ( std::size_t  n,
const std::complex< T > *  a 
)
inline

Definition at line 1603 of file vmf.hpp.

◆ count_not_nan() [1/2]

template<typename T >
std::size_t mckl::count_not_nan ( std::size_t  n,
const T *  a 
)
inline

Return the number of elements that are not nan.

Definition at line 1606 of file vmf.hpp.

◆ count_not_nan() [2/2]

template<typename T >
std::size_t mckl::count_not_nan ( std::size_t  n,
const std::complex< T > *  a 
)
inline

Definition at line 1606 of file vmf.hpp.

◆ count_not_normal() [1/2]

template<typename T >
std::size_t mckl::count_not_normal ( std::size_t  n,
const T *  a 
)
inline

Return the number of elements that are not normal.

Definition at line 1594 of file vmf.hpp.

◆ count_not_normal() [2/2]

template<typename T >
std::size_t mckl::count_not_normal ( std::size_t  n,
const std::complex< T > *  a 
)
inline

Definition at line 1594 of file vmf.hpp.

◆ count_not_subnormal() [1/2]

template<typename T >
std::size_t mckl::count_not_subnormal ( std::size_t  n,
const T *  a 
)
inline

Return the number of elements that are not subnormal.

Definition at line 1597 of file vmf.hpp.

◆ count_not_subnormal() [2/2]

template<typename T >
std::size_t mckl::count_not_subnormal ( std::size_t  n,
const std::complex< T > *  a 
)
inline

Definition at line 1597 of file vmf.hpp.

◆ count_not_zero() [1/2]

template<typename T >
std::size_t mckl::count_not_zero ( std::size_t  n,
const std::complex< T > *  a 
)
inline

Definition at line 1600 of file vmf.hpp.

◆ count_not_zero() [2/2]

template<typename T >
std::size_t mckl::count_not_zero ( std::size_t  n,
const T *  a 
)
inline

Return the number of elements that are not zero.

Definition at line 1600 of file vmf.hpp.

◆ count_subnormal() [1/2]

template<typename T >
std::size_t mckl::count_subnormal ( std::size_t  n,
const std::complex< T > *  a 
)
inline

Definition at line 1561 of file vmf.hpp.

◆ count_subnormal() [2/2]

template<typename T >
std::size_t mckl::count_subnormal ( std::size_t  n,
const T *  a 
)
inline

Return the number of elements that are subnormal.

Definition at line 1561 of file vmf.hpp.

◆ count_zero() [1/2]

template<typename T >
std::size_t mckl::count_zero ( std::size_t  n,
const T *  a 
)
inline

Return the number of elements that are zero.

Definition at line 1564 of file vmf.hpp.

◆ count_zero() [2/2]

template<typename T >
std::size_t mckl::count_zero ( std::size_t  n,
const std::complex< T > *  a 
)
inline

Definition at line 1564 of file vmf.hpp.

◆ find_finite() [1/2]

template<typename T >
std::size_t mckl::find_finite ( std::size_t  n,
const std::complex< T > *  a 
)
inline

Definition at line 1555 of file vmf.hpp.

◆ find_finite() [2/2]

template<typename T >
std::size_t mckl::find_finite ( std::size_t  n,
const T *  a 
)
inline

Return the index of the first element that is finite.

Definition at line 1555 of file vmf.hpp.

◆ find_inf() [1/2]

template<typename T >
std::size_t mckl::find_inf ( std::size_t  n,
const T *  a 
)
inline

Return the index of the first element that is infinity.

Definition at line 1549 of file vmf.hpp.

◆ find_inf() [2/2]

template<typename T >
std::size_t mckl::find_inf ( std::size_t  n,
const std::complex< T > *  a 
)
inline

Definition at line 1549 of file vmf.hpp.

◆ find_nan() [1/2]

template<typename T >
std::size_t mckl::find_nan ( std::size_t  n,
const T *  a 
)
inline

Return the index of the first element that is nan.

Definition at line 1552 of file vmf.hpp.

◆ find_nan() [2/2]

template<typename T >
std::size_t mckl::find_nan ( std::size_t  n,
const std::complex< T > *  a 
)
inline

Definition at line 1552 of file vmf.hpp.

◆ find_normal() [1/2]

template<typename T >
std::size_t mckl::find_normal ( std::size_t  n,
const std::complex< T > *  a 
)
inline

Definition at line 1540 of file vmf.hpp.

◆ find_normal() [2/2]

template<typename T >
std::size_t mckl::find_normal ( std::size_t  n,
const T *  a 
)
inline

Return the index of the first element that is normal.

Definition at line 1540 of file vmf.hpp.

◆ find_not_finite() [1/2]

template<typename T >
std::size_t mckl::find_not_finite ( std::size_t  n,
const T *  a 
)
inline

Return the index of the first element that is not finite.

Definition at line 1591 of file vmf.hpp.

◆ find_not_finite() [2/2]

template<typename T >
std::size_t mckl::find_not_finite ( std::size_t  n,
const std::complex< T > *  a 
)
inline

Definition at line 1591 of file vmf.hpp.

◆ find_not_inf() [1/2]

template<typename T >
std::size_t mckl::find_not_inf ( std::size_t  n,
const std::complex< T > *  a 
)
inline

Definition at line 1585 of file vmf.hpp.

◆ find_not_inf() [2/2]

template<typename T >
std::size_t mckl::find_not_inf ( std::size_t  n,
const T *  a 
)
inline

Return the index of the first element that is not infinity.

Definition at line 1585 of file vmf.hpp.

◆ find_not_nan() [1/2]

template<typename T >
std::size_t mckl::find_not_nan ( std::size_t  n,
const std::complex< T > *  a 
)
inline

Definition at line 1588 of file vmf.hpp.

◆ find_not_nan() [2/2]

template<typename T >
std::size_t mckl::find_not_nan ( std::size_t  n,
const T *  a 
)
inline

Return the index of the first element that is not nan.

Definition at line 1588 of file vmf.hpp.

◆ find_not_normal() [1/2]

template<typename T >
std::size_t mckl::find_not_normal ( std::size_t  n,
const std::complex< T > *  a 
)
inline

Definition at line 1576 of file vmf.hpp.

◆ find_not_normal() [2/2]

template<typename T >
std::size_t mckl::find_not_normal ( std::size_t  n,
const T *  a 
)
inline

Return the index of the first element that is not normal.

Definition at line 1576 of file vmf.hpp.

◆ find_not_subnormal() [1/2]

template<typename T >
std::size_t mckl::find_not_subnormal ( std::size_t  n,
const T *  a 
)
inline

Return the index of the first element that is not subnormal.

Definition at line 1579 of file vmf.hpp.

◆ find_not_subnormal() [2/2]

template<typename T >
std::size_t mckl::find_not_subnormal ( std::size_t  n,
const std::complex< T > *  a 
)
inline

Definition at line 1579 of file vmf.hpp.

◆ find_not_zero() [1/2]

template<typename T >
std::size_t mckl::find_not_zero ( std::size_t  n,
const T *  a 
)
inline

Return the index of the first element that is not zero.

Definition at line 1582 of file vmf.hpp.

◆ find_not_zero() [2/2]

template<typename T >
std::size_t mckl::find_not_zero ( std::size_t  n,
const std::complex< T > *  a 
)
inline

Definition at line 1582 of file vmf.hpp.

◆ find_subnormal() [1/2]

template<typename T >
std::size_t mckl::find_subnormal ( std::size_t  n,
const std::complex< T > *  a 
)
inline

Definition at line 1543 of file vmf.hpp.

◆ find_subnormal() [2/2]

template<typename T >
std::size_t mckl::find_subnormal ( std::size_t  n,
const T *  a 
)
inline

Return the index of the first element that is subnormal.

Definition at line 1543 of file vmf.hpp.

◆ find_zero() [1/2]

template<typename T >
std::size_t mckl::find_zero ( std::size_t  n,
const T *  a 
)
inline

Return the index of the first element that is zero.

Definition at line 1546 of file vmf.hpp.

◆ find_zero() [2/2]

template<typename T >
std::size_t mckl::find_zero ( std::size_t  n,
const std::complex< T > *  a 
)
inline

Definition at line 1546 of file vmf.hpp.