:orphan: # KSPComputeOperator Computes the explicit preconditioned operator, including diagonal scaling and null space removal if applicable. ## Synopsis ``` #include "petscksp.h" PetscErrorCode KSPComputeOperator(KSP ksp, MatType mattype, Mat *mat) ``` Collective ## Input Parameters - ***ksp -*** the Krylov subspace context - ***mattype -*** the matrix type to be used ## Output Parameter - ***mat -*** the explicit preconditioned operator ## Notes This computation is done by applying the operators to columns of the identity matrix. Currently, this routine uses a dense matrix format for the output operator if mattype == NULL. This routine is costly in general, and is recommended for use only with relatively small systems. ## See Also [](ch_ksp), `KSP`, `KSPSetOperators()`, `KSPComputeEigenvaluesExplicitly()`, `PCComputeOperator()`, `KSPSetDiagonalScale()`, `KSPSetNullSpace()`, `MatType` ## Level advanced ## Location src/ksp/ksp/interface/eige.c --- [Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/ksp/ksp/interface/eige.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)