Eigenvalue and eigenvector

May 31, 2016 at 3:07am
Hi,I would like to ask about eigenvalue and eigenvector ,
I manually calculate eigenvalue for this matrix [5,1,-2,2] and the answer are 3 and 4 . However when I run this coding the output give the eigenvalue 1 and 6.

1
2
3
4
5
6
 Matrix2f A;
	A << 5, 1, -2, 2;
	cout << "Here is the matrix A:\n" << A << endl;
	SelfAdjointEigenSolver<Matrix2f> es(A);
        cout << "The eigenvalues of A are:"          << endl << es.eigenvalues() << endl;
	cout << "The matrix of eigenvectors, V, is:" << endl << es.eigenvectors() << endl << endl;


I run the code from
https://eigen.tuxfamily.org/dox/group__TutorialLinearAlgebra.html
title computing eigenvalues and eigenvectors.
Jun 2, 2016 at 12:07am
What, exactly, is your question?

Are you looking for confirmation of the answers?
Or are you looking for help with coding?

The answers you calculated manually seem to be correct. I confirmed them with another program: Eigenvalue and Eigenvector Calculator ( http://www.akiti.ca/EigR12Solver.html )

The output from this program is

1
2
3
4
5
6
7
8
9
10
11
The eigenvalues follow: 

4
3

Error Code: -1

The eigenvector matrix follows: 

0.7071067811865475     -0.4472135954999581     
-0.7071067811865475     0.8944271909999157     


Commercial programs like MATLAB, MathCAD, Maple, etc. would probably confirm these numbers too. However, I am not familiar with the programs posted on the tuxfamily site, so cannot comment about why their results differ.
Jun 9, 2016 at 5:01am
My question is why the coding above give different value of eigenvalue
Topic archived. No new replies allowed.