:orphan: # KSP_GMRES_CGS_REFINE_IFNEEDED Do the classical (unmodified) Gram-Schmidt process and one step of iterative refinement if an estimate of the orthogonality of the resulting vectors indicates poor orthogonality. ## Note This is slower than `KSP_GMRES_CGS_REFINE_NEVER` because it requires an extra norm computation to estimate the orthogonality but is more stable. ## See Also [](ch_ksp), `KSPGMRESCGSRefinementType`, `KSPGMRESClassicalGramSchmidtOrthogonalization()`, `KSPGMRESSetOrthogonalization()`, `KSP`, `KSPGMRESGetOrthogonalization()`, `KSPGMRESSetCGSRefinementType()`, `KSPGMRESGetCGSRefinementType()`, `KSP_GMRES_CGS_REFINE_NEVER`, `KSP_GMRES_CGS_REFINE_ALWAYS`, `KSPGMRESModifiedGramSchmidtOrthogonalization()` ## Level advanced ## Location include/petscksp.h --- [Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/include/petscksp.h) [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)