Eigen::CwiseUnaryOp< UnaryOp, XprType > Class Template Reference

Generic expression where a coefficient-wise unary operator is applied to an expression. More...

+ Inheritance diagram for Eigen::CwiseUnaryOp< UnaryOp, XprType >:

Public Types

typedef CwiseUnaryOpImpl< UnaryOp, XprType, typename internal::traits< XprType >::StorageKind >::Base Base
 
typedef internal::remove_all_t< XprType > NestedExpression
 
typedef internal::ref_selector< XprType >::type XprTypeNested
 

Public Member Functions

EIGEN_CONSTEXPR Index cols () const EIGEN_NOEXCEPT
 
 CwiseUnaryOp (const XprType &xpr, const UnaryOp &func=UnaryOp())
 
const UnaryOp & functor () const
 
internal::remove_all_t< XprTypeNested > & nestedExpression ()
 
const internal::remove_all_t< XprTypeNested > & nestedExpression () const
 
EIGEN_CONSTEXPR Index rows () const EIGEN_NOEXCEPT
 

Protected Attributes

const UnaryOp m_functor
 
XprTypeNested m_xpr
 

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 all operations taking exactly 1 input expression, regardless of the presence of other inputs such as scalars. For example, the operator* in the expression 3*matrix is considered unary, because only the right-hand side is an expression, and its return type is a specialization of 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

Definition at line 57 of file CwiseUnaryOp.h.

Member Typedef Documentation

◆ Base

template<typename UnaryOp , typename XprType >
typedef CwiseUnaryOpImpl<UnaryOp, XprType,typename internal::traits<XprType>::StorageKind>::Base Eigen::CwiseUnaryOp< UnaryOp, XprType >::Base

Definition at line 61 of file CwiseUnaryOp.h.

◆ NestedExpression

template<typename UnaryOp , typename XprType >
typedef internal::remove_all_t<XprType> Eigen::CwiseUnaryOp< UnaryOp, XprType >::NestedExpression

Definition at line 64 of file CwiseUnaryOp.h.

◆ XprTypeNested

template<typename UnaryOp , typename XprType >
typedef internal::ref_selector<XprType>::type Eigen::CwiseUnaryOp< UnaryOp, XprType >::XprTypeNested

Definition at line 63 of file CwiseUnaryOp.h.

Constructor & Destructor Documentation

◆ CwiseUnaryOp()

template<typename UnaryOp , typename XprType >
Eigen::CwiseUnaryOp< UnaryOp, XprType >::CwiseUnaryOp ( const XprType &  xpr,
const UnaryOp &  func = UnaryOp() 
)
inlineexplicit

Definition at line 67 of file CwiseUnaryOp.h.

68  : m_xpr(xpr), m_functor(func) {}
const UnaryOp m_functor
Definition: CwiseUnaryOp.h:91
XprTypeNested m_xpr
Definition: CwiseUnaryOp.h:90

Member Function Documentation

◆ cols()

template<typename UnaryOp , typename XprType >
EIGEN_CONSTEXPR Index Eigen::CwiseUnaryOp< UnaryOp, XprType >::cols ( ) const
inline

Definition at line 73 of file CwiseUnaryOp.h.

73 { return m_xpr.cols(); }

◆ functor()

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

Definition at line 77 of file CwiseUnaryOp.h.

77 { return m_functor; }

◆ nestedExpression() [1/2]

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

Definition at line 87 of file CwiseUnaryOp.h.

87 { return m_xpr; }

◆ nestedExpression() [2/2]

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

Definition at line 82 of file CwiseUnaryOp.h.

82 { return m_xpr; }

◆ rows()

template<typename UnaryOp , typename XprType >
EIGEN_CONSTEXPR Index Eigen::CwiseUnaryOp< UnaryOp, XprType >::rows ( ) const
inline

Definition at line 71 of file CwiseUnaryOp.h.

71 { return m_xpr.rows(); }

Member Data Documentation

◆ m_functor

template<typename UnaryOp , typename XprType >
const UnaryOp Eigen::CwiseUnaryOp< UnaryOp, XprType >::m_functor
protected

Definition at line 91 of file CwiseUnaryOp.h.

◆ m_xpr

template<typename UnaryOp , typename XprType >
XprTypeNested Eigen::CwiseUnaryOp< UnaryOp, XprType >::m_xpr
protected

Definition at line 90 of file CwiseUnaryOp.h.


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