template<typename UnaryOp, typename XprType>
class Eigen::CwiseUnaryOp< UnaryOp, XprType >
Generic expression where a coefficient-wise unary operator is applied to an expression.
- Template Parameters
-
| UnaryOp | template functor implementing the operator |
| XprType | the type of the expression to which we are applying the unary operator |
This class represents an expression where a unary operator is applied to an expression. It is the return type of coefficient-wise operations taking a single input expression, such as unary negation or MatrixBase::unaryExpr(). Operators mixing an expression and a scalar, such as the operator* in the expression 3*matrix, are binary: the scalar is nested as a CwiseNullaryOp, so the return type is a specialization of CwiseBinaryOp. A scalar carried inside the functor does not make the expression binary; ArrayBase::pow(const
ScalarExponent&) stores its exponent in the functor and still returns a CwiseUnaryOp.
Most of the time, this is the only way that it is used, so you typically don't have to name CwiseUnaryOp types explicitly.
- See also
- MatrixBase::unaryExpr(const CustomUnaryOp &) const, class CwiseBinaryOp, class CwiseNullaryOp