mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
c12d66f0d1
commit
93f023feae
2 changed files with 9 additions and 8 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue