mirror of
https://gitlab.com/libeigen/eigen.git
synced 2024-12-15 07:10:37 +08:00
Fixed a couple of typos
Cleaned up the code a bit.
This commit is contained in:
parent
fa4f933c0f
commit
73b68d4370
@ -43,7 +43,7 @@ struct default_packet_traits
|
||||
{
|
||||
enum {
|
||||
HasHalfPacket = 0,
|
||||
|
||||
|
||||
HasAdd = 1,
|
||||
HasSub = 1,
|
||||
HasMul = 1,
|
||||
@ -76,7 +76,7 @@ struct default_packet_traits
|
||||
HasTanh = 0,
|
||||
HasLGamma = 0,
|
||||
HasErf = 0,
|
||||
HasErfc = 0
|
||||
HasErfc = 0,
|
||||
|
||||
HasRound = 0,
|
||||
HasFloor = 0,
|
||||
|
@ -1,7 +1,6 @@
|
||||
// This file is part of Eigen, a lightweight C++ template library
|
||||
// for linear algebra.
|
||||
//
|
||||
// Copyright (C) 2006-2010 Benoit Jacob <jacob.benoit.1@gmail.com>
|
||||
// Copyright (C) 2015 Eugene Brevdo <ebrevdo@gmail.com>
|
||||
//
|
||||
// This Source Code Form is subject to the terms of the Mozilla
|
||||
@ -45,14 +44,13 @@ template <> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE double __erfc<double>(double x
|
||||
} // end namespace internal
|
||||
|
||||
/****************************************************************************
|
||||
* Implementations *
|
||||
* Implementations *
|
||||
****************************************************************************/
|
||||
|
||||
namespace internal {
|
||||
|
||||
/****************************************************************************
|
||||
* Implementation of
|
||||
* lgamma *
|
||||
* Implementation of lgamma *
|
||||
****************************************************************************/
|
||||
|
||||
template<typename Scalar>
|
||||
@ -72,8 +70,7 @@ struct lgamma_retval
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
* Implementation of
|
||||
* erf *
|
||||
* Implementation of erf *
|
||||
****************************************************************************/
|
||||
|
||||
template<typename Scalar>
|
||||
@ -92,8 +89,8 @@ struct erf_retval
|
||||
typedef Scalar type;
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
* Implementation of erfc *
|
||||
/***************************************************************************
|
||||
* Implementation of erfc *
|
||||
****************************************************************************/
|
||||
|
||||
template<typename Scalar>
|
||||
|
@ -294,12 +294,6 @@ struct stem_function
|
||||
};
|
||||
}
|
||||
|
||||
// SpecialFunctions forward declarations
|
||||
namespace internal {
|
||||
template <typename Scalar> EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC Scalar __lgamma(Scalar x);
|
||||
template <typename Scalar> EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC Scalar __erf(Scalar x);
|
||||
template <typename Scalar> EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC Scalar __erfc(Scalar x);
|
||||
|
||||
} // end namespace Eigen
|
||||
|
||||
#endif // EIGEN_FORWARDDECLARATIONS_H
|
||||
|
@ -355,19 +355,19 @@ template<typename Scalar> void packetmath_real()
|
||||
data1[0] = std::numeric_limits<Scalar>::quiet_NaN();
|
||||
packet_helper<internal::packet_traits<Scalar>::HasLGamma,Packet> h;
|
||||
h.store(data2, internal::plgamma(h.load(data1)));
|
||||
VERIFY(std::isnan(data2[0]));
|
||||
VERIFY((numext::isnan)(data2[0]));
|
||||
}
|
||||
{
|
||||
data1[0] = std::numeric_limits<Scalar>::quiet_NaN();
|
||||
packet_helper<internal::packet_traits<Scalar>::HasErf,Packet> h;
|
||||
h.store(data2, internal::perf(h.load(data1)));
|
||||
VERIFY(std::isnan(data2[0]));
|
||||
VERIFY((numext::isnan)(data2[0]));
|
||||
}
|
||||
{
|
||||
data1[0] = std::numeric_limits<Scalar>::quiet_NaN();
|
||||
packet_helper<internal::packet_traits<Scalar>::HasErfc,Packet> h;
|
||||
h.store(data2, internal::perfc(h.load(data1)));
|
||||
VERIFY(std::isnan(data2[0]));
|
||||
VERIFY((numext::isnan)(data2[0]));
|
||||
}
|
||||
|
||||
for (int i=0; i<size; ++i)
|
||||
@ -375,6 +375,8 @@ template<typename Scalar> void packetmath_real()
|
||||
data1[i] = internal::random<Scalar>(0,1) * std::pow(Scalar(10), internal::random<Scalar>(-6,6));
|
||||
data2[i] = internal::random<Scalar>(0,1) * std::pow(Scalar(10), internal::random<Scalar>(-6,6));
|
||||
}
|
||||
|
||||
#if __cplusplus > 199711L
|
||||
if(internal::random<float>(0,1)<0.1)
|
||||
data1[internal::random<int>(0, PacketSize)] = 0;
|
||||
CHECK_CWISE1_IF(PacketTraits::HasSqrt, std::sqrt, internal::psqrt);
|
||||
@ -382,6 +384,7 @@ template<typename Scalar> void packetmath_real()
|
||||
CHECK_CWISE1_IF(internal::packet_traits<Scalar>::HasLGamma, std::lgamma, internal::plgamma);
|
||||
CHECK_CWISE1_IF(internal::packet_traits<Scalar>::HasErf, std::erf, internal::perf);
|
||||
CHECK_CWISE1_IF(internal::packet_traits<Scalar>::HasErfc, std::erfc, internal::perfc);
|
||||
#endif
|
||||
|
||||
if(PacketTraits::HasLog && PacketTraits::size>=2)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user