mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Bug #1777: make the scalar and packet path consistent for the logistic function + respective unit test
This commit is contained in:
@@ -447,6 +447,21 @@ template<typename Scalar,typename Packet> void packetmath_real()
|
||||
VERIFY((numext::isnan)(data2[0]));
|
||||
}
|
||||
|
||||
{
|
||||
internal::scalar_logistic_op<Scalar> logistic;
|
||||
for (int i=0; i<size; ++i)
|
||||
{
|
||||
data1[i] = internal::random<Scalar>(-20,20);
|
||||
}
|
||||
internal::pstore(data2, logistic.packetOp(internal::pload<Packet>(data1)));
|
||||
for (int i=0; i<PacketSize; ++i) {
|
||||
VERIFY_IS_APPROX(data2[i],logistic(data1[i]));
|
||||
#ifdef EIGEN_VECTORIZE // don't check for exactness when using the i387 FPU
|
||||
VERIFY_IS_EQUAL(data2[i],logistic(data1[i]));
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
#if EIGEN_HAS_C99_MATH && (__cplusplus > 199711L)
|
||||
data1[0] = std::numeric_limits<Scalar>::infinity();
|
||||
data1[1] = Scalar(-1);
|
||||
|
||||
Reference in New Issue
Block a user