11 #ifndef EIGEN_CWISE_UNARY_OP_H
12 #define EIGEN_CWISE_UNARY_OP_H
14 #include "./InternalHeaderCheck.h"
19 template<
typename UnaryOp,
typename XprType>
20 struct traits<CwiseUnaryOp<UnaryOp, XprType> >
23 typedef typename result_of<
24 UnaryOp(
const typename XprType::Scalar&)
26 typedef typename XprType::Nested XprTypeNested;
27 typedef std::remove_reference_t<XprTypeNested> XprTypeNested_;
34 template<
typename UnaryOp,
typename XprType,
typename StorageKind>
35 class CwiseUnaryOpImpl;
56 template<
typename UnaryOp,
typename XprType>
57 class CwiseUnaryOp :
public CwiseUnaryOpImpl<UnaryOp, XprType, typename internal::traits<XprType>::StorageKind>, internal::no_assignment_operator
61 typedef typename CwiseUnaryOpImpl<UnaryOp, XprType,typename internal::traits<XprType>::StorageKind>::Base Base;
63 typedef typename internal::ref_selector<XprType>::type XprTypeNested;
64 typedef internal::remove_all_t<XprType> NestedExpression;
66 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
67 explicit CwiseUnaryOp(
const XprType& xpr,
const UnaryOp& func = UnaryOp())
68 : m_xpr(xpr), m_functor(func) {}
70 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR
71 Index rows()
const EIGEN_NOEXCEPT {
return m_xpr.rows(); }
72 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR
73 Index cols()
const EIGEN_NOEXCEPT {
return m_xpr.cols(); }
76 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
77 const UnaryOp&
functor()
const {
return m_functor; }
80 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
81 const internal::remove_all_t<XprTypeNested>&
85 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
86 internal::remove_all_t<XprTypeNested>&
91 const UnaryOp m_functor;
95 template<
typename UnaryOp,
typename XprType,
typename StorageKind>
96 class CwiseUnaryOpImpl
97 :
public internal::generic_xpr_base<CwiseUnaryOp<UnaryOp, XprType> >::type
100 typedef typename internal::generic_xpr_base<CwiseUnaryOp<UnaryOp, XprType> >::type Base;
Generic expression where a coefficient-wise unary operator is applied to an expression.
Definition: CwiseUnaryOp.h:58
const UnaryOp & functor() const
Definition: CwiseUnaryOp.h:77
const internal::remove_all_t< XprTypeNested > & nestedExpression() const
Definition: CwiseUnaryOp.h:82
internal::remove_all_t< XprTypeNested > & nestedExpression()
Definition: CwiseUnaryOp.h:87
const unsigned int RowMajorBit
Definition: Constants.h:68
Namespace containing all symbols from the Eigen library.
Definition: Core:139
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:59