Re: [eigen] How to create a Matrix<...> without copying data ? |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] How to create a Matrix<...> without copying data ?
- From: Benoit Jacob <jacob.benoit.1@xxxxxxxxx>
- Date: Mon, 17 May 2010 06:30:02 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=rTkt4BcdhXg2odZ3oJT4O/ClduAaIS9gaekytDgHOMc=; b=gyaOOnzaKOP3AjYkn9GIOvoQoezOOcON9jEBxKNVCPR/hpLC9YbhvLLM0wtnvqHqXH o25gQtf8iscgpxSXvbpUW5ndK2+v6hmF7W3Hx63irPqwW/Gn1/IARXB6XDfrxoccY97C 9zypFvEP97tQkHhVGDB+r5ezgohGjFAjx1Tds=
- 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; b=NWWHKm2qN4l+nwIJwrEfMMbCM4+owBTT6mjMqsylJgzeZtz9z2Uk0la2DbAq1uRJaM MSXilsLOQ2QFh5iMj9eCMDqWv7JhPPlZL9EEV9+1eCerfBcvXpCI/UGi6c8m4GnReHHx FbAuZCWtNpNggZqUwnFuvyRpsQif+yusMAOiA=
You can do:
PartialPivLU<MatrixXd> lu(matrix.block(...));
or, from your double* pointer,
PartialPivLU<MatrixXd>
lu(Map<MatrixXd>(pointer,rows,cols).block(...));
or you can even get rid of the block() call by doing a strided Map.
What we don't allow at the moment is in-place LU, i.e. allowing to not
even copy that block.
Benoit
2010/5/17 <vincent.lejeune@xxxxxxxxxx>:
>
> Hi,
>
>
>
> I have a matrix stored as a double* in columnsmajor format.
>
> I would like to compute the LU factorisation of a part of the matrix (that
>
> is, not the whole matrix, just a sub square of it) inplace, ie I do not
>
> want to copy data to an temporary buffer.
>
>
>
> Is it possible using Eigen ? I saw that PartialPivLU class copy input
>
> matrix when constructed...
>
>
>
> Thx,
>
> Vincent
>
>
>