ruby-changes:13193
From: marcandre <ko1@a...>
Date: Wed, 16 Sep 2009 13:40:11 +0900 (JST)
Subject: [ruby-changes:13193] Ruby:r24949 (trunk): * lib/matrix.rb (determinant): Bug fix where determinant failed on some matrices
marcandre 2009-09-16 13:39:51 +0900 (Wed, 16 Sep 2009) New Revision: 24949 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=24949 Log: * lib/matrix.rb (determinant): Bug fix where determinant failed on some matrices [ruby-core:23597] Modified files: trunk/ChangeLog trunk/lib/matrix.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 24948) +++ ChangeLog (revision 24949) @@ -1,3 +1,8 @@ +Wed Sep 16 13:39:10 2009 Marc-Andre Lafortune <ruby-core@m...> + + * lib/matrix.rb (determinant): Bug fix where determinant failed on + some matrices [ruby-core:23597] + Wed Sep 16 13:30:20 2009 Marc-Andre Lafortune <ruby-core@m...> * lib/matrix.rb: trivial optimizations Index: lib/matrix.rb =================================================================== --- lib/matrix.rb (revision 24948) +++ lib/matrix.rb (revision 24949) @@ -669,7 +669,7 @@ if (akk = a[k][k]) == 0 i = k loop do - return 0 if (ii += 1) > size + return 0 if (i += 1) > size break unless a[i][k] == 0 end a[i], a[k] = a[k], a[i] -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/