Actual source code: bmrm.h
petsc-3.14.6 2021-03-30
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;
29: /* Context for Dai-Fletcher solver */
30: typedef struct{
31: PetscInt maxProjIter;
32: PetscInt maxPGMIter;
33: PetscInt *ipt, *ipt2, *uv;
34: PetscReal *g, *y, *tempv, *d, *Qd, *t, *xplus, *tplus, *sk, *yk;
36: PetscInt dim;
38: PetscInt cur_num_cp;
40: /* Variables (i.e. Lagrangian multipliers) */
41: PetscReal *x;
43: /* Linear part of the objective function */
44: PetscReal *f;
46: /* Hessian of the QP */
47: PetscReal **Q;
49: /* Constraint matrix */
50: PetscReal *a;
52: /* RHS of the equality constraint */
53: PetscReal b;
55: /* Lower bound vector for the variables */
56: PetscReal *l;
58: /* Upper bound vector for the variables */
59: PetscReal *u;
61: /* Tolerance for optimization error */
62: PetscReal tol;
63: }TAO_DF;
69: #endif