[eigen] Converting a sparse symmetric matrix to a (nonsymmetric) dense one |

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

*To*: eigen@xxxxxxxxxxxxxxxxxxx*Subject*: [eigen] Converting a sparse symmetric matrix to a (nonsymmetric) dense one*From*: Cedric Doucet <cedric.doucet@xxxxxxxx>*Date*: Thu, 3 Mar 2016 11:47:05 +0100 (CET)*Thread-index*: G3XL6UtfBYMq4IhUwbNzvVeir2MekA==*Thread-topic*: Converting a sparse symmetric matrix to a (nonsymmetric) dense one

Hello,

I would like to know how to convert a symmetric matrix into a dense one whose storage is unsymmetric.

For the moment, I perform the converison like this:

MatrixXd Id = MatrixXd::Identity(n, p);

MatrixXd dense_matrix = sparse_matrix.selfadjointView<Upper>() * Id;

MatrixXd dense_matrix = sparse_matrix.selfadjointView<Upper>() * Id;

But I guess it it not optimal.

I would prefer to perform a real conversion, following something like that:

MatrixXd dense_matrix = MatrixXd(sparse_matrix.selfadjointView<Upper>());

but this syntax does not seem to be correct.

What is the best way to do it?

Thanks!

**Follow-Ups**:**Re: [eigen] Converting a sparse symmetric matrix to a (nonsymmetric) dense one***From:*Gael Guennebaud

**Messages sorted by:**[ date | thread ]- Prev by Date:
**[eigen] unsubscribe** - Next by Date:
**Re: [eigen] Converting a sparse symmetric matrix to a (nonsymmetric) dense one** - Previous by thread:
**[eigen] unsubscribe** - Next by thread:
**Re: [eigen] Converting a sparse symmetric matrix to a (nonsymmetric) dense one**

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