diff options
author | 2015-02-16 15:29:00 +0100 | |
---|---|---|
committer | 2015-02-16 15:29:00 +0100 | |
commit | 98604576d1d4ef3d768b1cc08b4ccedbf16816ab (patch) | |
tree | dc570ba8d010e3b74550671039bf1548d11289d1 /Eigen/src/SparseCore/SparseView.h | |
parent | bd511dde9da3a1f147b3d0d70e76298f759c4420 (diff) | |
parent | 45cbb0bbb1f66bbc923dd4dd1034b919f6b4a191 (diff) |
Merged in chtz/eigen-indexconversion (pull request PR-92)
bug #877, bug #572: Get rid of Index conversion warnings, summary of changes:
- Introduce a global typedef Eigen::Index making Eigen::DenseIndex and AnyExpr<>::Index deprecated (default is std::ptrdiff_t).
- Eigen::Index is used throughout the API to represent indices, offsets, and sizes.
- Classes storing an array of indices uses the type StorageIndex to store them. This is a template parameter of the class. Default is int.
- Methods that *explicitly* set or return an element of such an array take or return a StorageIndex type. In all other cases, the Index type is used.
Diffstat (limited to 'Eigen/src/SparseCore/SparseView.h')
-rw-r--r-- | Eigen/src/SparseCore/SparseView.h | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Eigen/src/SparseCore/SparseView.h b/Eigen/src/SparseCore/SparseView.h index 40a3019fa..1c69aa458 100644 --- a/Eigen/src/SparseCore/SparseView.h +++ b/Eigen/src/SparseCore/SparseView.h @@ -18,7 +18,7 @@ namespace internal { template<typename MatrixType> struct traits<SparseView<MatrixType> > : traits<MatrixType> { - typedef typename MatrixType::Index Index; + typedef typename MatrixType::StorageIndex StorageIndex; typedef Sparse StorageKind; enum { Flags = int(traits<MatrixType>::Flags) & (RowMajorBit) @@ -78,7 +78,7 @@ struct unary_evaluator<SparseView<ArgType>, IteratorBased> typedef typename XprType::Scalar Scalar; public: - EIGEN_STRONG_INLINE InnerIterator(const unary_evaluator& sve, typename XprType::Index outer) + EIGEN_STRONG_INLINE InnerIterator(const unary_evaluator& sve, Index outer) : EvalIterator(sve.m_argImpl,outer), m_view(sve.m_view) { incrementToNonZero(); @@ -126,7 +126,6 @@ struct unary_evaluator<SparseView<ArgType>, IndexBased> typedef SparseView<ArgType> XprType; protected: enum { IsRowMajor = (XprType::Flags&RowMajorBit)==RowMajorBit }; - typedef typename XprType::Index Index; typedef typename XprType::Scalar Scalar; public: @@ -134,7 +133,7 @@ struct unary_evaluator<SparseView<ArgType>, IndexBased> { public: - EIGEN_STRONG_INLINE InnerIterator(const unary_evaluator& sve, typename XprType::Index outer) + EIGEN_STRONG_INLINE InnerIterator(const unary_evaluator& sve, Index outer) : m_sve(sve), m_inner(0), m_outer(outer), m_end(sve.m_view.innerSize()) { incrementToNonZero(); |