Re: [eigen] How to create a Matrix<...> without copying data ?

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


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



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