which is not equal to M, so the decomposition failed.
I tried this on several platforms, with identical results.
I attach a macro to reproduce the issue.
Strangely enough the decomposition most often works normally (for example, changing the off-diagonal elements to 0.1 or 0.0001), but with some specific cases like the one above it seems to break. I was not able to determine more precise criteria.
M is a square symmetric matrix, in which case the relation should hold.
I should precise that using TMatrixDSymEigen I get the same problem (if this is relevant).
The order of the columns is arbitrary and depend on how the eigenvalues are ordered.
The 1st and 2nd columns are switched but match; the 3rd columns however differ, and not by just an overall scale. So the two outcomes are not equivalent.
Hi,
It is true that M i symmetric, however I am not sure this is always true, that you get orthonormal eigenvectors, especially when some of the eigenvalues are the same as in this case.
For example computing eigenvalues and eigenvector in Mathematica, see
I don’t have an orthogonal matrix for Q (called S ) in this case
Of course TMatrixD / TMatrixDEigen should have returned the correct orthonormal eigenvectors. However, it seems that the (Wilkinson/EISPACK) algorithm fails and the third eigenvector for the degenerate eigenvalue 0.99 is wrong. I have no idea why but in general for accuracy and speed it is wise to use algorithms that are aware of certain properties like symmetry.
-Eddy