# 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
 [](chapter_ksp), `KSPSolve()`, `KSPLSQR`, `KSPLSQRGetNorms()`, `KSPLSQRConvergedDefault()`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/impls/lsqr/lsqr.c.html#KSPLSQRSetExactMatNorm">src/ksp/ksp/impls/lsqr/lsqr.c</A>


---
[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](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
