[Lapackpp-devel] Problem With EigenVector Calculation for a 3x3 Matrix
Status: Beta
Brought to you by:
cstim
From: Satyajit S. <ssa...@gm...> - 2007-02-04 05:23:56
|
Hi All, I am trying to calculate the EigenVectors for a 3x3 matrix. However, I get different results from Matlab and LAPACKPP. I am supposed to use the Eigen Vector directly for my calculations and hence wanted to know where I might be going wrong. I am giving a code snippet which I am using for the calculation. LaGenMatDouble CoVarianceMatrix(3,3); // Create a 3x3 Matrix LaVectorDouble EIG_VAL(3); LaVectorDouble EIG_VAL_IM(3); LaVectorDouble EIGVECS; // Some Code which creates the CoVariance Matrix. LaEigSolve(CoVarianceMatrix, EIG_VAL, EIG_VAL_IM, EIGVECS); // To solve for the Eigen Vectors and Eigen Values //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // This comparison belows shows the difference between my results and Matlab's results //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// LAPACKPP Output: CoVariance Matrix 242.265 50.7184 13.7922 50.7184 14.1482 20.3449 13.7922 20.3449 279.355 Eigen Values: (From LAPACKPP) 2.32756 244.362 289.079 Eigen Values: (From Matlab) 2.3275 0 0 0 244.3618 0 0 0 289.0789 Eigen Vectors: ( From LAPACKPP) 0.203024 -0.884631 0.419774 -0.97723 -0.156061 0.143755 0.06166 0.439401 0.896172 Eigen Vectors: ( From Matlab) 0.2030 0.8846 0.4198 -0.9772 0.1561 0.1438 0.0617 -0.4394 0.8962 =========================================== CoVariance Matrix 356.18 3.72945 31.3579 3.72945 20.3312 72.4796 31.3579 72.4796 342.337 Eigen Values: (From LAPACKPP) 388.504 325.6 4.74432 Eigen Values: (From Matlab) 4.7443 0 0 0 325.5996 0 0 0 388.5043 Eigen Vectors: (From LAPACK) 0.697496 0.716539 -0.00842256 0.145208 -0.15284 -0.977525 0.701722 -0.680597 0.210652 Eigen Vectors: (From Matlab) -0.0084 -0.7165 -0.6975 -0.9775 0.1528 -0.1452 0.2107 0.6806 -0.7017 I would really appreciate it if someone can help me out with this as I need it urgently. Regards Satyajit |