xref: /petsc/src/tao/quadratic/impls/gpcg/gpcg.h (revision 58d68138c660dfb4e9f5b03334792cd4f2ffd7cc)
1 #ifndef __TAO_GPCG_H
2 #define __TAO_GPCG_H
3 #include <petsc/private/taoimpl.h>
4 #include <petsctaolinesearch.h>
5 
6 typedef struct {
7   /* Parameters */
8   PetscReal pg_ftol;
9   PetscReal actred;
10   PetscReal f_new;
11   PetscReal minstep;
12   PetscReal stepsize;
13   PetscReal gnorm;
14 
15   PetscReal sigma1, sigma2, sigma3;
16 
17   PetscInt maxgpits;
18 
19   /* Problem variables, vectors and index sets */
20 
21   /* Problem statistics */
22 
23   PetscInt n; /* Dimension of the Problem */
24 
25   PetscInt total_cgits;
26   PetscInt cg_iterates;
27   PetscInt total_gp_its;
28   PetscInt gp_iterates;
29   PetscInt cgits;
30 
31   Vec G_New;
32   Vec DXFree;
33   Vec R;
34   Vec DX;
35   Vec X;
36   Vec X_New;
37   Vec G, PG;
38   Vec Work;
39 
40   Mat       H;
41   Vec       B;
42   PetscReal c;
43 
44   PetscReal f;
45   PetscReal step;
46   Mat       Hsub;
47   Mat       Hsub_pre;
48 
49   IS Free_Local; /* Indices of local variables equal to lower bound */
50   IS TT;         /* Indices of local variables equal to upper bound */
51 
52   PetscInt n_free; /* Number of free variables */
53   PetscInt n_upper;
54   PetscInt n_lower;
55   PetscInt n_bind; /* Number of binding varibles */
56   PetscInt ksp_type;
57   PetscInt subset_type;
58 } TAO_GPCG;
59 
60 #endif
61