I am using the CUSP CG solver and I ran it on couple of sparse matrices from the University of Florida sparse matrix collection. The solver was able to solve non positive definite sparse matrices. My understanding is that CG solvers can't solve non positive definite sparse matrices? So is how was CUSP's CG solver able to do it?


I highly recommend the following read:

In short, if the matrix is non-positive definite, there is no guarantee that CG will fail. It might be able to solve it (for some RHSs and certain tolerances), but it is just not supposed to and, probably, converges slower than the appropriate methods.

You definitely should look into the other iterative solvers (say, BiCGStab or something else, depending on your problem properties).

NB: I am not familiar with CUPS, so I would also check if there is a function inside that checks the property of the matrix and switches to some other algorithm (unlikely, but possible) – especially if the solver log is ambiguous.


Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.