Date: 2022-03-31T04:49:02+00:00

Actual source code: bqnktr.c

      1: #include <../src/tao/bound/impls/bqnk/bqnk.h>
      2: #include <petscksp.h>

      4: static PetscErrorCode TaoSetUp_BQNKTR(Tao tao)
      5: {
      6:   KSP               ksp;
      7:   PetscVoidFunction valid;

      9:   TaoSetUp_BQNK(tao);
     10:   TaoGetKSP(tao,&ksp);
     11:   PetscObjectQueryFunction((PetscObject)ksp,"KSPCGSetRadius_C",&valid);
     13:   return 0;
     14: }

     16: /*MC
     17:   TAOBQNKTR - Bounded Quasi-Newton-Krylov Trust Region method for nonlinear minimization with
     18:               bound constraints. This method approximates the Hessian-vector product using a
     19:               limited-memory quasi-Newton formula, and iteratively inverts the Hessian with a
     20:               Krylov solver. The quasi-Newton matrix and its settings can be accessed via the
     21:               prefix `-tao_bqnk_`. For options database, see TAOBNK

     23:   Level: beginner
     24: .seealso TAOBNK, TAOBQNKTR, TAOBQNKLS
     25: M*/
     26: PETSC_EXTERN PetscErrorCode TaoCreate_BQNKTR(Tao tao)
     27: {
     28:   TAO_BNK        *bnk;
     29:   TAO_BQNK       *bqnk;

     31:   TaoCreate_BQNK(tao);
     32:   tao->ops->setup = TaoSetUp_BQNKTR;
     33:   bnk = (TAO_BNK*)tao->data;
     34:   bqnk = (TAO_BQNK*)bnk->ctx;
     35:   bqnk->solve = TaoSolve_BNTR;
     36:   return 0;
     37: }