SparseTranspose.h
Go to the documentation of this file.
1 // This file is part of Eigen, a lightweight C++ template library
2 // for linear algebra.
3 //
4 // Copyright (C) 2008-2015 Gael Guennebaud <gael.guennebaud@inria.fr>
5 //
6 // This Source Code Form is subject to the terms of the Mozilla
7 // Public License v. 2.0. If a copy of the MPL was not distributed
8 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 
10 #ifndef EIGEN_SPARSETRANSPOSE_H
11 #define EIGEN_SPARSETRANSPOSE_H
12 
13 namespace Eigen {
14 
15 namespace internal {
16  template<typename MatrixType,int CompressedAccess=int(MatrixType::Flags&CompressedAccessBit)>
18  : public SparseMatrixBase<Transpose<MatrixType> >
19  {};
20 
21  template<typename MatrixType>
23  : public SparseCompressedBase<Transpose<MatrixType> >
24  {
26  public:
27  using Base::derived;
28  typedef typename Base::Scalar Scalar;
29  typedef typename Base::StorageIndex StorageIndex;
30 
31  inline Index nonZeros() const { return derived().nestedExpression().nonZeros(); }
32 
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(); }
37 
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(); }
42  };
43 }
44 
45 template<typename MatrixType> class TransposeImpl<MatrixType,Sparse>
46  : public internal::SparseTransposeImpl<MatrixType>
47 {
48  protected:
50 };
51 
52 namespace internal {
53 
54 template<typename ArgType>
56  : public evaluator_base<Transpose<ArgType> >
57 {
59  public:
61 
62  inline Index nonZerosEstimate() const {
63  return m_argImpl.nonZerosEstimate();
64  }
65 
66  class InnerIterator : public EvalIterator
67  {
68  public:
70  : EvalIterator(unaryOp.m_argImpl,outer)
71  {}
72 
73  Index row() const { return EvalIterator::col(); }
74  Index col() const { return EvalIterator::row(); }
75  };
76 
77  enum {
79  Flags = XprType::Flags
80  };
81 
82  explicit unary_evaluator(const XprType& op) :m_argImpl(op.nestedExpression()) {}
83 
84  protected:
86 };
87 
88 } // end namespace internal
89 
90 } // end namespace Eigen
91 
92 #endif // EIGEN_SPARSETRANSPOSE_H
Eigen::internal::SparseTransposeImpl< MatrixType, CompressedAccessBit >::innerNonZeroPtr
StorageIndex * innerNonZeroPtr()
Definition: SparseTranspose.h:41
Eigen
Namespace containing all symbols from the Eigen library.
Definition: jet.h:637
Eigen::TransposeImpl
Definition: Transpose.h:37
Eigen::internal::SparseTransposeImpl< MatrixType, CompressedAccessBit >::innerIndexPtr
StorageIndex * innerIndexPtr()
Definition: SparseTranspose.h:39
col
m col(1)
Eigen::EigenBase::derived
EIGEN_DEVICE_FUNC Derived & derived()
Definition: EigenBase.h:46
Eigen::internal::SparseTransposeImpl< MatrixType, CompressedAccessBit >::StorageIndex
Base::StorageIndex StorageIndex
Definition: SparseTranspose.h:29
MatrixType
MatrixXf MatrixType
Definition: benchmark-blocking-sizes.cpp:52
Eigen::Sparse
Definition: Constants.h:510
Eigen::internal::unary_evaluator< Transpose< ArgType >, IteratorBased >::InnerIterator::row
Index row() const
Definition: SparseTranspose.h:73
Eigen::CompressedAccessBit
const unsigned int CompressedAccessBit
Definition: Constants.h:191
Eigen::internal::unary_evaluator< Transpose< ArgType >, IteratorBased >::InnerIterator::InnerIterator
EIGEN_STRONG_INLINE InnerIterator(const unary_evaluator &unaryOp, Index outer)
Definition: SparseTranspose.h:69
Eigen::internal::unary_evaluator< Transpose< ArgType >, IteratorBased >::XprType
Transpose< ArgType > XprType
Definition: SparseTranspose.h:60
Eigen::internal::evaluator_base
Definition: CoreEvaluators.h:110
Eigen::internal::unary_evaluator< Transpose< ArgType >, IteratorBased >::unary_evaluator
unary_evaluator(const XprType &op)
Definition: SparseTranspose.h:82
Eigen::internal::SparseTransposeImpl< MatrixType, CompressedAccessBit >::valuePtr
const Scalar * valuePtr() const
Definition: SparseTranspose.h:33
Eigen::internal::SparseTransposeImpl< MatrixType, CompressedAccessBit >::Scalar
Base::Scalar Scalar
Definition: SparseTranspose.h:28
Eigen::internal::SparseTransposeImpl
Definition: SparseTranspose.h:17
Eigen::internal::SparseTransposeImpl< MatrixType, CompressedAccessBit >::outerIndexPtr
StorageIndex * outerIndexPtr()
Definition: SparseTranspose.h:40
Eigen::Transpose
Expression of the transpose of a matrix.
Definition: Transpose.h:52
Eigen::SparseCompressedBase
Common base class for sparse [compressed]-{row|column}-storage format.
Definition: SparseCompressedBase.h:15
Eigen::internal::SparseTransposeImpl< MatrixType, CompressedAccessBit >::outerIndexPtr
const StorageIndex * outerIndexPtr() const
Definition: SparseTranspose.h:35
Eigen::internal::unary_evaluator< Transpose< ArgType >, IteratorBased >::m_argImpl
evaluator< ArgType > m_argImpl
Definition: SparseTranspose.h:85
Eigen::internal::SparseTransposeImpl< MatrixType, CompressedAccessBit >::valuePtr
Scalar * valuePtr()
Definition: SparseTranspose.h:38
Eigen::internal::unary_evaluator< Transpose< ArgType >, IteratorBased >::InnerIterator::col
Index col() const
Definition: SparseTranspose.h:74
EIGEN_STRONG_INLINE
#define EIGEN_STRONG_INLINE
Definition: Macros.h:917
Eigen::internal::IteratorBased
Definition: Constants.h:545
Eigen::internal::SparseTransposeImpl< MatrixType, CompressedAccessBit >::Base
SparseCompressedBase< Transpose< MatrixType > > Base
Definition: SparseTranspose.h:25
Eigen::internal::SparseTransposeImpl< MatrixType, CompressedAccessBit >::nonZeros
Index nonZeros() const
Definition: SparseTranspose.h:31
Eigen::internal::unary_evaluator< Transpose< ArgType >, IteratorBased >::EvalIterator
evaluator< ArgType >::InnerIterator EvalIterator
Definition: SparseTranspose.h:58
Eigen::internal::SparseTransposeImpl< MatrixType, CompressedAccessBit >::innerIndexPtr
const StorageIndex * innerIndexPtr() const
Definition: SparseTranspose.h:34
Eigen::internal::evaluator
Definition: CoreEvaluators.h:90
Eigen::TransposeImpl< MatrixType, Sparse >::Base
internal::SparseTransposeImpl< MatrixType > Base
Definition: SparseTranspose.h:49
Eigen::InnerIterator
An InnerIterator allows to loop over the element of any matrix expression.
Definition: CoreIterators.h:33
row
m row(1)
Eigen::internal::unary_evaluator
Definition: CoreEvaluators.h:65
Eigen::SparseMatrixBase
Base class of any sparse matrices or sparse expressions.
Definition: ForwardDeclarations.h:301
Eigen::SparseMatrixBase< Transpose< MatrixType > >::derived
const Derived & derived() const
Definition: SparseMatrixBase.h:143
Eigen::internal::unary_evaluator< Transpose< ArgType >, IteratorBased >::nonZerosEstimate
Index nonZerosEstimate() const
Definition: SparseTranspose.h:62
internal
Definition: BandTriangularSolver.h:13
Eigen::internal::SparseTransposeImpl< MatrixType, CompressedAccessBit >::innerNonZeroPtr
const StorageIndex * innerNonZeroPtr() const
Definition: SparseTranspose.h:36
Scalar
SCALAR Scalar
Definition: bench_gemm.cpp:46
Eigen::Index
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:74


gtsam
Author(s):
autogenerated on Sat Nov 16 2024 04:04:55