Eigen  5.0.1
 
Loading...
Searching...
No Matches
Eigen::CwiseUnaryOp< UnaryOp, XprType > Class Template Reference

#include <Eigen/src/Core/CwiseUnaryOp.h>

Detailed Description

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
UnaryOptemplate functor implementing the operator
XprTypethe 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

Public Member Functions

constexpr const UnaryOp & functor () const
 
constexpr internal::remove_all_t< XprTypeNested > & nestedExpression ()
 
constexpr const internal::remove_all_t< XprTypeNested > & nestedExpression () const
 

Member Function Documentation

◆ functor()

template<typename UnaryOp, typename XprType>
const UnaryOp & Eigen::CwiseUnaryOp< UnaryOp, XprType >::functor ( ) const
inlineconstexpr
Returns
the functor representing the unary operation

◆ nestedExpression() [1/2]

template<typename UnaryOp, typename XprType>
internal::remove_all_t< XprTypeNested > & Eigen::CwiseUnaryOp< UnaryOp, XprType >::nestedExpression ( )
inlineconstexpr
Returns
the nested expression

◆ nestedExpression() [2/2]

template<typename UnaryOp, typename XprType>
const internal::remove_all_t< XprTypeNested > & Eigen::CwiseUnaryOp< UnaryOp, XprType >::nestedExpression ( ) const
inlineconstexpr
Returns
the nested expression

The documentation for this class was generated from the following file: