summaryrefslogtreecommitdiff
path: root/lib/matrix/eigenvalue_decomposition.rb
diff options
context:
space:
mode:
authormarcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-01-13 21:06:39 +0000
committermarcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-01-13 21:06:39 +0000
commit93f023feae1463b1f88d1d2f599c5b5ad34bf329 (patch)
treeeb23af3fd4b2730f2c983bfab5548b525dee5e76 /lib/matrix/eigenvalue_decomposition.rb
parentc12d66f0d11aa79dc937e41b6fd5e481d9973d36 (diff)
* lib/matrix/eigenvalue_decomposition: Backport bugfix of Jama 1.0.3
[rubyspec:df87040be371] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38803 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/matrix/eigenvalue_decomposition.rb')
-rw-r--r--lib/matrix/eigenvalue_decomposition.rb12
1 files changed, 4 insertions, 8 deletions
diff --git a/lib/matrix/eigenvalue_decomposition.rb b/lib/matrix/eigenvalue_decomposition.rb
index 19494066870..0dd9d42f297 100644
--- a/lib/matrix/eigenvalue_decomposition.rb
+++ b/lib/matrix/eigenvalue_decomposition.rb
@@ -659,14 +659,10 @@ class Matrix
q = @h[k+1][k-1]
r = (notlast ? @h[k+2][k-1] : 0.0)
x = p.abs + q.abs + r.abs
- if (x != 0.0)
- p /= x
- q /= x
- r /= x
- end
- end
- if (x == 0.0)
- break
+ next if x == 0
+ p /= x
+ q /= x
+ r /= x
end
s = Math.sqrt(p * p + q * q + r * r)
if (p < 0)