eigen3 - Setting decomposition threshold (tolerance) Eigen::JacobiSVD -


i trying experiment jacobisvd of eigen. in particular trying reconstruct input matrix singular value decomposition. http://eigen.tuxfamily.org/dox/classeigen_1_1jacobisvd.html.

eigen::matrixxf m = eigen::matrixxf::random(3,3); eigen::jacobisvd<eigen::matrixxf, eigen::noqrpreconditioner> svd(m, eigen::computefullu | eigen:: computefullv); eigen::vectorxf svec = svd.singularvalues(); eigen::matrixxf s = eigen::matrixxf::identity(3,3); s(0,0) = svec(0); s(1,1) = svec(1); s(2,2) = svec(2);  eigen::matrixxf recon = svd.matrixu() * s * svd.matrixv().transpose(); cout<< "diff : \n"<< m - recon << endl; 

i know internally svd computed iterative method , can never perfect reconstruction. errors in order of 10^-7. above code output --

diff :   9.53674e-07   1.2517e-06 -2.98023e-07 -4.47035e-08   1.3113e-06   8.9407e-07  5.96046e-07 -9.53674e-07  -7.7486e-07 

for application error high, aiming error in range 10^-10 - 10^-12. question how set threshold decomposition.

note : in docs have noted there method setthreshold() states not set threshold decomposition singular values comparison zero.

note : far possible not wish go double. possible float?

a single precision floating point (a 32 bit float) has between 6 9 significant decimal figures, requirement of 10^{-10} impossible (assuming values around 0.5f). double precision floating point (a 64 bit double) has 15-17 significant decimal figures, should work long values aren't 10^6.


Comments

Popular posts from this blog

java - UnknownEntityTypeException: Unable to locate persister (Hibernate 5.0) -

python - ValueError: empty vocabulary; perhaps the documents only contain stop words -

ubuntu - collect2: fatal error: ld terminated with signal 9 [Killed] -