Click here to Skip to main content
15,663,872 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I want to find the eigenvalues and eigenvectors of a 3x3 matrix. My numbers are stored in fixed-point format (16.16 to be exact).

Note that I don't mind much about the performance, but simply implementing an algorithm that does the job.

The code below, when you build it and run it (with libfixmath library) produces the right eigenvalues but not the correct eigenvectors.

If I understand correctly the algorithm the eigenvectors are the product of all the calculated Qs.

Does anyone know about what might be wrong? (Even correction about the code (writing style etc) anything you can think of, but ofcourse try to center your mind on the eigenvectors! :) :P

The actual loop is like 3 lines...and what it does is this:

eigenvectors = identity matrix

1) QR decomposition A = Q*R

2) Anew = R*Q (multiply the factors in the reverse order, and iterate)

3) eigenvectors = eigenvectors * Q

Thank you!! The code is here

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900