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

Conjugate Gradient

Tags: None
(comma "," separated)
xissburg
Registered Member
Posts
5
Karma
0
OS

Conjugate Gradient

Sat Jul 23, 2011 5:06 pm
Is there an implementation of the conjugate gradient method in Eigen?

Thanks.
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS

Re: Conjugate Gradient

Sat Jul 23, 2011 5:18 pm
I'm polishing the one I have for a commit very very soon...
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS

Re: Conjugate Gradient

Sat Jul 23, 2011 5:21 pm
btw, there is also a SimplicialCholesky for directly solving Ax=b with A sparse and selfadjoint... Much faster than a conjugate gradient if the matrix is very sparse (e.g., 2 dimensional Poisson equation) and not too large ...
xissburg
Registered Member
Posts
5
Karma
0
OS

Re: Conjugate Gradient

Sat Jul 23, 2011 8:26 pm
How do I use SimplicialCholesky by the way? I couldn't find any examples/documentation.

Thanks.
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS

Re: Conjugate Gradient

Sun Jul 24, 2011 5:56 am
once you filled the upper of lower triangular part (or both) of your selfadjoint matrix:

Eigen::SimplicialCholesky<MatrixType,Eigen::Lower> solver(A);

x = solver.solve(b);
if(solver.info()!=Success)
{
// did not worked :(
}


Bookmarks



Who is online

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