Actual source code: cgtype.c

      1: #define PETSCKSP_DLL

     3:  #include src/ksp/ksp/impls/cg/cgctx.h

      7: /*@
      8:     KSPCGSetType - Sets the variant of the conjugate gradient method to
      9:     use for solving a linear system with a complex coefficient matrix.
     10:     This option is irrelevant when solving a real system.

     12:     Collective on KSP

     14:     Input Parameters:
     15: +   ksp - the iterative context
     16: -   type - the variant of CG to use, one of
     17: .vb
     18:       KSP_CG_HERMITIAN - complex, Hermitian matrix (default)
     19:       KSP_CG_SYMMETRIC - complex, symmetric matrix
     20: .ve

     22:     Level: intermediate
     23:
     24:     Options Database Keys:
     25: +   -ksp_cg_Hermitian - Indicates Hermitian matrix
     26: -   -ksp_cg_symmetric - Indicates symmetric matrix

     28:     Note:
     29:     By default, the matrix is assumed to be complex, Hermitian.

     31: .keywords: CG, conjugate gradient, Hermitian, symmetric, set, type
     32: @*/
     33: PetscErrorCode PETSCKSP_DLLEXPORT KSPCGSetType(KSP ksp,KSPCGType type)
     34: {
     35:   PetscErrorCode ierr,(*f)(KSP,KSPCGType);

     39:   PetscObjectQueryFunction((PetscObject)ksp,"KSPCGSetType_C",(void (**)(void))&f);
     40:   if (f) {
     41:     (*f)(ksp,type);
     42:   }
     43:   return(0);
     44: }