14 #define VERIFY_HALF_BITS_EQUAL(h, bits) \ 15 VERIFY_IS_EQUAL((numext::bit_cast<numext::uint16_t>(h)), (static_cast<numext::uint16_t>(bits))) 30 numext::bit_cast<half>(numext::bit_cast<numext::uint16_t>(
half(1.0
f))),
33 numext::bit_cast<half>(numext::bit_cast<numext::uint16_t>(
half(0.5
f))),
36 numext::bit_cast<half>(numext::bit_cast<numext::uint16_t>(
half(-0.33333
f))),
39 numext::bit_cast<half>(numext::bit_cast<numext::uint16_t>(
half(0.0
f))),
57 float val1 =
float(
half(__half_raw(0x3c00)));
58 float val2 =
float(
half(__half_raw(0x3c01)));
59 float val3 =
float(
half(__half_raw(0x3c02)));
116 VERIFY(static_cast<bool>(
half(__half_raw(0x7bff))));
129 std::cout <<
"denorm min = " << (std::numeric_limits<half>::denorm_min)() <<
" (0x" << std::hex << numext::bit_cast<numext::uint16_t>(
half((std::numeric_limits<half>::denorm_min)())) <<
")" << std::endl;
132 std::cout <<
"signaling nan = " << std::numeric_limits<half>::signaling_NaN() <<
" (0x" << std::hex << numext::bit_cast<numext::uint16_t>(std::numeric_limits<half>::signaling_NaN()) <<
")" << std::endl;
137 numext::bit_cast<numext::uint16_t>(std::numeric_limits<half>::infinity()),
138 numext::bit_cast<numext::uint16_t>(
half(std::numeric_limits<float>::infinity())) );
146 && ((numext::bit_cast<numext::uint16_t>(std::numeric_limits<half>::quiet_NaN()) & HALF_QUIET_BIT) > 0)
147 && ((numext::bit_cast<numext::uint16_t>(
half(std::numeric_limits<float>::quiet_NaN())) & HALF_QUIET_BIT) > 0) );
154 && ((numext::bit_cast<numext::uint16_t>(std::numeric_limits<half>::signaling_NaN()) & HALF_QUIET_BIT) == 0) );
157 VERIFY( (std::numeric_limits<half>::denorm_min)() >
half(0.
f) );
305 Index size = internal::random<Index>(1,10);
306 Index i = internal::random<Index>(0,size-1);
307 ArrayXh
a1 = ArrayXh::Random(size),
a2 = ArrayXh::Random(size);
312 VERIFY( ((a1.min)(
a2) <= (a1.max)(
a2)).all() );
318 std::stringstream
ss;
328 MatrixXh Ah = MatrixXh::Random(rows,depth);
329 MatrixXh Bh = MatrixXh::Random(depth,cols);
330 MatrixXh Ch = MatrixXh::Random(rows,cols);
331 MatrixXf Af = Ah.cast<
float>();
332 MatrixXf Bf = Bh.cast<
float>();
333 MatrixXf Cf = Ch.cast<
float>();
EIGEN_DEVICE_FUNC const Log1pReturnType log1p() const
Jet< T, N > cos(const Jet< T, N > &f)
static const Eigen::internal::all_t all
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE T exp(const T &x)
Jet< T, N > sin(const Jet< T, N > &f)
Namespace containing all symbols from the Eigen library.
Holds information about the various numeric (i.e. scalar) types allowed by Eigen. ...
void test_basic_functions()
#define VERIFY_HALF_BITS_EQUAL(h, bits)
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE T cos(const T &x)
EIGEN_DEVICE_FUNC const LogReturnType log() const
EIGEN_DEVICE_FUNC T() ceil(const T &x)
EIGEN_DEVICE_FUNC const ExpReturnType exp() const
EIGEN_DEVICE_FUNC const FloorReturnType floor() const
#define VERIFY_IS_APPROX(a, b)
EIGEN_DECLARE_TEST(half_float)
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE internal::enable_if< NumTraits< T >::IsSigned||NumTraits< T >::IsComplex, typename NumTraits< T >::Real >::type abs(const T &x)
#define VERIFY_IS_EQUAL(a, b)
EIGEN_DEVICE_FUNC const Expm1ReturnType expm1() const
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 fmod(const bfloat16 &a, const bfloat16 &b)
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE T tan(const T &x)
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
EIGEN_DEVICE_FUNC T() floor(const T &x)
Point2(* f)(const Point3 &, OptionalJacobian< 2, 3 >)
Array< double, 1, 3 > e(1./3., 0.5, 2.)
void test_trigonometric_functions()
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE T sin(const T &x)
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE bool() isinf(const Eigen::bfloat16 &h)
static std::stringstream ss
EIGEN_DEVICE_FUNC internal::pow_impl< ScalarX, ScalarY >::result_type pow(const ScalarX &x, const ScalarY &y)
#define CALL_SUBTEST(FUNC)
#define EIGEN_TEST_MAX_SIZE
EIGEN_DEVICE_FUNC const TanReturnType tan() const
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE bool() isnan(const Eigen::bfloat16 &h)
General-purpose arrays with easy API for coefficient-wise operations.
Jet< T, N > sqrt(const Jet< T, N > &f)
Jet< T, N > pow(const Jet< T, N > &f, double g)
The matrix class, also used for vectors and row-vectors.
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE T log(const T &x)
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE float sqrt(const float &x)
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy x
EIGEN_DEVICE_FUNC const CeilReturnType ceil() const
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE T fmod(const T &a, const T &b)