mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/matrix.rb (Matrix#rank): revert a part of r20859 to avoid
infinite loop. [Bug #1020] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24211 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
aea1193a96
commit
abc20ed0f4
2 changed files with 7 additions and 3 deletions
|
@ -1,3 +1,8 @@
|
|||
Mon Jul 20 12:51:39 2009 wanabe <s.wanabe@gmail.com>
|
||||
|
||||
* lib/matrix.rb (Matrix#rank): revert a part of r20859 to avoid
|
||||
infinite loop. [Bug #1020]
|
||||
|
||||
Mon Jul 20 11:12:54 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* configure.in, Makefile.in (TEST_RUNNABLE): tests are no
|
||||
|
|
|
@ -770,7 +770,7 @@ class Matrix
|
|||
end
|
||||
rank = 0
|
||||
k = 0
|
||||
loop do
|
||||
begin
|
||||
if (akk = a[k][k]) == 0
|
||||
i = k
|
||||
exists = true
|
||||
|
@ -812,8 +812,7 @@ class Matrix
|
|||
end
|
||||
end
|
||||
rank += 1
|
||||
break unless (k += 1) <= a_column_size - 1
|
||||
end
|
||||
end while (k += 1) <= a_column_size - 1
|
||||
return rank
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue