mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-07-09 22:51:51 +08:00
Improved the default implementation of prsqrt
This commit is contained in:
parent
61409d9449
commit
fb53384b0f
@ -378,9 +378,7 @@ Packet psqrt(const Packet& a) { using std::sqrt; return sqrt(a); }
|
|||||||
/** \internal \returns the reciprocal square-root of \a a (coeff-wise) */
|
/** \internal \returns the reciprocal square-root of \a a (coeff-wise) */
|
||||||
template<typename Packet> EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS
|
template<typename Packet> EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS
|
||||||
Packet prsqrt(const Packet& a) {
|
Packet prsqrt(const Packet& a) {
|
||||||
using std::sqrt;
|
return pdiv(pset1<Packet>(1), psqrt(a));
|
||||||
const Packet one(1);
|
|
||||||
return one/sqrt(a);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
|
Loading…
x
Reference in New Issue
Block a user