Re: [eigen] Efficient way to store symmetric matrix for use with Cholesky?

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




On Tue, Jun 8, 2010 at 7:02 PM, Manoj Rajagopalan <rmanoj@xxxxxxxxx> wrote:
Hi,

  Right now I am using a full square matrix to store a symmetric matrix and
am calling LDLT on it. I believe a bug was recently fixed that gets the
Cholesky module accessing only one triangular part of the matrix, as it
should. Is there some way to just store one triangular part and call LDLT on
that instead of storing the entire matrix?


Hi,

indeed, now the LDLT dec works as the LLT in the sense you can specify which triangular part has to considered:

mat.selfadjointView<Upper>().ldlt()...

or

LDLT<MatrixType,Upper> ldlt(mat);
....

Of course you still need a full dense matrix, but note that one half is free to store another triangular or selfadjoint matrix.

Now it seems you are looking for a compact storage for triangular matrices. This is currently not available in Eigen but if someone is willing to do it the idea is to split the triangular matrix into two triangles and one square and transpose one of the triangle such that it can be put in the remaining empty space as it is better explained there: http://netlib.org/lapack/lapack-3.2.html#_9_6_rectangular_full_packed_formate The main advantage of this scheme is that's quite easy to implement matrix products, solvers and decompositions on top of it reusing dense algorithms. Since the benefits are relatively small, this is a low priority for us. Nevertheless, I think this is a quite nice project for someone who want to contribute because it mainly consists in relatively high level coding.

cheers,
 
gael


Thanks,
Manoj





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