hzhan0607 / cusp-library

Automatically exported from code.google.com/p/cusp-library
Apache License 2.0
0 stars 0 forks source link

Conjugate Gradient Solver #17

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Hi,

I am using the Conjugate Gradient Solver cg.cu to solve A*x=b.
I changed it a little bit so that it could initialize the vector b from reading 
a matrix market file as well. It works fine with the matrix A in the given 
example. However, when I changed the matrix to my own sparse matrix, it always 
tends to further way (fails to converge). On the other hand, I can get the 
solution when I use Matlab to solve it. Thus, I am wondering if there is any 
specific requirement to the matrix by using Conjugate Gradient method?

What version of the product are you using? On what operating system?

I am using CUDA3.0, cusp0.1 and thrust1.2. The operating system is Windows7.

Thank you

Original issue reported on code.google.com by xuyuanzh...@gmail.com on 8 Jul 2010 at 7:59

GoogleCodeExporter commented 8 years ago
Rigorously speaking, the matrix must be symmetric positive definite. Then the 
conjugate gradients method converges in exact arithmetic.
If it doesn't, try bicgstab which is also available in CUSP.
Evidently, CUSP was developed under Linux :) I run it on my XP machine as well, 
without any problem.

Original comment by agnonc...@gmail.com on 6 Aug 2010 at 3:45

GoogleCodeExporter commented 8 years ago
I am currently working on a GMRES based iterative solver using cusp which 
should be more numerically stable than CG.  I have it pretty much working 
(aside from a few minor workarounds in the way I'm using the monitors) but 
convergence is much more stable than CG.

Original comment by jacob.re...@gmail.com on 25 Oct 2010 at 11:23