diff options
author | Christoph Hertzberg <chtz@informatik.uni-bremen.de> | 2014-12-04 22:48:53 +0100 |
---|---|---|
committer | Christoph Hertzberg <chtz@informatik.uni-bremen.de> | 2014-12-04 22:48:53 +0100 |
commit | e8cdbedefb1913b5a0e2f2b7d38470f081cb8d29 (patch) | |
tree | b64cb33df57f4cfcd87bf42643279629dc0900d3 /Eigen/src/SparseCore/SparseView.h | |
parent | 6ccf97f3e6ce39c210e225ba7aae66da15b71660 (diff) |
bug #877, bug #572: Introduce a global Index typedef. Rename Sparse*::Index to StorageIndex, make Dense*::StorageIndex an alias to DenseIndex. Overall this commit gets rid of all Index conversion warnings.
Diffstat (limited to 'Eigen/src/SparseCore/SparseView.h')
-rw-r--r-- | Eigen/src/SparseCore/SparseView.h | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/Eigen/src/SparseCore/SparseView.h b/Eigen/src/SparseCore/SparseView.h index 40a3019fa..e26016c16 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) @@ -40,11 +40,11 @@ public: RealScalar m_epsilon = NumTraits<Scalar>::dummy_precision()) : m_matrix(mat), m_reference(m_reference), m_epsilon(m_epsilon) {} - inline Index rows() const { return m_matrix.rows(); } - inline Index cols() const { return m_matrix.cols(); } + inline StorageIndex rows() const { return m_matrix.rows(); } + inline StorageIndex cols() const { return m_matrix.cols(); } - inline Index innerSize() const { return m_matrix.innerSize(); } - inline Index outerSize() const { return m_matrix.outerSize(); } + inline StorageIndex innerSize() const { return m_matrix.innerSize(); } + inline StorageIndex outerSize() const { return m_matrix.outerSize(); } /** \returns the nested expression */ const typename internal::remove_all<MatrixTypeNested>::type& @@ -126,7 +126,7 @@ 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::StorageIndex StorageIndex; typedef typename XprType::Scalar Scalar; public: @@ -134,7 +134,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(); @@ -153,17 +153,17 @@ struct unary_evaluator<SparseView<ArgType>, IndexBased> : m_sve.m_argImpl.coeff(m_inner, m_outer); } - EIGEN_STRONG_INLINE Index index() const { return m_inner; } - inline Index row() const { return IsRowMajor ? m_outer : index(); } - inline Index col() const { return IsRowMajor ? index() : m_outer; } + EIGEN_STRONG_INLINE StorageIndex index() const { return m_inner; } + inline StorageIndex row() const { return IsRowMajor ? m_outer : index(); } + inline StorageIndex col() const { return IsRowMajor ? index() : m_outer; } EIGEN_STRONG_INLINE operator bool() const { return m_inner < m_end && m_inner>=0; } protected: const unary_evaluator &m_sve; - Index m_inner; - const Index m_outer; - const Index m_end; + StorageIndex m_inner; + const StorageIndex m_outer; + const StorageIndex m_end; private: void incrementToNonZero() |