Actual source code: symbrdnrescale.h

      1: #pragma once

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

      5: PETSC_INTERN PetscLogEvent SBRDN_Rescale;

      7: typedef struct _n_SymBroydenRescale *SymBroydenRescale;

      9: struct _n_SymBroydenRescale {
     10:   PetscInt                   k;
     11:   Vec                        invDnew, BFGS, DFP, U, V, W; /* work vectors for diagonal scaling */
     12:   PetscReal                 *yty, *sts, *yts;             /* scalar arrays for recycling dot products */
     13:   PetscReal                  theta, rho, alpha, beta;     /* convex combination factors for the scalar or diagonal scaling */
     14:   PetscReal                  delta, delta_min, delta_max, sigma, tol;
     15:   PetscInt                   sigma_hist; /* length of update history to be used for scaling */
     16:   PetscBool                  allocated;
     17:   PetscBool                  initialized;
     18:   PetscBool                  forward;
     19:   MatLMVMSymBroydenScaleType scale_type;
     20: };

     22: PETSC_INTERN PetscErrorCode SymBroydenRescaleSetDiagonalMode(SymBroydenRescale, PetscBool);
     23: PETSC_INTERN PetscErrorCode SymBroydenRescaleGetType(SymBroydenRescale, MatLMVMSymBroydenScaleType *);
     24: PETSC_INTERN PetscErrorCode SymBroydenRescaleSetType(SymBroydenRescale, MatLMVMSymBroydenScaleType);
     25: PETSC_INTERN PetscErrorCode SymBroydenRescaleSetDelta(Mat, SymBroydenRescale, PetscReal);
     26: PETSC_INTERN PetscErrorCode SymBroydenRescaleSetUp(Mat, SymBroydenRescale);
     27: PETSC_INTERN PetscErrorCode SymBroydenRescaleInitializeJ0(Mat, SymBroydenRescale);
     28: PETSC_INTERN PetscErrorCode SymBroydenRescaleUpdate(Mat, SymBroydenRescale);
     29: PETSC_INTERN PetscErrorCode SymBroydenRescaleCopy(SymBroydenRescale, SymBroydenRescale);
     30: PETSC_INTERN PetscErrorCode SymBroydenRescaleView(SymBroydenRescale, PetscViewer);
     31: PETSC_INTERN PetscErrorCode SymBroydenRescaleSetFromOptions(Mat, SymBroydenRescale, PetscOptionItems PetscOptionsObject);
     32: PETSC_INTERN PetscErrorCode SymBroydenRescaleReset(Mat, SymBroydenRescale, MatLMVMResetMode);
     33: PETSC_INTERN PetscErrorCode SymBroydenRescaleDestroy(SymBroydenRescale *);
     34: PETSC_INTERN PetscErrorCode SymBroydenRescaleCreate(SymBroydenRescale *);