mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
add fixed power unary operation
This commit is contained in:
committed by
Rasmus Munk Larsen
parent
39fcc89798
commit
76a669fb45
@@ -93,3 +93,13 @@ EIGEN_DOC_UNARY_ADDONS(cwiseArg,arg)
|
||||
EIGEN_DEVICE_FUNC
|
||||
inline const CwiseArgReturnType
|
||||
cwiseArg() const { return CwiseArgReturnType(derived()); }
|
||||
|
||||
template <typename ScalarExponent>
|
||||
using CwisePowReturnType =
|
||||
std::enable_if_t<internal::is_arithmetic<ScalarExponent>::value,
|
||||
CwiseUnaryOp<internal::scalar_unary_pow_op<Scalar, ScalarExponent>, const Derived>>;
|
||||
|
||||
template <typename ScalarExponent>
|
||||
EIGEN_DEVICE_FUNC inline const CwisePowReturnType<ScalarExponent> cwisePow(const ScalarExponent& exponent) const {
|
||||
return CwisePowReturnType<ScalarExponent>(derived(), internal::scalar_unary_pow_op<Scalar, ScalarExponent>(exponent));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user