aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/Core/Diagonal.h
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2015-02-13 18:57:41 +0100
committerGravatar Gael Guennebaud <g.gael@free.fr>2015-02-13 18:57:41 +0100
commitfc202bab398ed9b78ef8452f8e4ef35e233965f6 (patch)
treef0f427ee115aa8579b0d43a49c2ad762b1b0f57c /Eigen/src/Core/Diagonal.h
parentfe513199808654bfa5080fe16bda7dcdafbd57c6 (diff)
Index refactoring: StorageIndex must be used for storage only (and locally when it make sense). In all other cases use the global Index type.
Diffstat (limited to 'Eigen/src/Core/Diagonal.h')
-rw-r--r--Eigen/src/Core/Diagonal.h24
1 files changed, 12 insertions, 12 deletions
diff --git a/Eigen/src/Core/Diagonal.h b/Eigen/src/Core/Diagonal.h
index 18f061179..2446a18d4 100644
--- a/Eigen/src/Core/Diagonal.h
+++ b/Eigen/src/Core/Diagonal.h
@@ -70,28 +70,28 @@ template<typename MatrixType, int _DiagIndex> class Diagonal
EIGEN_DENSE_PUBLIC_INTERFACE(Diagonal)
EIGEN_DEVICE_FUNC
- explicit inline Diagonal(MatrixType& matrix, Index a_index = DiagIndex) : m_matrix(matrix), m_index(internal::convert_index<StorageIndex>(a_index)) {}
+ explicit inline Diagonal(MatrixType& matrix, Index a_index = DiagIndex) : m_matrix(matrix), m_index(a_index) {}
EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Diagonal)
EIGEN_DEVICE_FUNC
- inline StorageIndex rows() const
+ inline Index rows() const
{
- return m_index.value()<0 ? numext::mini<StorageIndex>(m_matrix.cols(),m_matrix.rows()+m_index.value())
- : numext::mini<StorageIndex>(m_matrix.rows(),m_matrix.cols()-m_index.value());
+ return m_index.value()<0 ? numext::mini<Index>(m_matrix.cols(),m_matrix.rows()+m_index.value())
+ : numext::mini<Index>(m_matrix.rows(),m_matrix.cols()-m_index.value());
}
EIGEN_DEVICE_FUNC
- inline StorageIndex cols() const { return 1; }
+ inline Index cols() const { return 1; }
EIGEN_DEVICE_FUNC
- inline StorageIndex innerStride() const
+ inline Index innerStride() const
{
return m_matrix.outerStride() + 1;
}
EIGEN_DEVICE_FUNC
- inline StorageIndex outerStride() const
+ inline Index outerStride() const
{
return 0;
}
@@ -153,23 +153,23 @@ template<typename MatrixType, int _DiagIndex> class Diagonal
}
EIGEN_DEVICE_FUNC
- inline StorageIndex index() const
+ inline Index index() const
{
return m_index.value();
}
protected:
typename MatrixType::Nested m_matrix;
- const internal::variable_if_dynamicindex<StorageIndex, DiagIndex> m_index;
+ const internal::variable_if_dynamicindex<Index, DiagIndex> m_index;
private:
// some compilers may fail to optimize std::max etc in case of compile-time constants...
EIGEN_DEVICE_FUNC
- EIGEN_STRONG_INLINE StorageIndex absDiagIndex() const { return m_index.value()>0 ? m_index.value() : -m_index.value(); }
+ EIGEN_STRONG_INLINE Index absDiagIndex() const { return m_index.value()>0 ? m_index.value() : -m_index.value(); }
EIGEN_DEVICE_FUNC
- EIGEN_STRONG_INLINE StorageIndex rowOffset() const { return m_index.value()>0 ? 0 : -m_index.value(); }
+ EIGEN_STRONG_INLINE Index rowOffset() const { return m_index.value()>0 ? 0 : -m_index.value(); }
EIGEN_DEVICE_FUNC
- EIGEN_STRONG_INLINE StorageIndex colOffset() const { return m_index.value()>0 ? m_index.value() : 0; }
+ EIGEN_STRONG_INLINE Index colOffset() const { return m_index.value()>0 ? m_index.value() : 0; }
// trigger a compile time error is someone try to call packet
template<int LoadMode> typename MatrixType::PacketReturnType packet(Index) const;
template<int LoadMode> typename MatrixType::PacketReturnType packet(Index,Index) const;