I'm trying to do an app that can give the eigenvalues and vectors for a given square matrix. I have already found how to compute and display the eigenvalues and vectors, but I don't know in which case return that the matrix can't be diagonalize and that there isn't any eigenvalue or eigenvector.
So can you tell me how to determine if the matrix has eigenvalues or eigenvectors (is diagonalizable in fact?) depending on the eigenvalues and eigenvectors computed by the algorithm?
I explain you my algorithm:
For each REAL eigenvalue, it puts the related NON NULL eigenvectors in a column of an "eigenvectors matrix" containing as many columns as the number of eigenvalues. For the first real eigenvalue, it puts the non null eigenvectors in the first column of the "eigenvector matrix". For the second real eigenvalue, it puts the non null eigenvectors in the second column of the "eigenvector matrix". ... If an eigenvalue isn't real, then no eigenvector is added int the column corresponding to the eigenvalue and it goes to the next eigenvalue.