xref: /petsc/src/tao/bound/impls/bncg/bncg.h (revision c4b75bccfe5bcbbfb1eb60f6996a18ddf23ce09b)
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, X_old, W, work;
13     Vec unprojected_gradient;
14     Vec unprojected_gradient_old;
15     IS  active_lower, active_upper, active_fixed, active_idx, inactive_idx, inactive_old, new_inactives;
16     Vec inactive_grad, inactive_step;
17 
18     PetscInt  as_type;
19     PetscReal as_step, as_tol;
20 
21     PetscReal f;
22     PetscReal rho, pow;
23     PetscReal eta;         /*  Restart tolerance */
24     PetscReal delta_max;   /*  Minimum value for scaling */
25     PetscReal delta_min;   /*  Maximum value for scaling */
26 
27     PetscBool recycle;
28 
29     PetscInt cg_type;           /*  Formula to use */
30 
31     PetscInt ls_fails, resets, broken_ortho, descent_error;
32 } TAO_BNCG;
33 
34 #endif /* ifndef __TAO_BNCG_H */
35 
36 PETSC_INTERN PetscErrorCode TaoBNCGEstimateActiveSet(Tao, PetscInt);
37 PETSC_INTERN PetscErrorCode TaoBNCGBoundStep(Tao, Vec);
38 PETSC_EXTERN PetscErrorCode TaoBNCGSetRecycleFlag(Tao, PetscBool);
39