10 #ifndef EIGEN_SPARSETRANSPOSE_H 11 #define EIGEN_SPARSETRANSPOSE_H 16 template<
typename MatrixType,
int CompressedAccess=
int(MatrixType::Flags&CompressedAccessBit)>
17 class SparseTransposeImpl
18 :
public SparseMatrixBase<Transpose<MatrixType> >
21 template<
typename MatrixType>
23 :
public SparseCompressedBase<Transpose<MatrixType> >
25 typedef SparseCompressedBase<Transpose<MatrixType> > Base;
28 typedef typename Base::Scalar Scalar;
29 typedef typename Base::StorageIndex StorageIndex;
31 inline Index nonZeros()
const {
return derived().nestedExpression().nonZeros(); }
33 inline const Scalar* valuePtr()
const {
return derived().nestedExpression().valuePtr(); }
34 inline const StorageIndex* innerIndexPtr()
const {
return derived().nestedExpression().innerIndexPtr(); }
35 inline const StorageIndex* outerIndexPtr()
const {
return derived().nestedExpression().outerIndexPtr(); }
36 inline const StorageIndex* innerNonZeroPtr()
const {
return derived().nestedExpression().innerNonZeroPtr(); }
38 inline Scalar* valuePtr() {
return derived().nestedExpression().valuePtr(); }
39 inline StorageIndex* innerIndexPtr() {
return derived().nestedExpression().innerIndexPtr(); }
40 inline StorageIndex* outerIndexPtr() {
return derived().nestedExpression().outerIndexPtr(); }
41 inline StorageIndex* innerNonZeroPtr() {
return derived().nestedExpression().innerNonZeroPtr(); }
45 template<
typename MatrixType>
class TransposeImpl<MatrixType,Sparse>
46 :
public internal::SparseTransposeImpl<MatrixType>
49 typedef internal::SparseTransposeImpl<MatrixType> Base;
54 template<
typename ArgType>
55 struct unary_evaluator<Transpose<ArgType>, IteratorBased>
56 :
public evaluator_base<Transpose<ArgType> >
58 typedef typename evaluator<ArgType>::InnerIterator EvalIterator;
60 typedef Transpose<ArgType> XprType;
62 inline Index nonZerosEstimate()
const {
63 return m_argImpl.nonZerosEstimate();
66 class InnerIterator :
public EvalIterator
69 EIGEN_STRONG_INLINE InnerIterator(
const unary_evaluator& unaryOp,
Index outer)
70 : EvalIterator(unaryOp.m_argImpl,outer)
73 Index row()
const {
return EvalIterator::col(); }
74 Index col()
const {
return EvalIterator::row(); }
78 CoeffReadCost = evaluator<ArgType>::CoeffReadCost,
79 Flags = XprType::Flags
82 explicit unary_evaluator(
const XprType& op) :m_argImpl(op.nestedExpression()) {}
85 evaluator<ArgType> m_argImpl;
92 #endif // EIGEN_SPARSETRANSPOSE_H const unsigned int CompressedAccessBit
Definition: Constants.h:186
Namespace containing all symbols from the Eigen library.
Definition: Core:287
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:33
Definition: Eigen_Colamd.h:50