ginkgo
ginkgo copied to clipboard
Test solvers and preconditioners with complex values
We currently don't do any solver and preconditioner tests with complex values. For generality, we should change that! Some implementations contain bugs in that regard.
Examples: https://github.com/ginkgo-project/ginkgo/blob/500d4a5719ab0b60f76f7f5cbc6f77fd6254f544/reference/solver/gmres_kernels.cpp#L90
While investigating a bit more, we need to change multiple parts of our implementation if we want to properly support complex:
-
Dense::compute_norm2
should put the result into aDense<remove_complex<ValueType>>
While usingsquared_norm()
instead ofcompute_dot
inside the kernels. Reference kernel example: https://github.com/ginkgo-project/ginkgo/blob/develop/reference/matrix/dense_kernels.cpp#L187 - The
Convergence
logger should also use the non-complex storage type here: https://github.com/ginkgo-project/ginkgo/blob/develop/core/log/convergence.cpp#L61 - The
ResidualNormReduction
stopping criterion should use the non-complex vector type:using Vector = matrix::Dense<remove_complex<ValueType>>
here: https://github.com/ginkgo-project/ginkgo/blob/develop/include/ginkgo/core/stop/residual_norm_reduction.hpp#L71
There might be more, but these are the ones I could find this far.