xref: /petsc/src/tao/bound/impls/bncg/bncg.h (revision c0f10754485ee18591b934b1c07ed0e16c2beadd)
1 /*
2     Context for bound-constrained nonlinear conjugate gradient method
3  */
4 
5 
6 #ifndef __TAO_BNCG_H
7 #define __TAO_BNCG_H
8 
9 #include <petsc/private/taoimpl.h>
10 
11 typedef struct {
12     Vec G_old;
13     Vec X_old;
14     Vec unprojected_gradient;
15     Vec unprojected_gradient_old;
16     IS  inactive_set;
17     Vec inactive_grad, inactive_step;
18 
19     PetscReal f;
20     PetscReal rho, pow;
21     PetscReal eta;         /*  Restart tolerance */
22     PetscReal delta_max;   /*  Minimum value for scaling */
23     PetscReal delta_min;   /*  Maximum value for scaling */
24 
25     PetscBool recycle;
26 
27     PetscInt cg_type;           /*  Formula to use */
28 
29     PetscInt ls_fails, resets, broken_ortho, descent_error;
30 } TAO_BNCG;
31 
32 #endif /* ifndef __TAO_BNCG_H */
33 
34 PETSC_INTERN PetscErrorCode TaoBNCGResetStepForNewInactives(Tao, Vec);
35 PETSC_EXTERN PetscErrorCode TaoBNCGSetRecycleFlag(Tao, PetscBool);
36