0

Hi I have been trying to code for finding eigenvalues of a n*n matrix. But I'm not able to think what should be the algorithm for it.

Step 1: Finding det(A-(lamda)*I) = 0

What should be the algorithm for a general matrix, for finding lamda?

I have written the code for finding determinant of a matrix, Can this be used in our algorithm.

Please Help. It will be really appreciated.

user2696258
  • 1,159
  • 2
  • 14
  • 26

1 Answers1

0

[Assuming your matrix is hermitian (simply put, symmetric) so the eigenvectors are real numbers]

In computation, you don't solve for the eignenvectors and eigenvalues using the determinant. It's too slow and unstable numerically.

What you do is apply a transformation (the householder reduction) to reduce your matrix to a tri-diagonal form.

After which, you apply what is known as the QL algorithm on that.

As a starting point, look at tred2 and tqli from numerical recipes (www.nr.com). These are the algorithms I've just described.

Note that these routines also recover candidate eigenvectors.

Bathsheba
  • 231,907
  • 34
  • 361
  • 483
  • One could, of course, compute from the tridiagonal or Hessenberg form the characteristic polynomial, which would be faster and more stable than from the original matrix. But the shifted QR algorithm may still be a little faster. – Lutz Lehmann Mar 15 '14 at 07:26
  • I searched and got that there is some library - "SLEPc" for solving eigen value problems. Do u know anyhing about this library because im apprehensive about it. – user2696258 Mar 16 '14 at 02:59