hifir4py.ksp.pipit_hifir¶
-
pipit_hifir
(A, b: numpy.ndarray, n_null: int, M=None, **kw) Tuple[numpy.ndarray, Dict[str, numpy.ndarray], int, dict] [source]¶ PIPIT solver for solving the pseudoinverse solution
PIPIT implements a pseudoinverse solution solver with small dimension of nullspace. The system can be potentially inconsistent in that the RHS vector may not fully in the range of A.
Parameters: - A (
csr_matrix
) – User input matrix - b (
ndarray
) – User input RHS - n_null (int) – Nullspace dimension (>0)
- M (
HIF
, optional) – HIF preconditioner - x0 (
ndarray
, optional) – Initial guess, default is zeros; if passed in, this will be overwritten by the solution. - verbose ({0,1,2}, optional) – Verbose level, 0 disables the verbose printing, while 1 enables HIF verbose logging; default is 1.
- restart (int, optional) – Restart dimension, default is 30
- rtols (list, optional) – Legnth-two list storing the relative tolerance thresholds, default is [1e-6, 1e-12], where the former is for solving least-squares solution using HIF-GMRES, and the latter is for solving nullspaces.
- work (
FGMRES_WorkSpace
, optional) – Workspace buffer, by default, the solver creates all buffer space. - vs (
ndarray
, optional) – User-provided right nullspace; if not given, thenvs
will be computed on-the-fly.
Returns: - x (
ndarray
) – The computed pseudoinverse solution, which overwritesx0
if provided - ns (dict) – A dictionary of
{"us": lns, "vs": rns}
wherelns
andrns
are left and right null-space components, respectively. - flag (int) – Termination flag for LS solver.
- info (dict) – Statistics for LS solver plus runtimes for factorization, left nullspace
computation, LS computation, and right nullspace computation stages,
i.e.,
info["times"]=[t_fac,t_lns,t_ls,t_rns]
.
See also
- A (