mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Fixes #2735: Component-wise cbrt
This commit is contained in:
committed by
Charles Schlosser
parent
48b254a4bc
commit
5de0f2f89e
@@ -471,6 +471,20 @@ struct functor_traits<scalar_sqrt_op<bool> > {
|
||||
enum { Cost = 1, PacketAccess = packet_traits<bool>::Vectorizable };
|
||||
};
|
||||
|
||||
/** \internal
|
||||
* \brief Template functor to compute the cube root of a scalar
|
||||
* \sa class CwiseUnaryOp, Cwise::sqrt()
|
||||
*/
|
||||
template <typename Scalar>
|
||||
struct scalar_cbrt_op {
|
||||
EIGEN_DEVICE_FUNC inline const Scalar operator()(const Scalar& a) const { return numext::cbrt(a); }
|
||||
};
|
||||
|
||||
template <typename Scalar>
|
||||
struct functor_traits<scalar_cbrt_op<Scalar> > {
|
||||
enum { Cost = 5 * NumTraits<Scalar>::MulCost, PacketAccess = false };
|
||||
};
|
||||
|
||||
/** \internal
|
||||
* \brief Template functor to compute the reciprocal square root of a scalar
|
||||
* \sa class CwiseUnaryOp, Cwise::rsqrt()
|
||||
|
||||
Reference in New Issue
Block a user