11 #ifndef EIGEN_CWISE_UNARY_OP_H
12 #define EIGEN_CWISE_UNARY_OP_H
37 template<
typename UnaryOp,
typename XprType>
38 struct traits<CwiseUnaryOp<UnaryOp, XprType> >
41 typedef typename result_of<
42 UnaryOp(
typename XprType::Scalar)
44 typedef typename XprType::Nested XprTypeNested;
45 typedef typename remove_reference<XprTypeNested>::type _XprTypeNested;
52 template<
typename UnaryOp,
typename XprType,
typename StorageKind>
53 class CwiseUnaryOpImpl;
55 template<
typename UnaryOp,
typename XprType>
56 class CwiseUnaryOp :
public CwiseUnaryOpImpl<UnaryOp, XprType, typename internal::traits<XprType>::StorageKind>, internal::no_assignment_operator
60 typedef typename CwiseUnaryOpImpl<UnaryOp, XprType,typename internal::traits<XprType>::StorageKind>::Base Base;
62 typedef typename internal::remove_all<XprType>::type NestedExpression;
65 explicit inline CwiseUnaryOp(
const XprType& xpr,
const UnaryOp& func = UnaryOp())
66 : m_xpr(xpr), m_functor(func) {}
69 EIGEN_STRONG_INLINE Index rows()
const {
return m_xpr.rows(); }
71 EIGEN_STRONG_INLINE Index cols()
const {
return m_xpr.cols(); }
75 const UnaryOp&
functor()
const {
return m_functor; }
79 const typename internal::remove_all<typename XprType::Nested>::type&
84 typename internal::remove_all<typename XprType::Nested>::type&
88 typename XprType::Nested m_xpr;
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 UnaryOp & functor() const
Definition: CwiseUnaryOp.h:75
const internal::remove_all< typename XprType::Nested >::type & nestedExpression() const
Definition: CwiseUnaryOp.h:80
const unsigned int RowMajorBit
Definition: Constants.h:61
internal::remove_all< typename XprType::Nested >::type & nestedExpression()
Definition: CwiseUnaryOp.h:85
Definition: Eigen_Colamd.h:54
Generic expression where a coefficient-wise unary operator is applied to an expression.
Definition: CwiseUnaryOp.h:56