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

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]

*To*: eigen@xxxxxxxxxxxxxxxxxxx*Subject*: Re: [eigen] JacobiSVD::compute does malloc for non-square matrices*From*: Benoit Jacob <jacob.benoit.1@xxxxxxxxx>*Date*: Wed, 18 May 2011 13:17:49 -0400*Dkim-signature*: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type:content-transfer-encoding; bh=n6JC9rL7BI7pkZ/C+mJyq1swFugbi3Yl65VaVbLdXGU=; b=XEghqusTR1yV94jKM1YcGj0oGCgrDFt5bWq3G2P8urMUYVC5rivZeX3Qd20ELr6vQ9 gbD3pPBnX78NXWUjzcxg6jrpWuK6DkCXL79Pn3QAeFi7hh6kHwzy7fL7lAHdpYyYXICn P++VfazuJAqhciR9iDPzX87Z7Tut+BJUWzN54=*Domainkey-signature*: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=OF8+fZc1sL+q70tSM0CTdlTYrNPd3T+2c6b6LlvXoSXeuZSBAOou/bga5M2YMwNpvh bwSo93/LuzZckuH0moKhw8g536nOnfqkBwicoVp6LN3TYtBjYRIBElvogkxarCLWKRLj 5rEvEbrDuhYgPcJ2Rr37blyex+FoWqwVbnxUY=

2011/5/18 Adolfo Rodríguez Tsouroukdissian <adolfo.rodriguez@xxxxxxxxxxxxxxxxx>: > On Wed, May 18, 2011 at 5:24 PM, <hamelin.philippe@xxxxxxx> wrote: >> >> Hello, >> >> 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); >> Eigen::internal::set_is_malloc_allowed(false); >> svd1.compute(A); >> Eigen::internal::set_is_malloc_allowed(true); >> >> return true; >> } >> >> Is this a bug or maybe I misunderstood something? > > Philippe, > > 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, They weren't actually marked as pending for review, which is maybe why I forgot about them. Hope to do that ASAP. Benoit 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). > > [1] http://eigen.tuxfamily.org/bz/show_bug.cgi?id=206 > > HTH, > > Adolfo > >> >> >> 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 > PAL ROBOTICS S.L > http://www.pal-robotics.com > Tel. +34.93.414.53.47 > Fax.+34.93.209.11.09 > > 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. >

**References**:**[eigen] JacobiSVD::compute does malloc for non-square matrices***From:*hamelin.philippe

**Re: [eigen] JacobiSVD::compute does malloc for non-square matrices***From:*Adolfo Rodríguez Tsouroukdissian

**Messages sorted by:**[ date | thread ]- Prev by Date:
**Re: [eigen] What is the 'correct' way to pass matrix results?** - Next by Date:
**Re: [eigen] What is the 'correct' way to pass matrix results?** - Previous by thread:
**Re: [eigen] JacobiSVD::compute does malloc for non-square matrices** - Next by thread:
**[eigen] TopicCustomizingEigen**

Mail converted by MHonArc 2.6.19+ | http://listengine.tuxfamily.org/ |