25 #ifndef EIGEN_SPARSE_CWISE_UNARY_OP_H
26 #define EIGEN_SPARSE_CWISE_UNARY_OP_H
30 template<
typename UnaryOp,
typename MatrixType>
37 class ReverseInnerIterator;
48 template<typename UnaryOp, typename MatrixType>
52 typedef typename CwiseUnaryOpImpl::Scalar
Scalar;
57 : Base(unaryOp.derived().nestedExpression(),outer), m_functor(unaryOp.derived().functor())
61 { Base::operator++();
return *
this; }
63 EIGEN_STRONG_INLINE typename CwiseUnaryOpImpl::Scalar value()
const {
return m_functor(Base::value()); }
66 const UnaryOp m_functor;
68 typename CwiseUnaryOpImpl::Scalar& valueRef();
71 template<
typename UnaryOp,
typename MatrixType>
75 typedef typename CwiseUnaryOpImpl::Scalar Scalar;
80 : Base(unaryOp.derived().nestedExpression(),outer), m_functor(unaryOp.derived().functor())
84 { Base::operator--();
return *
this; }
86 EIGEN_STRONG_INLINE typename CwiseUnaryOpImpl::Scalar value()
const {
return m_functor(Base::value()); }
89 const UnaryOp m_functor;
91 typename CwiseUnaryOpImpl::Scalar& valueRef();
94 template<
typename ViewOp,
typename MatrixType>
101 class ReverseInnerIterator;
112 template<typename ViewOp, typename MatrixType>
116 typedef typename CwiseUnaryViewImpl::Scalar
Scalar;
121 : Base(unaryOp.derived().nestedExpression(),outer), m_functor(unaryOp.derived().functor())
125 { Base::operator++();
return *
this; }
127 EIGEN_STRONG_INLINE typename CwiseUnaryViewImpl::Scalar value()
const {
return m_functor(Base::value()); }
128 EIGEN_STRONG_INLINE typename CwiseUnaryViewImpl::Scalar& valueRef() {
return m_functor(Base::valueRef()); }
131 const ViewOp m_functor;
134 template<
typename ViewOp,
typename MatrixType>
138 typedef typename CwiseUnaryViewImpl::Scalar Scalar;
143 : Base(unaryOp.derived().nestedExpression(),outer), m_functor(unaryOp.derived().functor())
147 { Base::operator--();
return *
this; }
149 EIGEN_STRONG_INLINE typename CwiseUnaryViewImpl::Scalar value()
const {
return m_functor(Base::value()); }
150 EIGEN_STRONG_INLINE typename CwiseUnaryViewImpl::Scalar& valueRef() {
return m_functor(Base::valueRef()); }
153 const ViewOp m_functor;
156 template<
typename Derived>
160 for (
Index j=0; j<outerSize(); ++j)
161 for (
typename Derived::InnerIterator i(derived(),j); i; ++i)
162 i.valueRef() *= other;
166 template<
typename Derived>
170 for (
Index j=0; j<outerSize(); ++j)
171 for (
typename Derived::InnerIterator i(derived(),j); i; ++i)
172 i.valueRef() /= other;
178 #endif // EIGEN_SPARSE_CWISE_UNARY_OP_H