From 74cf12cbe0949852197260dc8dcdd0da61f09736 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Wed, 7 Jul 2010 11:07:12 +0200 Subject: [PATCH] add a compile time error if someone call packet on Diagonal (instead of infinite runtime loop) --- Eigen/src/Core/Diagonal.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Eigen/src/Core/Diagonal.h b/Eigen/src/Core/Diagonal.h index b72ce93fa..a77710565 100644 --- a/Eigen/src/Core/Diagonal.h +++ b/Eigen/src/Core/Diagonal.h @@ -125,6 +125,9 @@ template class Diagonal 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 colOffset() const { return m_index.value()>0 ? m_index.value() : 0; } + // triger a compile time error is someone try to call packet + template typename MatrixType::PacketReturnType packet(Index) const; + template typename MatrixType::PacketReturnType packet(Index,Index) const; }; /** \returns an expression of the main diagonal of the matrix \c *this