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

Solve sparse matrix

Tags: None
(comma "," separated)
traubi
Registered Member
Posts
8
Karma
0
OS

Solve sparse matrix

Tue Dec 28, 2010 10:47 am
Hi,

I need to compute B* A^-1 * B.transposed() . Both A and B are sparse. Is this possible using the sparse matrix solvers?

Thanks in advance
traubi
luca_formaggia
Registered Member
Posts
1
Karma
0

Re: Solve sparse matrix

Thu Dec 30, 2010 9:21 pm
Hi, I am not sure if this is the answer you are looking. Yet, as a general advice you should NEVER build explicitly the inverse of a sparse matrix (since it is in general quite full), but solve the linear system instead. For instance by using superLU or umfpack if the system is relatively small, or by adopting an iterative solver if the system is big. In the latter case the keypoint to obtain an efficient method is to devise an effective preconditioner.

L.F.
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS

Re: Solve sparse matrix

Sat Jan 01, 2011 10:51 am
only if is selfadjoint, because our current LU backends does not support sparse rhs. In this case first solve for A X = B^T, and then compute B * X...
traubi
Registered Member
Posts
8
Karma
0
OS

Re: Solve sparse matrix

Mon Jan 03, 2011 1:34 pm
Hi

ggael wrote:first solve for A X = B^T, and then compute B * X...


Thanks a lot :) ! I will implement this approach.

Cheers
Traubi
red_cat
Registered Member
Posts
5
Karma
0

Re: Solve sparse matrix

Fri Aug 12, 2011 8:17 am
I have a problem
I use to solve SLEs with sparse matrices library SuperLU. When decomposition no errors. But when the debugger comes to solve(), program terminated and output error about violation of rights of access to memory. (File dgsisx.c of library SuperLU, line 656). And yes, i need incomplete lu-factorization (it used in iterative methods). If used complete factorization is no problems.

Code: Select all
int m=10;
Eigen::SparseMatrix<double> As(m,m);
Eigen::SparseLU<Eigen::SparseMatrix<double>,SuperLU> LU;
Eigen::Matrix<double,Dynamic,1> b(m), x(m);

// filling As, b
//...
LU.setFlags(IncompleteFactorization);
LU.compute(As);
LU.solve(b, &x); // Unhandled exception: Access violation reading location 0x00000000.


Has anyone seen this?

And one more question to the developers: when to wait for implementation LU in SparseExtra?


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Google [Bot], Yahoo [Bot]