Closed artas360 closed 1 year ago
Thank you for the thorough investigation! I agree with your conclusion, the inner product implementation for the eigen backend is wrong. I can reproduce both the divergence on the master branch, and the correct behavior after the proposed fix. If you create the PR, I'll accept it, thanks!
Hi all,
I have been playing with AMGCL + Eigen backend for complex matrices and had issues getting convergence, while everything was fine for the builtin backend (or Eigen adapter w/ builtin backend). TL;DR is : I think the inner product of the eigen backend is at fault:
With the original
x.dot(y)
gmres stagnates, while withy.dot(x)
I see the same results as with the builtin backend. Any idea what could cause this assymetric behavior? (FYI the conjugation is done on the second parameter instruct inner_product_impl< std::complex<T> >
while eigen will conjugate the first one...)Here is the MWE I have (run with
./a.out mat.txt rhs.txt
), you can switch between the backends by switching theUSE_EIGEN_BACKEND
macro rhs.txt mat.txtI can create PR with the 'fix' but I would like to have a second opinion on why this should happen...