Fix CwiseUnaryView.

This commit is contained in:
Antonio Sánchez
2024-03-11 19:08:30 +00:00
committed by Rasmus Munk Larsen
parent 352ede96e4
commit 1d4369c2ff
7 changed files with 154 additions and 44 deletions

View File

@@ -118,7 +118,7 @@ EIGEN_DEVICE_FUNC inline const CwiseUnaryOp<CustomUnaryOp, const Derived> unaryE
return CwiseUnaryOp<CustomUnaryOp, const Derived>(derived(), func);
}
/// \returns an expression of a custom coefficient-wise unary operator \a func of *this
/// \returns a const expression of a custom coefficient-wise unary operator \a func of *this
///
/// The template parameter \a CustomUnaryOp is the type of the functor
/// of the custom unary operator.
@@ -137,6 +137,21 @@ EIGEN_DEVICE_FUNC inline const CwiseUnaryView<CustomViewOp, const Derived> unary
return CwiseUnaryView<CustomViewOp, const Derived>(derived(), func);
}
/// \returns a non-const expression of a custom coefficient-wise unary view \a func of *this
///
/// The template parameter \a CustomUnaryOp is the type of the functor
/// of the custom unary operator.
///
EIGEN_DOC_UNARY_ADDONS(unaryViewExpr, unary function)
///
/// \sa unaryExpr, binaryExpr class CwiseUnaryOp
///
template <typename CustomViewOp>
EIGEN_DEVICE_FUNC inline CwiseUnaryView<CustomViewOp, Derived> unaryViewExpr(
const CustomViewOp& func = CustomViewOp()) {
return CwiseUnaryView<CustomViewOp, Derived>(derived(), func);
}
/// \returns a non const expression of the real part of \c *this.
///
EIGEN_DOC_UNARY_ADDONS(real, real part function)