diff options
author | Georg Drenkhahn <Georg.Drenkhahn@gmail.com> | 2014-09-21 10:21:20 +0200 |
---|---|---|
committer | Georg Drenkhahn <Georg.Drenkhahn@gmail.com> | 2014-09-21 10:21:20 +0200 |
commit | d1ef3c35465dca670002f47ad07c1618fc2d8905 (patch) | |
tree | c9371bf783bce4eccfc93267a47fd4d820dd7bcb /Eigen/src/Core/Diagonal.h | |
parent | edaefeb9786d529cdf17a7d396a4c1962b23cdd3 (diff) |
Changed Diagonal::index() to return an Index type instead of int to prevent possible implicit conversion from long to int.
Added inline keyword to member methods.
Diffstat (limited to 'Eigen/src/Core/Diagonal.h')
-rw-r--r-- | Eigen/src/Core/Diagonal.h | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Eigen/src/Core/Diagonal.h b/Eigen/src/Core/Diagonal.h index ba7ddbb14..6ffc0c762 100644 --- a/Eigen/src/Core/Diagonal.h +++ b/Eigen/src/Core/Diagonal.h @@ -80,7 +80,6 @@ template<typename MatrixType, int _DiagIndex> class Diagonal EIGEN_USING_STD_MATH(min); return m_index.value()<0 ? (min)(Index(m_matrix.cols()),Index(m_matrix.rows()+m_index.value())) : (min)(Index(m_matrix.rows()),Index(m_matrix.cols()-m_index.value())); - } EIGEN_DEVICE_FUNC @@ -148,14 +147,14 @@ template<typename MatrixType, int _DiagIndex> class Diagonal } EIGEN_DEVICE_FUNC - const typename internal::remove_all<typename MatrixType::Nested>::type& + inline const typename internal::remove_all<typename MatrixType::Nested>::type& nestedExpression() const { return m_matrix; } EIGEN_DEVICE_FUNC - int index() const + inline Index index() const { return m_index.value(); } @@ -172,7 +171,7 @@ template<typename MatrixType, int _DiagIndex> class Diagonal EIGEN_STRONG_INLINE Index rowOffset() const { return m_index.value()>0 ? 0 : -m_index.value(); } EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index colOffset() const { return m_index.value()>0 ? m_index.value() : 0; } - // triger a compile time error is someone try to call packet + // 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; }; |