From 151e3294cfa29ff1485ce7ad1310d15098b55e9e Mon Sep 17 00:00:00 2001 From: Jitse Niesen Date: Thu, 10 Mar 2011 13:49:06 +0000 Subject: Fix equalsIdentity() for rectangular matrices. --- test/nullary.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/nullary.cpp') diff --git a/test/nullary.cpp b/test/nullary.cpp index dd42cb898..3a46e10c7 100644 --- a/test/nullary.cpp +++ b/test/nullary.cpp @@ -37,7 +37,7 @@ bool equalsIdentity(const MatrixType& A) } } for (int i = 0; i < A.rows(); ++i) { - for (int j = 0; j < i; ++j) { + for (int j = 0; j < std::min(i, A.cols()); ++j) { offDiagOK = offDiagOK && (A(i,j) == zero); } } -- cgit v1.2.3