Menu

CG Solver Fails with Jacobi Preconditioner for Negative Definite Matrices

2016-10-21
2016-10-21
  • Breannan Smith

    Breannan Smith - 2016-10-21

    The CG solver provided with ViennaCL works without issue for negative definite left hand sides. When provided with the Jacobi preconditioner, however, the CG solver immediately returns a solution of 0 if the left hand side is negative definite. Adding an absolute value to the variable norm_rhs_squared on line 286 of http://viennacl.sourceforge.net/doc/cg_8hpp_source.html seems to resolve the issue, in my tests.

    While I have of course modified the code on my side to provide a positive definite matrix, other CG implementations (including the one provided with Eigen with a Jacobi preconditioner) work fine if all eigenvalues are negative.

    Is the intended behavior to return a solution of 0? Is this fix sufficient?

    Thank you!

     

Log in to post a comment.