From bdd7c6c88a0b8cb931480e04e33a17aa08022e06 Mon Sep 17 00:00:00 2001 From: Benoit Jacob Date: Fri, 11 Jun 2010 07:56:50 -0400 Subject: change the value of Dynamic to -1, since the index type is now configurable. remove EIGEN_ENUM_MIN/MAX, implement new macros instead --- Eigen/src/Core/Diagonal.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'Eigen/src/Core/Diagonal.h') diff --git a/Eigen/src/Core/Diagonal.h b/Eigen/src/Core/Diagonal.h index a4326a299..e93dabd45 100644 --- a/Eigen/src/Core/Diagonal.h +++ b/Eigen/src/Core/Diagonal.h @@ -51,13 +51,15 @@ struct ei_traits > typedef typename MatrixType::StorageKind StorageKind; enum { AbsDiagIndex = DiagIndex<0 ? -DiagIndex : DiagIndex, // only used if DiagIndex != Dynamic + // FIXME these computations are broken in the case where the matrix is rectangular and DiagIndex!=0 RowsAtCompileTime = (int(DiagIndex) == Dynamic || int(MatrixType::SizeAtCompileTime) == Dynamic) ? Dynamic - : (EIGEN_ENUM_MIN(MatrixType::RowsAtCompileTime, + : (EIGEN_SIZE_MIN(MatrixType::RowsAtCompileTime, MatrixType::ColsAtCompileTime) - AbsDiagIndex), ColsAtCompileTime = 1, MaxRowsAtCompileTime = int(MatrixType::MaxSizeAtCompileTime) == Dynamic ? Dynamic - : DiagIndex == Dynamic ? EIGEN_ENUM_MIN(MatrixType::MaxRowsAtCompileTime, MatrixType::MaxColsAtCompileTime) - : (EIGEN_ENUM_MIN(MatrixType::MaxRowsAtCompileTime, MatrixType::MaxColsAtCompileTime) - AbsDiagIndex), + : DiagIndex == Dynamic ? EIGEN_MAXSIZE_MIN(MatrixType::MaxRowsAtCompileTime, + MatrixType::MaxColsAtCompileTime) + : (EIGEN_MAXSIZE_MIN(MatrixType::MaxRowsAtCompileTime, MatrixType::MaxColsAtCompileTime) - AbsDiagIndex), MaxColsAtCompileTime = 1, Flags = (unsigned int)_MatrixTypeNested::Flags & (HereditaryBits | LinearAccessBit | DirectAccessBit) & ~RowMajorBit, CoeffReadCost = _MatrixTypeNested::CoeffReadCost, -- cgit v1.2.3