MCPcopy Create free account
hub / github.com/NGSolve/ngsolve / __init__

Method __init__

python/krylovspace.py:972–985  ·  view source on GitHub ↗
(self, *args,
                 innerproduct : Optional[Callable[[BaseVector, BaseVector],
                                                  Union[float, complex]]] = None,
                 restart : Optional[int] = None,
                 **kwargs)

Source from the content-addressed store, hash-verified

970 name = "GMRes"
971
972 def __init__(self, *args,
973 innerproduct : Optional[Callable[[BaseVector, BaseVector],
974 Union[float, complex]]] = None,
975 restart : Optional[int] = None,
976 **kwargs):
977 super().__init__(*args, **kwargs)
978 if innerproduct is not None:
979 self.innerproduct = innerproduct
980 self.norm = lambda x: sqrt(innerproduct(x,x).real)
981 self.restart = restart
982 else:
983 self.innerproduct = lambda x, y: y.InnerProduct(x, conjugate=True)
984 self.norm = Norm
985 self.restart = restart
986
987 def _SolveImpl(self, rhs : BaseVector, sol : BaseVector):
988 is_complex = rhs.is_complex

Callers

nothing calls this directly

Calls 3

InnerProductMethod · 0.80
sqrtFunction · 0.50
__init__Method · 0.45

Tested by

no test coverage detected