2: /* 3: Private Krylov Context Structure (KSP) for Conjugate Gradient 5: This one is very simple. It contains a flag indicating the symmetry 6: structure of the matrix and work space for (optionally) computing 7: eigenvalues. 9: */ 11: #ifndef __CGIMPL_H 14: /* 15: Defines the basic KSP object 16: */ 17: #include <petsc/private/kspimpl.h> 19: PETSC_INTERN PetscErrorCode KSPDestroy_CG(KSP); 20: PETSC_INTERN PetscErrorCode KSPReset_CG(KSP); 21: PETSC_INTERN PetscErrorCode KSPView_CG(KSP, PetscViewer); 22: PETSC_INTERN PetscErrorCode KSPSetFromOptions_CG(KSP, PetscOptionItems *PetscOptionsObject); 23: PETSC_INTERN PetscErrorCode KSPCGSetType_CG(KSP, KSPCGType); 25: /* 26: The field should remain the same since it is shared by the BiCG code 27: */ 29: typedef struct { 30: KSPCGType type; /* type of system (symmetric or Hermitian) */ 31: PetscScalar emin, emax; /* eigenvalues */ 32: // The following arrays are of size ksp->maxit 33: PetscScalar *e, *d; 34: PetscReal *ee, *dd; /* work space for Lanczos algorithm */ 36: PetscBool singlereduction; /* use variant of CG that combines both inner products */ 37: } KSP_CG; 39: #endif