From f341fe8c1182f0e0b2a5beab0457b5f182f1827c Mon Sep 17 00:00:00 2001 From: Markus Blatt <mblatt@dune-project.org> Date: Thu, 18 Jan 2007 11:53:02 +0000 Subject: [PATCH] Fixed bug introduced by Christian. The check i>=0 is always true if i is unsigned! [[Imported from SVN: r4830]] --- common/fmatrix.hh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/fmatrix.hh b/common/fmatrix.hh index 4b0b980e1..3b335819e 100644 --- a/common/fmatrix.hh +++ b/common/fmatrix.hh @@ -704,7 +704,7 @@ namespace Dune { } // U A^{-1} = Y - for (size_type i=n-1; i>=0; i--) { + for (size_type i=n-1; i!=0; i--) { for (size_type k=0; k<n; k++) { for (size_type j=i+1; j<n; j++) p[i][k] -= U[i][j]*p[j][k]; @@ -712,7 +712,7 @@ namespace Dune { } } - for(size_type i=n-1; i>=0; --i) { + for(size_type i=n-1; i!=0; --i) { if(i!=pivot[i]) for(size_type j=0; j<n; ++j) std::swap(p[j][pivot[i]], p[j][i]); -- GitLab