Jacobi method of diagonalization.