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

URGENT how to compute eigenvector/null space of a matrix : (

Tags: None
(comma "," separated)
invisibleink
Registered Member
Posts
4
Karma
0
Hello,

I know that's such a dumb question but I am quite new to Eigen.

I am trying to solve Ax=x for x but I couldn't get it done in Eigen.

A is ~50,000x50,000 real, non-negative sparse matrix.

I need to efficiently solve either for the null space of (A-I)x=0 or base eigenvector of the equation, Ax=lambda*x where eigenvalue=lambda would have to be 1.

However, I really don't know how to translate these two methods into Eigen :s
Any help to efficiently solve the equation above will be highly appreciated!

Thanks in advance.
manuels
Registered Member
Posts
47
Karma
0
Looking at the documentation brings up this:
http://eigen.tuxfamily.org/dox-devel/cl ... b0f0c1c3fa

Last edited by bcooksley on Mon Dec 06, 2010 11:42 pm, edited 1 time in total.
Reason: Remove capitals and swearing
User avatar
bjacob
Registered Member
Posts
658
Karma
3
His problem is sparse, not dense. He wants a sparse solver here. say sparse LU for general matrices.


Join us on Eigen's IRC channel: #eigen on irc.freenode.net
Have a serious interest in Eigen? Then join the mailing list!
invisibleink
Registered Member
Posts
4
Karma
0
bjacob wrote:His problem is sparse, not dense. He wants a sparse solver here. say sparse LU for general matrices.


Thanks bjacob.

I checked out the other threads but couldn't find a sol'n for sparse solvers yet.

This one seems particularly enlightening:
viewtopic.php?f=74&t=83060

I guess, it talks about external modules like cholmod, umfpack but doesn't detail a lot(or such a newbie I am). Now I need to figure out a way to plug these modules into Eigen.

I will appreciate your help if you have any idea on how to manage that.
User avatar
bjacob
Registered Member
Posts
658
Karma
3
For sparse stuff, I strongly encourage you to use eigen 3 (the development version).

There you have this tutorial:
http://eigen.tuxfamily.org/dox-devel/Tu ... parse.html


Join us on Eigen's IRC channel: #eigen on irc.freenode.net
Have a serious interest in Eigen? Then join the mailing list!
invisibleink
Registered Member
Posts
4
Karma
0
Thanks bjacob! I read the tutorial now I am trying to use SuperLU support module to solve the problem. I've downloaded the SuperLU package from here: http://crd.lbl.gov/~xiaoye/SuperLU/ and placed it under Eigen directory as SuperLU is not built-in in Eigen.

ref: viewtopic.php?f=74&t=84904

Code: Select all
#define EIGEN_SUPERLU_SUPPORT

#include "Eigen/Sparse"
#include "Eigen/LU"

using namespace std;
using namespace Eigen;

int main(int, char *[])
{
   MatrixXf A(4,4);// will use dynamic sparse matrix soon
   A << 0, 0, 1, 0.5, 0.333, 0, 0, 0, 0.333, 0.5, 0, 0.5, 0.333, 0.5, 0, 0;
   cout << "A:\n" << A << endl;

   SparseLU<MatrixXf, SuperLU> lu(A);
   return 1;
}



Now that, when I compile the following I got this weird error:

Eigen/src/Sparse/SuperLUSupport.h:45: error: 'mem_usage_t' is not a member of 'SuperLU_S'

I don't know what's happening there - maybe I am linking the wrong version of SuperLU? :)

Regards.
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
Hi invisibleink,

what you need here is a sparse eigen decomposition algorithm that we don't have yet in Eigen. For instance there exist ARPACK++ and SLEPc. I'd recommend the later.
User avatar
bjacob
Registered Member
Posts
658
Karma
3
Gael, all he was asking for was computing the kernel of A-I, shouldn't some form of LU be enough here? Or do you mean that pivoting would be required (to handle singularness) and sparse LU is non-pivoting? Or is it just a matter of accuracy?


Join us on Eigen's IRC channel: #eigen on irc.freenode.net
Have a serious interest in Eigen? Then join the mailing list!


Bookmarks



Who is online

Registered users: Bing [Bot], Evergrowing, Google [Bot], rockscient