Jacobi eigenvalue algorithm: Difference between revisions

Content deleted Content added
No edit summary
Algorithm: Clarification: Eliminate unnecessary and confusing re-use of variables 't' and 's' in rotation calculation.
Line 91:
'''var'''
''i'', ''k'', ''l'', ''m'', ''state'' ∈ '''N'''
''s'', ''c'', ''t'', ''p'', ''y'', ''d'', ''r'' ∈ '''R'''
''ind'' ∈ '''N'''<sup>''n''</sup>
''changed'' ∈ '''L'''<sup>''n''</sup>
Line 128:
''k'' := ''m''; ''l'' := ''ind''<sub>''m''</sub>; ''p'' := ''S''<sub>''kl''</sub>
! ''calculate c = cos &phi;, s = sin &phi;''
''y'' := (''e''<sub>''l''</sub>−''e''<sub>''k''</sub>)/2; ''td'' := │''y''│+√(''p''<sup>2</sup>+''y''<sup>2</sup>)
''sr'' := √(''p''<sup>2</sup>+''td''<sup>2</sup>); ''c'' := ''td''/''sr''; ''s'' := ''p''/''sr''; ''t'' := ''p''<sup>2</sup>/''td''
'''if''' ''y''<0 '''then''' ''s'' := −''s''; ''t'' := −''t'' '''endif'''
''S''<sub>''kl''</sub> := 0.0; update(''k'',−''t''); update(''l'',''t'')