/*MC TAOBQNKTL - Bounded Quasi-Newton-Krylov Trust-region with Line-search fallback, for nonlinear minimization with bound constraints. This method approximates the Hessian-vector product using a limited-memory quasi-Newton formula, and iteratively inverts the Hessian with a Krylov solver. The quasi-Newton matrix and its settings can be accessed via the prefix `-tao_bqnk_` Options Database Keys: + -tao_bqnk_max_cg_its - maximum number of bounded conjugate-gradient iterations taken in each Newton loop . -tao_bqnk_init_type - trust radius initialization method ("constant", "direction", "interpolation") . -tao_bqnk_update_type - trust radius update method ("step", "direction", "interpolation") - -tao_bqnk_as_type - active-set estimation method ("none", "bertsekas") Level: beginner M*/ PETSC_EXTERN PetscErrorCode TaoCreate_BQNKTL(Tao tao) { PetscErrorCode ierr; PetscFunctionBegin; ierr = TaoCreate_BQNK(tao);CHKERRQ(ierr); tao->ops->solve = TaoSolve_BNTL; PetscFunctionReturn(0); }
PETSC_EXTERN PetscErrorCode TaoCreate_BQNLS(Tao tao) { TAO_BNK *bnk; TAO_BQNK *bqnk; PetscErrorCode ierr; PetscFunctionBegin; ierr = TaoCreate_BQNK(tao);CHKERRQ(ierr); ierr = KSPSetOptionsPrefix(tao->ksp, "unused");CHKERRQ(ierr); tao->ops->solve = TaoSolve_BNLS; tao->ops->setfromoptions = TaoSetFromOptions_BQNLS; bnk = (TAO_BNK*)tao->data; bnk->update_type = BNK_UPDATE_STEP; bnk->computehessian = TaoBQNLSComputeHessian; bnk->computestep = TaoBQNLSComputeStep; bqnk = (TAO_BQNK*)bnk->ctx; ierr = MatSetOptionsPrefix(bqnk->B, "tao_bqnls_");CHKERRQ(ierr); ierr = MatSetType(bqnk->B, MATLMVMBFGS);CHKERRQ(ierr); PetscFunctionReturn(0); }