248 std::memset(
static_cast<void*
>(&true_mask), 0xff,
sizeof(
T));
250 std::memset(
static_cast<void*
>(&false_mask), 0x00,
sizeof(
T));
252 std::vector<T> negative_values;
253 std::vector<T> non_negative_values;
260 const T pos_zero =
static_cast<T>(0.0);
261 const T pos_one =
static_cast<T>(1.0);
262 const T pos_inf = std::numeric_limits<T>::infinity();
263 const T pos_nan = std::numeric_limits<T>::quiet_NaN();
270 negative_values = {neg_zero, neg_one, neg_inf, neg_nan};
271 non_negative_values = {pos_zero, pos_one, pos_inf, pos_nan};
274 auto check_all = [](
auto values,
auto expected) {
275 bool all_pass =
true;
276 for (
T val : values) {
278 bool not_same =
internal::predux_any(internal::bitwise_helper<T>::bitwise_xor(expected, numext_val));
279 all_pass = all_pass && !not_same;
280 if (not_same) std::cout <<
"signbit(" <<
val <<
") = " << numext_val <<
" != " << expected << std::endl;
285 bool check_all_pass = check_all(non_negative_values, false_mask);
286 check_all_pass = check_all_pass && check_all(negative_values, (
NumTraits<T>::IsSigned ? true_mask : false_mask));
#define VERIFY(a)
Definition: main.h:362
EIGEN_STRONG_INLINE bool predux_any(const Packet4f &x)
Definition: AltiVec/PacketMath.h:2751
EIGEN_DEVICE_FUNC static constexpr EIGEN_ALWAYS_INLINE Scalar signbit(const Scalar &x)
Definition: MathFunctions.h:1419
T negate(const T &x)
Definition: packetmath_test_shared.h:26
val
Definition: calibrate.py:119
Holds information about the various numeric (i.e. scalar) types allowed by Eigen.
Definition: NumTraits.h:217