This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Eigen Map Sparse Matrix

Tags: None
(comma "," separated)
asa
Registered Member
Posts
1
Karma
0

Eigen Map Sparse Matrix

Sun May 29, 2016 9:45 am
Hello,

Im trying to fill a sparse matrix from a single array; i normally use this approach when working with normal matrixes:
Code: Select all
void myFunction ( double p[] )
{
    Eigen::Matrix<double, n, n> eigenMatrix = Eigen::Map<Eigen::Matrix<double, n, n>>(p);
}

How can I achieve the same results but with SparseMatrix?

I looked at the documentation but I am having some issues, Im probably missing something, here below is the link
https://eigen.tuxfamily.org/dox-devel/classEigen_1_1Map_3_01SparseMatrixType_01_4.html

Thanks!
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS

Re: Eigen Map Sparse Matrix

Thu Jun 02, 2016 2:57 pm
What do you mean by "from a single array", what does it contain? is it dense with explicit zeros? Is it an array of triplets?

Have a look at the following page to get an introduction to sparse matrix storage: http://eigen.tuxfamily.org/dox-devel/gr ... parse.html


Bookmarks



Who is online

Registered users: Bing [Bot], blue_bullet, Google [Bot], rockscient, Yahoo [Bot]