Actual source code: symbrdn.h

  1: #include <../src/ksp/ksp/utils/lmvm/lmvm.h>

  3: /*
  4:   Limited-memory Symmetric Broyden method for approximating both
  5:   the forward product and inverse application of a Jacobian.
  6: */

  8: typedef struct {
  9:   Mat                        D;                                 /* diagonal scaling term */
 10:   Vec                       *P, *Q;                             /* storage vectors for (B_i)*S[i] and (B_i)^{-1}*Y[i] */
 11:   Vec                        invDnew, invD, BFGS, DFP, U, V, W; /* work vectors for diagonal scaling */
 12:   Vec                        work;
 13:   PetscBool                  allocated, needP, needQ;
 14:   PetscReal                 *stp, *ytq, *yts, *yty, *sts; /* scalar arrays for recycling dot products */
 15:   PetscScalar               *workscalar;                  /* work scalar array */
 16:   PetscReal                  theta, phi, *psi;            /* convex combination factors between DFP and BFGS */
 17:   PetscReal                  rho, alpha, beta;            /* convex combination factors for the scalar or diagonal scaling */
 18:   PetscReal                  delta, delta_min, delta_max, sigma;
 19:   PetscInt                   sigma_hist; /* length of update history to be used for scaling */
 20:   MatLMVMSymBroydenScaleType scale_type;
 21:   PetscInt                   watchdog, max_seq_rejects; /* tracker to reset after a certain # of consecutive rejects */
 22: } Mat_SymBrdn;

 24: PETSC_INTERN PetscErrorCode MatSymBrdnApplyJ0Fwd(Mat, Vec, Vec);
 25: PETSC_INTERN PetscErrorCode MatSymBrdnApplyJ0Inv(Mat, Vec, Vec);
 26: PETSC_INTERN PetscErrorCode MatSymBrdnComputeJ0Diag(Mat);
 27: PETSC_INTERN PetscErrorCode MatSymBrdnComputeJ0Scalar(Mat);

 29: PETSC_INTERN PetscErrorCode MatView_LMVMSymBrdn(Mat, PetscViewer);
 30: PETSC_INTERN PetscErrorCode MatSetFromOptions_LMVMSymBrdn(Mat, PetscOptionItems *);
 31: PETSC_INTERN PetscErrorCode MatSetFromOptions_LMVMSymBrdn_Private(Mat, PetscOptionItems *);