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*: Adolfo Rodríguez Tsouroukdissian <adolfo.rodriguez@xxxxxxxxxxxxxxxx>*Date*: Wed, 18 May 2011 17:54:36 +0200*Dkim-signature*: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=z9cmY5d69J8r2MlGIPhE3DFrUk9xZECgcW2lpJxjA0I=; b=J5RXAIBRco469oCTP5/fC4hQNf+zeRQYUGPbRytHhsJlfj62BB6ygNO3B3hYhPYcoo lMvyrX80E9pdAfu3/LrRUtZ2hOnqZwIKSU5/vuZqEWAxU7dd4tPbU01mBMXguzU3ILaW aCqXz4p8TFbPsZStqbwaXFeSm9o4UHljkdPBo=*Domainkey-signature*: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=LuDx0Xk+hNI861JRxH9X/Jw7HhseXasUGIioHQThJq5WYqPWliDwwh+jebBrPQto9j wpnRna7G+GRym9B95ZzZy3XMkxlhmrM1SqohFf2LZGz6hrw+AUvwu0o+g5UE6L7Csw0m wMSQXIevUIhWgGwpqvQ4ODJAPctNW5kW81Qaw=

On Wed, May 18, 2011 at 5:24 PM, <hamelin.philippe@xxxxxxx> wrote:

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, 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

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, 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.

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

**Re: [eigen] JacobiSVD::compute does malloc for non-square matrices***From:*Benoit Jacob

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

**Messages sorted by:**[ date | thread ]- Prev by Date:
**[eigen] JacobiSVD::compute does malloc for non-square matrices** - Next by Date:
**RE: [eigen] JacobiSVD::compute does malloc for non-square matrices** - Previous by thread:
**[eigen] JacobiSVD::compute does malloc for non-square matrices** - Next by thread:
**RE: [eigen] JacobiSVD::compute does malloc for non-square matrices**

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