summaryrefslogtreecommitdiff
path: root/lib/matrix/eigenvalue_decomposition.rb
diff options
context:
space:
mode:
authormarcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-11-02 17:52:20 +0000
committermarcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-11-02 17:52:20 +0000
commitc8c66bcf92b94951fd2035761f91e6cde3145d7f (patch)
tree51e24f9bd775f2ce0f72ef6422d9b3a35974e1d9 /lib/matrix/eigenvalue_decomposition.rb
parent5ba9a9505d087282541fc6373c858c0b0f7f322b (diff)
lib/matrix: Use consistent style
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65504 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/matrix/eigenvalue_decomposition.rb')
-rw-r--r--lib/matrix/eigenvalue_decomposition.rb17
1 files changed, 8 insertions, 9 deletions
diff --git a/lib/matrix/eigenvalue_decomposition.rb b/lib/matrix/eigenvalue_decomposition.rb
index 54a1c190add..bf6637635a2 100644
--- a/lib/matrix/eigenvalue_decomposition.rb
+++ b/lib/matrix/eigenvalue_decomposition.rb
@@ -82,8 +82,8 @@ class Matrix
end
alias_method :to_a, :to_ary
- private
- def build_eigenvectors
+
+ private def build_eigenvectors
# JAMA stores complex eigenvectors in a strange way
# See http://web.archive.org/web/20111016032731/http://cio.nist.gov/esd/emaildir/lists/jama/msg01021.html
@e.each_with_index.map do |imag, i|
@@ -96,9 +96,10 @@ class Matrix
end
end
end
+
# Complex scalar division.
- def cdiv(xr, xi, yr, yi)
+ private def cdiv(xr, xi, yr, yi)
if (yr.abs > yi.abs)
r = yi/yr
d = yr + r*yi
@@ -113,7 +114,7 @@ class Matrix
# Symmetric Householder reduction to tridiagonal form.
- def tridiagonalize
+ private def tridiagonalize
# This is derived from the Algol procedures tred2 by
# Bowdler, Martin, Reinsch, and Wilkinson, Handbook for
@@ -231,7 +232,7 @@ class Matrix
# Symmetric tridiagonal QL algorithm.
- def diagonalize
+ private def diagonalize
# This is derived from the Algol procedures tql2, by
# Bowdler, Martin, Reinsch, and Wilkinson, Handbook for
# Auto. Comp., Vol.ii-Linear Algebra, and the corresponding
@@ -350,7 +351,7 @@ class Matrix
# Nonsymmetric reduction to Hessenberg form.
- def reduce_to_hessenberg
+ private def reduce_to_hessenberg
# This is derived from the Algol procedures orthes and ortran,
# by Martin and Wilkinson, Handbook for Auto. Comp.,
# Vol.ii-Linear Algebra, and the corresponding
@@ -440,11 +441,9 @@ class Matrix
end
end
-
-
# Nonsymmetric reduction from Hessenberg to real Schur form.
- def hessenberg_to_real_schur
+ private def hessenberg_to_real_schur
# This is derived from the Algol procedure hqr2,
# by Martin and Wilkinson, Handbook for Auto. Comp.,