Re: [Lapackpp-devel] Problem With EigenVector Calculation for a 3x3 Matrix
Status: Beta
Brought to you by:
cstim
From: sun <pyt...@gm...> - 2007-02-04 05:55:57
|
Yes, what you have gotten just show that the results from Lapackpp and Matlab are same. The only difference is that the results display, i.e., the default display precision of number between Lapackpp and Matlab is different. Please type 'format long' in Matlab to set to long precision and then take a look at the results. sun On 2/4/07, Satyajit Sarangi <ssa...@gm...> wrote: > > 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 > > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job > easier. > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > lapackpp-devel mailing list > lap...@li... > https://lists.sourceforge.net/lists/listinfo/lapackpp-devel > > |