diff options
author | Gael Guennebaud <g.gael@free.fr> | 2010-06-24 22:48:48 +0200 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2010-06-24 22:48:48 +0200 |
commit | 99e4afd43eb41fccd595daa7d930e9c35a36460e (patch) | |
tree | f85aabf3ab4ac79e574770d9ae3b0974af7b1001 /Eigen/src/Sparse | |
parent | f3b875e434285919ea4cc71ac8691090e8731c32 (diff) |
makes SparseView a true sparse expression and fix use of nesting types
Diffstat (limited to 'Eigen/src/Sparse')
-rw-r--r-- | Eigen/src/Sparse/SparseView.h | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/Eigen/src/Sparse/SparseView.h b/Eigen/src/Sparse/SparseView.h index 56d00b396..8a0446963 100644 --- a/Eigen/src/Sparse/SparseView.h +++ b/Eigen/src/Sparse/SparseView.h @@ -27,11 +27,16 @@ #define EIGEN_SPARSEVIEW_H template<typename MatrixType> -struct ei_traits<SparseView<MatrixType> > : ei_traits<MatrixType> {}; +struct ei_traits<SparseView<MatrixType> > : ei_traits<MatrixType> +{ + typedef int Index; + typedef Sparse StorageKind; +}; template<typename MatrixType> class SparseView : public SparseMatrixBase<SparseView<MatrixType> > { + typedef typename MatrixType::Nested MatrixTypeNested; public: EIGEN_SPARSE_PUBLIC_INTERFACE(SparseView) @@ -47,18 +52,18 @@ public: inline Index outerSize() const { return m_matrix.outerSize(); } protected: - const typename MatrixType::Nested m_matrix; + const MatrixTypeNested m_matrix; Scalar m_reference; typename NumTraits<Scalar>::Real m_epsilon; }; template<typename MatrixType> -class SparseView<MatrixType>::InnerIterator : public MatrixType::InnerIterator +class SparseView<MatrixType>::InnerIterator : public MatrixTypeNested::InnerIterator { public: - typedef typename MatrixType::InnerIterator IterBase; + typedef typename MatrixTypeNested::InnerIterator IterBase; InnerIterator(const SparseView& view, Index outer) : - DenseBase<MatrixType>::InnerIterator(view.m_matrix, outer), m_view(view) + IterBase(view.m_matrix, outer), m_view(view) { incrementToNonZero(); } |