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, unprojected_gradient_old; 14 IS active_lower, active_upper, active_fixed, active_idx, inactive_idx, inactive_old, new_inactives; 15 Vec inactive_grad, inactive_step; 16 17 PetscInt as_type; 18 PetscReal as_step, as_tol; 19 20 PetscReal f; 21 PetscReal rho, pow; 22 PetscReal eta; /* Restart tolerance */ 23 24 PetscBool recycle; 25 26 PetscInt cg_type; /* Formula to use */ 27 28 PetscInt ls_fails, resets, broken_ortho, descent_error; 29 } TAO_BNCG; 30 31 #endif /* ifndef __TAO_BNCG_H */ 32 33 PETSC_INTERN PetscErrorCode TaoBNCGEstimateActiveSet(Tao, PetscInt); 34 PETSC_INTERN PetscErrorCode TaoBNCGBoundStep(Tao, PetscInt, Vec); 35 PETSC_EXTERN PetscErrorCode TaoBNCGSetRecycleFlag(Tao, PetscBool); 36