KSPCGSetType#

Sets the variant of the conjugate gradient method to use for solving a linear system with a complex coefficient matrix. This option is irrelevant when solving a real system.

Synopsis#

#include "petscksp.h" 
PetscErrorCode KSPCGSetType(KSP ksp, KSPCGType type)

Logically Collective

Input Parameters#

  • ksp - the iterative context

  • type - the variant of CG to use, one of

      KSP_CG_HERMITIAN - complex, Hermitian matrix (default)
      KSP_CG_SYMMETRIC - complex, symmetric matrix

Options Database Keys#

  • -ksp_cg_type hermitian - Indicates Hermitian matrix

  • -ksp_cg_type symmetric - Indicates symmetric matrix

Note#

By default, the matrix is assumed to be complex, Hermitian.

See Also#

KSP: Linear System Solvers, KSP, KSPCG

Level#

intermediate

Location#

src/ksp/ksp/impls/cg/cgtype.c

Implementations#

KSPCGSetType_CG() in src/ksp/ksp/impls/cg/cg.c
KSPCGSetType_CGNE() in src/ksp/ksp/impls/cg/cgne/cgne.c


Index of all KSP routines
Table of Contents for all manual pages
Index of all manual pages