Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef EIGEN_SPARSETRANSPOSE_H
00026 #define EIGEN_SPARSETRANSPOSE_H
00027
00028 namespace Eigen {
00029
00030 template<typename MatrixType> class TransposeImpl<MatrixType,Sparse>
00031 : public SparseMatrixBase<Transpose<MatrixType> >
00032 {
00033 typedef typename internal::remove_all<typename MatrixType::Nested>::type _MatrixTypeNested;
00034 public:
00035
00036 EIGEN_SPARSE_PUBLIC_INTERFACE(Transpose<MatrixType>)
00037
00038 class InnerIterator;
00039 class ReverseInnerIterator;
00040
00041 inline Index nonZeros() const { return derived().nestedExpression().nonZeros(); }
00042 };
00043
00044
00045
00046
00047
00048 template<typename MatrixType> class TransposeImpl<MatrixType,Sparse>::InnerIterator
00049 : public _MatrixTypeNested::InnerIterator
00050 {
00051 typedef typename _MatrixTypeNested::InnerIterator Base;
00052 public:
00053
00054 EIGEN_STRONG_INLINE InnerIterator(const TransposeImpl& trans, typename TransposeImpl<MatrixType,Sparse>::Index outer)
00055 : Base(trans.derived().nestedExpression(), outer)
00056 {}
00057 inline typename TransposeImpl<MatrixType,Sparse>::Index row() const { return Base::col(); }
00058 inline typename TransposeImpl<MatrixType,Sparse>::Index col() const { return Base::row(); }
00059 };
00060
00061 template<typename MatrixType> class TransposeImpl<MatrixType,Sparse>::ReverseInnerIterator
00062 : public _MatrixTypeNested::ReverseInnerIterator
00063 {
00064 typedef typename _MatrixTypeNested::ReverseInnerIterator Base;
00065 public:
00066
00067 EIGEN_STRONG_INLINE ReverseInnerIterator(const TransposeImpl& xpr, typename TransposeImpl<MatrixType,Sparse>::Index outer)
00068 : Base(xpr.derived().nestedExpression(), outer)
00069 {}
00070 inline typename TransposeImpl<MatrixType,Sparse>::Index row() const { return Base::col(); }
00071 inline typename TransposeImpl<MatrixType,Sparse>::Index col() const { return Base::row(); }
00072 };
00073
00074 }
00075
00076 #endif // EIGEN_SPARSETRANSPOSE_H