On Mon, Nov 23, 2015 at 9:37 AM, Jonas Ballani <jonas.ball...@epfl.ch>
wrote:

> Dear all,
>
> I am relatively new to libmesh and would like to report a problem using
> the SVD routine of the DenseMatrix class for rectangular matrices. My
> example program looks as follows:
>

Hi Jonas,

#734 fixes the bug and is almost ready to be merged, but I had just one
more comment on this issue.  While testing, I noticed a difference in the
Eigen::JacobiSVD results compared to Lapack, even for what I assumed was a
trivial problem. This is probably because an iterative algorithm is used by
Eigen, compared to some direct method in Lapack, but there does not seem to
be a way to control the tolerance in Eigen...  To test this, I computed the
SVD of the 3x2 matrix:

A =
       1        2
       3        4
       5        6

then multiplied the factors together to get

A_computed = U * S * V^T,

and then computed ||A - A_computed||_{\infty}.  The results were:

Lapack: ||A - A_computed||=1.33226762955019e-15
Eigen: ||A - A_computed||=0.700409889221191

Note that this was the case even though the entries of U, S, and V^T didn't
differ by much between Lapack and Eigen:

Norm of difference in U entries: 1.09504813838868e-06
> Norm of difference in V^T entries: 1.82409692905949e-07
> Norm of difference in Sigma entries: 2.94426321312269e-06



This may be an expected result for JacobiSVD, and I don't know what it
implies about the accuracy of computing least-squares solutions with the
SVD decomposition (we don't yet have a method for that in libmesh) but I
thought I would mention it in any case...

An expanded version of your test code is here if you are interested:
https://gist.github.com/jwpeterson/5872e267e6d5011f84d0

-- 
John
------------------------------------------------------------------------------
Go from Idea to Many App Stores Faster with Intel(R) XDK
Give your users amazing mobile app experiences with Intel(R) XDK.
Use one codebase in this all-in-one HTML5 development environment.
Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs.
http://pubads.g.doubleclick.net/gampad/clk?id=254741911&iu=/4140
_______________________________________________
Libmesh-users mailing list
Libmesh-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libmesh-users

Reply via email to