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>
|
Mon Jul 20 11:12:54 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* configure.in, Makefile.in (TEST_RUNNABLE): tests are no
|
* configure.in, Makefile.in (TEST_RUNNABLE): tests are no
|
||||||
|
|
|
@ -770,7 +770,7 @@ class Matrix
|
||||||
end
|
end
|
||||||
rank = 0
|
rank = 0
|
||||||
k = 0
|
k = 0
|
||||||
loop do
|
begin
|
||||||
if (akk = a[k][k]) == 0
|
if (akk = a[k][k]) == 0
|
||||||
i = k
|
i = k
|
||||||
exists = true
|
exists = true
|
||||||
|
@ -812,8 +812,7 @@ class Matrix
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
rank += 1
|
rank += 1
|
||||||
break unless (k += 1) <= a_column_size - 1
|
end while (k += 1) <= a_column_size - 1
|
||||||
end
|
|
||||||
return rank
|
return rank
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue