Add a DynamicIndex constant for signed quantities and use it to fix the conflict

between Diagonal<S,-1> (the first sub diagonal) and a runtime super/sub diagonal which is now:
Diagonal<S,DynamicIndex>
This commit is contained in:
Gael Guennebaud
2012-07-10 23:04:17 +02:00
parent 3e6329a0d9
commit 904ecdf9d8
5 changed files with 43 additions and 20 deletions

View File

@@ -239,11 +239,11 @@ template<typename Derived> class MatrixBase
// Note: The "MatrixBase::" prefixes are added to help MSVC9 to match these declarations with the later implementations.
// On the other hand they confuse MSVC8...
#if (defined _MSC_VER) && (_MSC_VER >= 1500) // 2008 or later
typename MatrixBase::template DiagonalIndexReturnType<Dynamic>::Type diagonal(Index index);
typename MatrixBase::template ConstDiagonalIndexReturnType<Dynamic>::Type diagonal(Index index) const;
typename MatrixBase::template DiagonalIndexReturnType<DynamicIndex>::Type diagonal(Index index);
typename MatrixBase::template ConstDiagonalIndexReturnType<DynamicIndex>::Type diagonal(Index index) const;
#else
typename DiagonalIndexReturnType<Dynamic>::Type diagonal(Index index);
typename ConstDiagonalIndexReturnType<Dynamic>::Type diagonal(Index index) const;
typename DiagonalIndexReturnType<DynamicIndex>::Type diagonal(Index index);
typename ConstDiagonalIndexReturnType<DynamicIndex>::Type diagonal(Index index) const;
#endif
#ifdef EIGEN2_SUPPORT