Actual source code: taosolverregi.c

      1: #include <petsc/private/taoimpl.h>

      3: PETSC_EXTERN PetscErrorCode TaoCreate_LMVM(Tao);
      4: PETSC_EXTERN PetscErrorCode TaoCreate_NLS(Tao);
      5: PETSC_EXTERN PetscErrorCode TaoCreate_NTR(Tao);
      6: PETSC_EXTERN PetscErrorCode TaoCreate_NTL(Tao);
      7: PETSC_EXTERN PetscErrorCode TaoCreate_NM(Tao);
      8: PETSC_EXTERN PetscErrorCode TaoCreate_CG(Tao);
      9: PETSC_EXTERN PetscErrorCode TaoCreate_TRON(Tao);
     10: PETSC_EXTERN PetscErrorCode TaoCreate_OWLQN(Tao);
     11: PETSC_EXTERN PetscErrorCode TaoCreate_BMRM(Tao);
     12: PETSC_EXTERN PetscErrorCode TaoCreate_BLMVM(Tao);
     13: PETSC_EXTERN PetscErrorCode TaoCreate_BQNLS(Tao);
     14: PETSC_EXTERN PetscErrorCode TaoCreate_BNCG(Tao);
     15: PETSC_EXTERN PetscErrorCode TaoCreate_BNLS(Tao);
     16: PETSC_EXTERN PetscErrorCode TaoCreate_BNTR(Tao);
     17: PETSC_EXTERN PetscErrorCode TaoCreate_BNTL(Tao);
     18: PETSC_EXTERN PetscErrorCode TaoCreate_BQNKLS(Tao);
     19: PETSC_EXTERN PetscErrorCode TaoCreate_BQNKTR(Tao);
     20: PETSC_EXTERN PetscErrorCode TaoCreate_BQNKTL(Tao);
     21: PETSC_EXTERN PetscErrorCode TaoCreate_GPCG(Tao);
     22: PETSC_EXTERN PetscErrorCode TaoCreate_BQPIP(Tao);
     23: PETSC_EXTERN PetscErrorCode TaoCreate_POUNDERS(Tao);
     24: PETSC_EXTERN PetscErrorCode TaoCreate_BRGN(Tao);
     25: PETSC_EXTERN PetscErrorCode TaoCreate_LCL(Tao);
     26: PETSC_EXTERN PetscErrorCode TaoCreate_SSILS(Tao);
     27: PETSC_EXTERN PetscErrorCode TaoCreate_SSFLS(Tao);
     28: PETSC_EXTERN PetscErrorCode TaoCreate_ASILS(Tao);
     29: PETSC_EXTERN PetscErrorCode TaoCreate_ASFLS(Tao);
     30: PETSC_EXTERN PetscErrorCode TaoCreate_IPM(Tao);
     31: PETSC_EXTERN PetscErrorCode TaoCreate_PDIPM(Tao);
     32: PETSC_EXTERN PetscErrorCode TaoCreate_ADMM(Tao);
     33: PETSC_EXTERN PetscErrorCode TaoCreate_ALMM(Tao);
     34: PETSC_EXTERN PetscErrorCode TaoCreate_Shell(Tao);
     35: PETSC_EXTERN PetscErrorCode TaoCreate_SNES(Tao);

     37: /*
     38:    Offset the convergence reasons so negative number represent diverged and
     39:    positive represent converged.
     40: */
     41: const char  *TaoConvergedReasons_Shifted[] = {"DIVERGED_USER",
     42:                                               "DIVERGED_TR_REDUCTION",
     43:                                               "DIVERGED_LS_FAILURE",
     44:                                               "DIVERGED_MAXFCN",
     45:                                               "DIVERGED_NAN",
     46:                                               "",
     47:                                               "DIVERGED_MAXITS",
     48:                                               "DIVERGED_FUNCTION_DOMAIN",

     50:                                               "CONTINUE_ITERATING",

     52:                                               "",
     53:                                               "",
     54:                                               "CONVERGED_GATOL",
     55:                                               "CONVERGED_GRTOL",
     56:                                               "CONVERGED_GTTOL",
     57:                                               "CONVERGED_STEPTOL",
     58:                                               "CONVERGED_MINF",
     59:                                               "CONVERGED_USER"};
     60: const char **TaoConvergedReasons           = TaoConvergedReasons_Shifted - TAO_DIVERGED_USER;

     62: /*@C
     63:   TaoRegisterAll - Registers all of the optimization methods in the Tao
     64:   package.

     66:   Not Collective

     68:   Level: developer

     70: .seealso: `Tao`, `TaoRegister()`, `TaoRegisterDestroy()`
     71: @*/
     72: PetscErrorCode TaoRegisterAll(void)
     73: {
     74: #if !defined(PETSC_USE_COMPLEX)
     75: #endif

     77:   PetscFunctionBegin;
     78:   if (TaoRegisterAllCalled) PetscFunctionReturn(PETSC_SUCCESS);
     79:   TaoRegisterAllCalled = PETSC_TRUE;
     80: #if !defined(PETSC_USE_COMPLEX)
     81:   PetscCall(TaoRegister(TAOLMVM, TaoCreate_LMVM));
     82:   PetscCall(TaoRegister(TAONLS, TaoCreate_NLS));
     83:   PetscCall(TaoRegister(TAONTR, TaoCreate_NTR));
     84:   PetscCall(TaoRegister(TAONTL, TaoCreate_NTL));
     85:   PetscCall(TaoRegister(TAOCG, TaoCreate_CG));
     86:   PetscCall(TaoRegister(TAOTRON, TaoCreate_TRON));
     87:   PetscCall(TaoRegister(TAOOWLQN, TaoCreate_OWLQN));
     88:   PetscCall(TaoRegister(TAOBMRM, TaoCreate_BMRM));
     89:   PetscCall(TaoRegister(TAOBLMVM, TaoCreate_BLMVM));
     90:   PetscCall(TaoRegister(TAOBQNLS, TaoCreate_BQNLS));
     91:   PetscCall(TaoRegister(TAOBNCG, TaoCreate_BNCG));
     92:   PetscCall(TaoRegister(TAOBNLS, TaoCreate_BNLS));
     93:   PetscCall(TaoRegister(TAOBNTR, TaoCreate_BNTR));
     94:   PetscCall(TaoRegister(TAOBNTL, TaoCreate_BNTL));
     95:   PetscCall(TaoRegister(TAOBQNKLS, TaoCreate_BQNKLS));
     96:   PetscCall(TaoRegister(TAOBQNKTR, TaoCreate_BQNKTR));
     97:   PetscCall(TaoRegister(TAOBQNKTL, TaoCreate_BQNKTL));
     98:   PetscCall(TaoRegister(TAOBQPIP, TaoCreate_BQPIP));
     99:   PetscCall(TaoRegister(TAOGPCG, TaoCreate_GPCG));
    100:   PetscCall(TaoRegister(TAONM, TaoCreate_NM));
    101:   PetscCall(TaoRegister(TAOPOUNDERS, TaoCreate_POUNDERS));
    102:   PetscCall(TaoRegister(TAOBRGN, TaoCreate_BRGN));
    103:   PetscCall(TaoRegister(TAOLCL, TaoCreate_LCL));
    104:   PetscCall(TaoRegister(TAOSSILS, TaoCreate_SSILS));
    105:   PetscCall(TaoRegister(TAOSSFLS, TaoCreate_SSFLS));
    106:   PetscCall(TaoRegister(TAOASILS, TaoCreate_ASILS));
    107:   PetscCall(TaoRegister(TAOASFLS, TaoCreate_ASFLS));
    108:   PetscCall(TaoRegister(TAOIPM, TaoCreate_IPM));
    109:   PetscCall(TaoRegister(TAOPDIPM, TaoCreate_PDIPM));
    110:   PetscCall(TaoRegister(TAOSHELL, TaoCreate_Shell));
    111:   PetscCall(TaoRegister(TAOADMM, TaoCreate_ADMM));
    112:   PetscCall(TaoRegister(TAOALMM, TaoCreate_ALMM));
    113:   PetscCall(TaoRegister(TAOSNES, TaoCreate_SNES));
    114: #endif
    115:   PetscFunctionReturn(PETSC_SUCCESS);
    116: }