11 #ifndef EIGEN_CWISE_UNARY_OP_H 12 #define EIGEN_CWISE_UNARY_OP_H 17 template<
typename UnaryOp,
typename XprType>
18 struct traits<CwiseUnaryOp<UnaryOp, XprType> >
21 typedef typename result_of<
22 UnaryOp(
const typename XprType::Scalar&)
24 typedef typename XprType::Nested XprTypeNested;
25 typedef typename remove_reference<XprTypeNested>::type _XprTypeNested;
32 template<
typename UnaryOp,
typename XprType,
typename StorageKind>
33 class CwiseUnaryOpImpl;
54 template<
typename UnaryOp,
typename XprType>
55 class CwiseUnaryOp :
public CwiseUnaryOpImpl<UnaryOp, XprType, typename internal::traits<XprType>::StorageKind>, internal::no_assignment_operator
59 typedef typename CwiseUnaryOpImpl<UnaryOp, XprType,typename internal::traits<XprType>::StorageKind>::Base Base;
61 typedef typename internal::ref_selector<XprType>::type XprTypeNested;
62 typedef typename internal::remove_all<XprType>::type NestedExpression;
64 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
65 explicit CwiseUnaryOp(
const XprType& xpr,
const UnaryOp& func = UnaryOp())
66 : m_xpr(xpr), m_functor(func) {}
68 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR
69 Index rows()
const EIGEN_NOEXCEPT {
return m_xpr.rows(); }
70 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR
71 Index cols()
const EIGEN_NOEXCEPT {
return m_xpr.cols(); }
74 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
75 const UnaryOp&
functor()
const {
return m_functor; }
78 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
79 const typename internal::remove_all<XprTypeNested>::type&
83 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
84 typename internal::remove_all<XprTypeNested>::type&
89 const UnaryOp m_functor;
93 template<
typename UnaryOp,
typename XprType,
typename StorageKind>
94 class CwiseUnaryOpImpl
95 :
public internal::generic_xpr_base<CwiseUnaryOp<UnaryOp, XprType> >::type
98 typedef typename internal::generic_xpr_base<CwiseUnaryOp<UnaryOp, XprType> >::type Base;
103 #endif // EIGEN_CWISE_UNARY_OP_H const internal::remove_all< XprTypeNested >::type & nestedExpression() const
Definition: CwiseUnaryOp.h:80
Namespace containing all symbols from the Eigen library.
Definition: Core:141
const unsigned int RowMajorBit
Definition: Constants.h:66
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:74
const UnaryOp & functor() const
Definition: CwiseUnaryOp.h:75
internal::remove_all< XprTypeNested >::type & nestedExpression()
Definition: CwiseUnaryOp.h:85
Definition: Eigen_Colamd.h:50
Generic expression where a coefficient-wise unary operator is applied to an expression.
Definition: CwiseUnaryOp.h:55