Content deleted Content added
Line 81:
Each Jacobi rotation can be done in ''n'' steps when the pivot element ''p'' is known. However the search for ''p'' requires inspection of all ''N'' ≈ ½ ''n''<sup>2</sup> off-diag elements. We can reduce this to ''n'' steps too if we introduce an additional index array <math> m_1, \, \dots \, , \, m_{n - 1} </math> with the property that <math> m_i </math> is the index of the largest element in row ''i'', (''i'' = 1, …, ''n'' − 1) of the current ''S''. Then (''k'', ''l'') must be one of the pairs <math> (i, m_i) </math> . Since only columns ''k'' and ''l'' change, only <math> m_k \mbox{ and } m_l </math> must be updated, which again can be done in ''n'' steps. Thus each rotation has O(''n'') cost and one sweep has O(''n''<sup>3</sup>) cost which is equivalent to one matrix multiplication. Additionally the <math> m_i </math> must be initialized before the process starts, this can be done in ''n''<sup>2</sup> steps.
Typically the Jacobi method converges within numerical precision after a small number of sweeps. Note that multiple eigenvalues reduce the number of iterations since <math>N_S < N</math>.
(Note: Sweeps refer to cyclic Jacobi, where the pivot cyles over all upper (or lower) off-diagonal elements, not classic Jacobi which searches for the maximum (magnitude) off-diagonal element.)
== Algorithm ==
|