Actual source code: bmrm.h

  1: #ifndef __TAO_BMRM_H

  4: #include <petsc/private/taoimpl.h>
  5: #include <petscmath.h>

  7: #define BMRM_INFTY 1e30    /* single precision: ~\pm 10^{38.53}; PetscReal precision: ~\pm 10^{308.25} */
  8: #define ALPHA_MIN 1e-10
  9: #define ALPHA_MAX 1e10
 10: #define EPS_SV 1e-15
 11: #define EPS 1e-20
 12: #define TOL_LAM 1e-15
 13: #define TOL_R 1e-10
 14: #define INCRE_DIM 1000

 16: /* Context for BMRM solver */
 17: typedef struct{
 18:   VecScatter  scatter;     /* Scatter context  */
 19:   Vec local_w;
 20:   PetscReal lambda;
 21: }TAO_BMRM;

 23: typedef struct Vec_Chain{
 24:   Vec V;
 25:   struct Vec_Chain *next;
 26: }Vec_Chain;

 28: /* Context for Dai-Fletcher solver */
 29: typedef struct{
 30:   PetscInt maxProjIter;
 31:   PetscInt maxPGMIter;
 32:   PetscInt *ipt, *ipt2, *uv;
 33:   PetscReal *g, *y, *tempv, *d, *Qd, *t, *xplus, *tplus, *sk, *yk;

 35:   PetscInt dim;

 37:   PetscInt cur_num_cp;

 39:   /* Variables (i.e. Lagrangian multipliers) */
 40:   PetscReal *x;

 42:   /* Linear part of the objective function  */
 43:   PetscReal *f;

 45:   /* Hessian of the QP */
 46:   PetscReal **Q;

 48:   /* Constraint matrix  */
 49:   PetscReal *a;

 51:   /* RHS of the equality constraint */
 52:   PetscReal b;

 54:   /* Lower bound vector for the variables */
 55:   PetscReal *l;

 57:   /* Upper bound vector for the variables */
 58:   PetscReal *u;

 60:   /* Tolerance for optimization error */
 61:   PetscReal tol;
 62: }TAO_DF;

 64: #endif