add a compile time error if someone call packet on Diagonal (instead of infinite runtime loop)

This commit is contained in:
Gael Guennebaud 2010-07-07 11:07:12 +02:00
parent d5e0efaf69
commit 74cf12cbe0

View File

@ -125,6 +125,9 @@ template<typename MatrixType, int DiagIndex> class Diagonal
EIGEN_STRONG_INLINE Index 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_STRONG_INLINE Index 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_STRONG_INLINE Index 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; }
// triger 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;
}; };
/** \returns an expression of the main diagonal of the matrix \c *this /** \returns an expression of the main diagonal of the matrix \c *this