Example: |
The eigenvectors are stored rowwise in the array EigenVectors. The following code snippet shows how to calculate the eigenvectors and copy the first and second eigenvector into the one-dimensional arrays Evec1 and Evec2 (assuming that the symmetric matrix CovarMat contains the covariance matrix):
...
var
CovarMat : TDouble2DArray;
EigVec : TDouble2DArray;
EigVal : TDoubleArray;
Evec1 : TDoubleArray;
Evec2 : TDoubleArray;
...
errnum := EigenDecomposition (CovarMat, true, Eigvec, EigVal);
CopyArrayRow (EigVec, 0, 0, 0, Evec1); // first eigenvector (row index 0)
CopyArrayRow (EigVec, 1, 0, 0, Evec2); // second eigenvector (row index 1)
...
|