:orphan: # KSPLSQRSetExactMatNorm Compute exact matrix norm instead of iteratively refined estimate. ## Synopsis ``` #include "petscksp.h" PetscErrorCode KSPLSQRSetExactMatNorm(KSP ksp, PetscBool flg) ``` Not Collective ## Input Parameters - ***ksp -*** iterative context - ***flg -*** compute exact matrix norm or not ## Notes By default, flg = `PETSC_FALSE`. This is usually preferred to avoid possibly expensive computation of the norm. For flg = `PETSC_TRUE`, we call `MatNorm`(Amat,`NORM_FROBENIUS`,&lsqr->anorm) which will work only for some types of explicitly assembled matrices. This can affect convergence rate as `KSPLSQRConvergedDefault()` assumes different value of ||A|| used in normal equation stopping criterion. ## See Also [](ch_ksp), `KSPSolve()`, `KSPLSQR`, `KSPLSQRGetNorms()`, `KSPLSQRConvergedDefault()` ## Level intermediate ## Location src/ksp/ksp/impls/lsqr/lsqr.c --- [Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/ksp/ksp/impls/lsqr/lsqr.c) [Index of all KSP routines](index.md) [Table of Contents for all manual pages](/manualpages/index.md) [Index of all manual pages](/manualpages/singleindex.md)