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