Date: 2021-03-03T22:27:38+00:00

Actual source code: symbrdn.h
petsc-3.14.5 2021-03-03
Report Typos and Errors

      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:   PetscReal theta, phi, *psi;               /* convex combination factors between DFP and BFGS */
     16:   PetscReal rho, alpha, beta;               /* convex combination factors for the scalar or diagonal scaling */
     17:   PetscReal delta, delta_min, delta_max, sigma;
     18:   PetscInt  sigma_hist;                      /* length of update history to be used for scaling */
     19:   MatLMVMSymBroydenScaleType  scale_type;
     20:   PetscInt  watchdog, max_seq_rejects;        /* tracker to reset after a certain # of consecutive rejects */
     21: } Mat_SymBrdn;

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

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