KSPLSQRConvergedDefault#
Determines convergence of the LSQR Krylov method.
Synopsis#
#include "petscksp.h"
PetscErrorCode KSPLSQRConvergedDefault(KSP ksp, PetscInt n, PetscReal rnorm, KSPConvergedReason *reason, void *ctx)
Collective on ksp
Input Parameters#
ksp - iterative context
n - iteration number
rnorm - 2-norm residual value (may be estimated)
ctx - convergence context which must be created by KSPConvergedDefaultCreate()
reason is set to#
positive - if the iteration has converged;
negative - if residual norm exceeds divergence threshold;
0 - otherwise.
Notes#
KSPConvergedDefault() is called first to check for convergence in Ax=b. If that does not determine convergence then checks convergence for the least squares problem, i.e. in min{|b-Ax|}. Possible convergence for the least squares problem (which is based on the residual of the normal equations) are KSP_CONVERGED_RTOL_NORMAL norm and KSP_CONVERGED_ATOL_NORMAL. KSP_CONVERGED_RTOL_NORMAL is returned if ||A’*r|| < rtol * ||A|| * ||r||. Matrix norm ||A|| is iteratively refined estimate, see KSPLSQRGetNorms(). This criterion is now largely compatible with that in MATLAB lsqr().
See Also#
KSPLSQR
, KSPSetConvergenceTest()
, KSPSetTolerances()
, KSPConvergedSkip()
, KSPConvergedReason
, KSPGetConvergedReason()
,
KSPConvergedDefaultSetUIRNorm()
, KSPConvergedDefaultSetUMIRNorm()
, KSPConvergedDefaultCreate()
, KSPConvergedDefaultDestroy()
, KSPConvergedDefault()
, KSPLSQRGetNorms()
, KSPLSQRSetExactMatNorm()
Level#
intermediate
Location#
Index of all KSP routines
Table of Contents for all manual pages
Index of all manual pages