diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | lib/matrix.rb | 2 |
2 files changed, 6 insertions, 1 deletions
@@ -1,3 +1,8 @@ +Wed Sep 16 13:39:10 2009 Marc-Andre Lafortune <ruby-core@marc-andre.ca> + + * 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@marc-andre.ca> * lib/matrix.rb: trivial optimizations diff --git a/lib/matrix.rb b/lib/matrix.rb index 2d5dfea424..e4a81ea013 100644 --- a/lib/matrix.rb +++ b/lib/matrix.rb @@ -669,7 +669,7 @@ class Matrix 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] |