1ac9112b8SAlp Dener /* 2ac9112b8SAlp Dener Context for bound-constrained nonlinear conjugate gradient method 3ac9112b8SAlp Dener */ 4ac9112b8SAlp Dener 5ac9112b8SAlp Dener 6ac9112b8SAlp Dener #ifndef __TAO_BNCG_H 7ac9112b8SAlp Dener #define __TAO_BNCG_H 8ac9112b8SAlp Dener 9ac9112b8SAlp Dener #include <petsc/private/taoimpl.h> 10ac9112b8SAlp Dener 11ac9112b8SAlp Dener typedef struct { 12*c4b75bccSAlp Dener Vec G_old, X_old, W, work; 13ac9112b8SAlp Dener Vec unprojected_gradient; 14ac9112b8SAlp Dener Vec unprojected_gradient_old; 1561be54a6SAlp Dener IS active_lower, active_upper, active_fixed, active_idx, inactive_idx, inactive_old, new_inactives; 16ac9112b8SAlp Dener Vec inactive_grad, inactive_step; 17ac9112b8SAlp Dener 1861be54a6SAlp Dener PetscInt as_type; 1961be54a6SAlp Dener PetscReal as_step, as_tol; 2061be54a6SAlp Dener 21c0f10754SAlp Dener PetscReal f; 22ac9112b8SAlp Dener PetscReal rho, pow; 23ac9112b8SAlp Dener PetscReal eta; /* Restart tolerance */ 24ac9112b8SAlp Dener PetscReal delta_max; /* Minimum value for scaling */ 25ac9112b8SAlp Dener PetscReal delta_min; /* Maximum value for scaling */ 26ac9112b8SAlp Dener 27c0f10754SAlp Dener PetscBool recycle; 28c0f10754SAlp Dener 29ac9112b8SAlp Dener PetscInt cg_type; /* Formula to use */ 30ac9112b8SAlp Dener 31ac9112b8SAlp Dener PetscInt ls_fails, resets, broken_ortho, descent_error; 32ac9112b8SAlp Dener } TAO_BNCG; 33ac9112b8SAlp Dener 34ac9112b8SAlp Dener #endif /* ifndef __TAO_BNCG_H */ 35ac9112b8SAlp Dener 3661be54a6SAlp Dener PETSC_INTERN PetscErrorCode TaoBNCGEstimateActiveSet(Tao, PetscInt); 3761be54a6SAlp Dener PETSC_INTERN PetscErrorCode TaoBNCGBoundStep(Tao, Vec); 38c0f10754SAlp Dener PETSC_EXTERN PetscErrorCode TaoBNCGSetRecycleFlag(Tao, PetscBool); 39