|Re: [eigen] How to create a Matrix<...> without copying data ?|
[ Thread Index |
| More lists.tuxfamily.org/eigen Archives
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] How to create a Matrix<...> without copying data ?
- From: Gael Guennebaud <gael.guennebaud@xxxxxxxxx>
- Date: Mon, 17 May 2010 13:32:22 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:content-type; bh=GLbZ6YVHyXi8BXehDL8Ehg/sHbFeRIVd8ddEpH62asA=; b=UNHHUAhr9x6r+omQngSNRVny9ka4vvFjEeePnWNMB84XbCo61OQprpj4hcnBCwbNMp JsCZ84mT4hvqTlhfTo+A1qPkWnlWfBl6GPWQNKc7NMoV85uhkvs/Ca830NJ9f9i6o4TJ IFMPnB+1trV3rXrFHJ68IHu74nE6xQMkR4mUE=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=cyeQbKYxRpgMjahfBbKaHkO+/nRGoeJPjjvkD/rRVOebh/rE3sZ+i0qUlYwW6jc21y SCVpahUlu/UDzPP0wL15k0+pj3xXHHE5Yr9Un+99wZ4S0bcdD3aGGSYn0JlAGdiOtQOM LLCveS0RmQCPWs4n97pe3h7+G3hJCsvlJdz4k=
On Mon, May 17, 2010 at 12:30 PM, Benoit Jacob <jacob.benoit.1@xxxxxxxxx>
You can do:
or, from your double* pointer,
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.
well, if you are not afraid about using internal functions, and so functions which can be removed/changed in the future, you can use this one:
template<typename MatrixType, typename IntVector>
void ei_partial_lu_inplace(MatrixType& lu, IntVector& row_transpositions, int& nb_transpositions);
// declare a name variable for the block because current C++ standard sucks.
Block<MyMatrix> bl(matrix, ....);
ei_partial_lu_inplace(bl, row_transpositions, nb_transpositions);
The problem is that now you cannot exploit this LU dec via the PartialPivLU API, but maybe that's enough for your needs... ?
> 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...