Re: [eigen] Allocation policy of eigen decompositions |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] Allocation policy of eigen decompositions
- From: Benoit Jacob <jacob.benoit.1@xxxxxxxxx>
- Date: Fri, 5 Mar 2010 09:47:00 -0500
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=4ELXb+u4fkNVqy24j92xIv2eCHvVw6RngeLgxBtO9nY=; b=thBpNR90b3uWeARDdrC5omRigsmK9IKX5R1TSwwIsPZTcoesJ+/Akt3G5utLi1B6T5 EyouK1JPFJsXFo0/L4Mg2bK4X/NdqPcbMqcWyTcsnKxXxODEd3U2iFQO8MqS5GqcTVAU PJDiRFO+z5S9WngUju0Z8xCZEMJYkpAYzMhCs=
- 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=McCe4rjS2jmq2T6glCj8+IIM2dt205GfWK+iKcuWoIdXWbH9QPAvB3B6InOugm3mC0 bFIweHhoeqPEJZatfJPYKXOk7zUU/Dvsx8WWHn81sy9gkcyHFiAxG1ge/j5dgxaMuUj9 pi6GNzFYNG7srUiIuFG0bJtKegsCcrDfgEtr8=
2010/3/5 Adolfo Rodríguez Tsouroukdissian <dofo79@xxxxxxxxx>:
> Hello,
>
> I have a question on what the allocation policy of the eigen 3.x matrix
> decompositions will be, for this will strongly bias how I use eigen on
> different parts of my code.
>
> On the one hand, I know that the template parameters of the matrix to be
> decomposed (size, options, max size, ...) will be propagated to all the
> decomposition's members and temporaries [1], so if the input matrix is
> stack-allocated, so will be the internals of a decomposition. So far so
> good.
>
> On the other hand, I had the expectation that if heap-allocated matrices are
> used, all heap allocations of the decomposition algorithm would take place
> during the initialization phase, and none would be done in the computation
> phase (provided that the initialization and computation matrices have the
> same size in memory). This currently does not seem to be the case. For
> example,
>
> MatrixXd I(MatrixXd::Identity(16, 16));
> MatrixXd A(MatrixXd::Random(16, 16)); // Same size as I
>
> Eigen::FullPivLU<MatrixXd> lu(I); // Allocates 5 temps
> lu.compute(A); // Allocates 2 extra temps
>
> Eigen::JacobiSVD<MatrixXd> svd(I); // Allocates 4 temps
> svd.compute(A); // Allocates 1 extra temp
>
> I haven't checked where the extra allocations in compute() come from, but my
> question is, can and will they be prevented for 3.x? or is this an
> intentional design decision? (and if so, for what reasons).
It's not an intentional design decision, it's just that I didn't even
think about that. On regular PC hardware this is kind of a non-issue.
Now I can believe that in robotics it's different. Fortunately this is
just an implementation detail, so we can fix that at any later date.
Patches welcome :) Otherwise I might do this the next time that I
rework these decompositions but, since it's an internal thing, it's
not my priority for 3.0 (prioritizing API-impacting issues).
Benoit
>
> TIA,
>
> Adolfo
>
> [1]
> http://listengine.tuxfamily.org/lists.tuxfamily.org/eigen/2010/03/msg00095.html
>
>
> --
> Adolfo Rodríguez Tsouroukdissian, Ph. D.
>
> Robotics engineer
> PAL ROBOTICS S.L
> http://www.pal-robotics.com
> Tel. +34.93.414.53.47
> Fax.+34.93.209.11.09
> AVISO DE CONFIDENCIALIDAD: Este mensaje y sus documentos adjuntos, pueden
> contener información privilegiada y/o confidencial que está dirigida
> exclusivamente a su destinatario. Si usted recibe este mensaje y no es el
> destinatario indicado, o el empleado encargado de su entrega a dicha
> persona, por favor, notifíquelo inmediatamente y remita el mensaje original
> a la dirección de correo electrónico indicada. Cualquier copia, uso o
> distribución no autorizados de esta comunicación queda estrictamente
> prohibida.
>
> 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.
>