RE: [eigen] JacobiSVD::compute does malloc for non-square matrices

[ Thread Index | Date Index | More Archives ]

Thank you! I will give a try. Do I have to apply all patches or only "part 4: Removes heap allocations from JacobiSVD and its preconditioners" ?

De : Listengine [mailto:listengine@xxxxxxxxxxxxxxxxx] De la part de Adolfo Rodríguez Tsouroukdissian
Envoyé : 18 mai 2011 11:55
À : eigen@xxxxxxxxxxxxxxxxxxx
Objet : Re: [eigen] JacobiSVD::compute does malloc for non-square matrices

On Wed, May 18, 2011 at 5:24 PM, <hamelin.philippe@xxxxxxx> wrote:
I'm trying to use the SVD in a real-time process, so I can't do any malloc. I found that my SVD (JacobiSVD) was doing some malloc, even when the pre-allocation ctor is used. The jacobi unit tests (jacobisvd_preallocate) does make this validation, but only for a square 3x3 matrix. The same test fail when using non-square matrices. Here is an example of a failing test:
bool testSVDNoMalloc()
    const int rows = 15;
    const int cols = 15;
    Eigen::MatrixXd A = Eigen::MatrixXd::Random(rows, cols);
    Eigen::JacobiSVD<Eigen::MatrixXd> svd1(rows, cols);
    return true;
Is this a bug or maybe I misunderstood something?


There is an open bug [1] with patches that fix heap allocations for the JacobiSVD::compute method. However, some of them are still pending for review, hence have not yet been integrated in the dev branch. If you feel brave, feel free to give them a test drive. They work for me, and don't have side effects as per the unit tests.

As a side note which might be of interest, once bug 206 is closed, I'd like to take on fixing heap allocations on JacobiSVD::solve method, plus propose adding a mechanism for generalizing the computation of the inverse of the singular values, so that one can not only perform pure least squares inverses/linear system solve, but also add other criteria to the optimization (eg. regularization).



Thank you,
Philippe Hamelin
, ing. jr, M. Ing
Chercheur / Researcher

T: 450-652-8499 x2198
F: 450-652-1316

Expertise robotique et civil
Institut de recherche d'Hydro-Québec (IREQ)
1740, boul. Lionel-Boulet
Varennes (QC) J3X 1S1, Canada


Adolfo Rodríguez Tsouroukdissian

Robotics engineer
Tel. +34.93.414.53.47

CONFIDENTIALITY NOTICE: This e-mail and the accompanying document(s) may contain confidential information which is privileged and intended only for the individual or entity to whom they are addressed.  If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or use of this e-mail and/or accompanying document(s) is strictly prohibited.  If you have received this e-mail in error, please immediately notify the sender at the above e-mail address.

Mail converted by MHonArc 2.6.19+