11#ifndef EIGEN_SPARSETRANSPOSE_H
12#define EIGEN_SPARSETRANSPOSE_H
15#include "./InternalHeaderCheck.h"
20template <
typename MatrixType,
int CompressedAccess =
int(MatrixType::Flags & CompressedAccessBit)>
21class SparseTransposeImpl :
public SparseMatrixBase<Transpose<MatrixType> > {};
23template <
typename MatrixType>
24class SparseTransposeImpl<MatrixType,
CompressedAccessBit> :
public SparseCompressedBase<Transpose<MatrixType> > {
25 using Base = SparseCompressedBase<Transpose<MatrixType>>;
29 using Scalar =
typename Base::Scalar;
32 inline Index nonZeros()
const {
return derived().nestedExpression().nonZeros(); }
34 inline const Scalar* valuePtr()
const {
return derived().nestedExpression().valuePtr(); }
35 inline const StorageIndex* innerIndexPtr()
const {
return derived().nestedExpression().innerIndexPtr(); }
36 inline const StorageIndex* outerIndexPtr()
const {
return derived().nestedExpression().outerIndexPtr(); }
37 inline const StorageIndex* innerNonZeroPtr()
const {
return derived().nestedExpression().innerNonZeroPtr(); }
39 inline Scalar* valuePtr() {
return derived().nestedExpression().valuePtr(); }
40 inline StorageIndex* innerIndexPtr() {
return derived().nestedExpression().innerIndexPtr(); }
41 inline StorageIndex* outerIndexPtr() {
return derived().nestedExpression().outerIndexPtr(); }
42 inline StorageIndex* innerNonZeroPtr() {
return derived().nestedExpression().innerNonZeroPtr(); }
46template <
typename MatrixType>
47class TransposeImpl<MatrixType,
Sparse> :
public internal::SparseTransposeImpl<MatrixType> {
49 using Base = internal::SparseTransposeImpl<MatrixType>;
54template <
typename ArgType>
55struct unary_evaluator<Transpose<ArgType>, IteratorBased> :
public evaluator_base<Transpose<ArgType> > {
56 using EvalIterator =
typename evaluator<ArgType>::InnerIterator;
59 using XprType = Transpose<ArgType>;
61 inline Index nonZerosEstimate()
const {
return m_argImpl.nonZerosEstimate(); }
63 class InnerIterator :
public EvalIterator {
65 EIGEN_STRONG_INLINE InnerIterator(
const unary_evaluator& unaryOp, Index outer)
66 : EvalIterator(unaryOp.m_argImpl, outer) {}
68 Index row()
const {
return EvalIterator::col(); }
69 Index col()
const {
return EvalIterator::row(); }
72 enum { CoeffReadCost = evaluator<ArgType>::CoeffReadCost, Flags = XprType::Flags };
74 explicit unary_evaluator(
const XprType& op) : m_argImpl(op.nestedExpression()) {}
77 evaluator<ArgType> m_argImpl;
typename internal::traits< Transpose< MatrixType > >::StorageIndex StorageIndex
Definition SparseMatrixBase.h:45
constexpr unsigned int CompressedAccessBit
Definition Constants.h:196
constexpr Transpose< MatrixType > & derived()
Definition EigenBase.h:50
Eigen::Index Index
Definition EigenBase.h:44
Definition Constants.h:545