diff options
author | keiju <keiju@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-12-17 10:25:29 +0000 |
---|---|---|
committer | keiju <keiju@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-12-17 10:25:29 +0000 |
commit | 67d18f7ff78aa9da418f5b958e998807c15b7925 (patch) | |
tree | bfe59c69188592d016d962ee3ac4d817abc4d3fc /lib | |
parent | 8fb2235f48af6216b9b2105155dd626d8b2f771a (diff) | |
download | ruby-67d18f7ff78aa9da418f5b958e998807c15b7925.tar.gz |
* lib/matrix.rb: shut up warning. [ruby-dev:37481] [Bug #899]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20845 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/matrix.rb | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/lib/matrix.rb b/lib/matrix.rb index c672ee5198..229e51e5b7 100644 --- a/lib/matrix.rb +++ b/lib/matrix.rb @@ -18,7 +18,6 @@ # See classes Matrix and Vector for documentation. # - require "e2mmap.rb" module ExceptionForMatrix # :nodoc: @@ -623,22 +622,18 @@ class Matrix q = a[i][k].quo(akk) a[i][k] = 0 - (k + 1).upto(size) do - |j| + for j in (k + 1).. size a[i][j] -= a[k][j] * q end - 0.upto(size) do - |j| + for j in 0..size @rows[i][j] -= @rows[k][j] * q end end - (k + 1).upto(size) do - |j| + for j in (k + 1).. size a[k][j] = a[k][j].quo(akk) end - 0.upto(size) do - |j| + for j in 0..size @rows[k][j] = @rows[k][j].quo(akk) end end @@ -712,8 +707,8 @@ class Matrix akk = a[k][k] det *= -1 end - (k + 1).upto(size) do - |i| + + for i in k + 1 .. size q = a[i][k].quo(akk) (k + 1).upto(size) do |j| @@ -753,7 +748,8 @@ class Matrix a[i], a[k] = a[k], a[i] det *= -1 end - (k + 1).upto(size) do |i| + + for i in (k + 1)..size q = a[i][k].quo(a[k][k]) k.upto(size) do |j| a[i][j] -= a[k][j] * q @@ -823,11 +819,10 @@ class Matrix end end end - (k + 1).upto(a_row_size - 1) do - |i| + + for i in (k + 1)..(a_row_size - 1) q = a[i][k].quo(akk) - (k + 1).upto(a_column_size - 1) do - |j| + for j in (k + 1)..(a_column_size - 1) a[i][j] -= a[k][j] * q end end |