Actual source code: petsctao.h

  1: #ifndef PETSCTAO_H
  2: #define PETSCTAO_H

  4: #include <petscsnes.h>

  6: PetscErrorCode VecFischer(Vec, Vec, Vec, Vec, Vec);
  7: PetscErrorCode VecSFischer(Vec, Vec, Vec, Vec, PetscReal, Vec);
  8: PetscErrorCode MatDFischer(Mat, Vec, Vec, Vec, Vec, Vec, Vec, Vec, Vec);
  9: PetscErrorCode MatDSFischer(Mat, Vec, Vec, Vec, Vec, PetscReal, Vec, Vec, Vec, Vec, Vec);
 10: PETSC_EXTERN PetscErrorCode TaoSoftThreshold(Vec, PetscReal, PetscReal, Vec);


 13: /*E
 14:   TaoSubsetType - PetscInt representing the way TAO handles active sets

 16: + TAO_SUBSET_SUBVEC - TAO uses PETSc's MatCreateSubMatrix and VecGetSubVector
 17: . TAO_SUBSET_MASK - Matrices are zeroed out corresponding to active set entries
 18: - TAO_SUBSET_MATRIXFREE - Same as TAO_SUBSET_MASK, but can be applied to matrix-free operators

 20:   Options database keys:
 21: . -different_hessian - TAO will use a copy of the hessian operator for masking.  By default
 22:                        TAO will directly alter the hessian operator.
 23:   Level: intermediate

 25: E*/

 27: typedef enum {TAO_SUBSET_SUBVEC,TAO_SUBSET_MASK,TAO_SUBSET_MATRIXFREE} TaoSubsetType;
 28: PETSC_EXTERN const char *const TaoSubsetTypes[];
 29: /*S
 30:      Tao - Abstract PETSc object that manages nonlinear optimization solves

 32:    Level: advanced

 34: .seealso TaoCreate(), TaoDestroy(), TaoSetType(), TaoType
 35: S*/

 37: /*E
 38:      TaoADMMUpdateType - Determine spectral penalty update routine for lagrange augmented term for ADMM.

 40:   Level: advanced

 42: .seealso TaoADMMSetUpdateType()
 43: E*/
 44: typedef enum {TAO_ADMM_UPDATE_BASIC,TAO_ADMM_UPDATE_ADAPTIVE,TAO_ADMM_UPDATE_ADAPTIVE_RELAXED} TaoADMMUpdateType;
 45: PETSC_EXTERN const char *const TaoADMMUpdateTypes[];
 46: /*MC
 47:      TAO_ADMM_UPDATE_BASIC - Use same spectral penalty set at the beginning. No update

 49:   Level: advanced

 51:   Note: Most basic implementation. Generally slower than adaptive or adaptive relaxed version.

 53: .seealso: TaoADMMSetUpdateType(), TAO_ADMM_UPDATE_ADAPTIVE, TAO_ADMM_UPDATE_ADAPTIVE_RELAXED
 54: M*/

 56: /*MC
 57:      TAO_ADMM_UPDATE_ADAPTIVE - Adaptively update spectral penalty

 59:   Level: advanced

 61:   Note: Adaptively updates spectral penalty, using both steepest descent and minimum gradient.

 63: .seealso: TaoADMMSetUpdateType(), TAO_ADMM_UPDATE_BASIC, TAO_ADMM_UPDATE_ADAPTIVE_RELAXED
 64: M*/

 66: /*MC
 67:      ADMM_UPDATE_ADAPTIVE_RELAXED - Adaptively update spectral penalty, and relaxes parameter update

 69:   Level: advanced

 71:   Note: With adaptive spectral penalty update, it also relaxes x vector update by a factor.

 73: .seealso: TaoADMMSetUpdateType(), TAO_ADMM_UPDATE_BASIC, TAO_ADMM_UPDATE_ADAPTIVE
 74: M*/


 77: /*E
 78:      TaoADMMRegularizerType - Determine regularizer routine - either user provided or soft threshold

 80:   Level: advanced

 82: .seealso TaoADMMSetRegularizerType()
 83: E*/
 84: typedef enum {TAO_ADMM_REGULARIZER_USER,TAO_ADMM_REGULARIZER_SOFT_THRESH} TaoADMMRegularizerType;
 85: PETSC_EXTERN const char *const TaoADMMRegularizerTypes[];
 86: /*MC
 87:      TAO_ADMM_REGULARIZER_USER - User provided routines for regularizer part of ADMM

 89:   Level: advanced

 91:   Note: User needs to provided appropriate routines and type for regularizer solver

 93: .seealso: TaoADMMSetRegularizerType(), TAO_ADMM_REGULARIZER_SOFT_THRESH
 94: M*/

 96: /*MC
 97:      TAO_ADMM_REGULARIZER_SOFT_THRESH - Soft threshold to solve regularizer part of ADMM

 99:   Level: advanced

101:   Note: Utilizes built-in SoftThreshold routines

103: .seealso: TaoSoftThreshold(), TaoADMMSetRegularizerObjectiveAndGradientRoutine(),
104:           TaoADMMSetRegularizerHessianRoutine(), TaoADMMSetRegularizerType(), TAO_ADMM_REGULARIZER_USER
105: M*/

107: /*E
108:      TaoALMMType - Determine the augmented Lagrangian formulation used in the TAOALMM subproblem.

110: $  TAO_ALMM_CLASSIC - classic augmented Lagrangian definition including slack variables for inequality constraints
111: $  TAO_ALMM_PHR     - Powell-Hestenes-Rockafellar formulation without slack variables, uses pointwise min() for inequalities

113:   Level: advanced

115: .seealso TAOALMM, TaoALMMSetType(), TaoALMMGetType()
116: E*/
117: typedef enum {TAO_ALMM_CLASSIC,TAO_ALMM_PHR} TaoALMMType;
118: PETSC_EXTERN const char *const TaoALMMTypes[];

120: typedef struct _p_Tao*   Tao;

122: /*J
123:         TaoType - String with the name of a TAO method

125:        Level: beginner

127: J*/
128: typedef const char *TaoType;
129: #define TAOLMVM     "lmvm"
130: #define TAONLS      "nls"
131: #define TAONTR      "ntr"
132: #define TAONTL      "ntl"
133: #define TAOCG       "cg"
134: #define TAOTRON     "tron"
135: #define TAOOWLQN    "owlqn"
136: #define TAOBMRM     "bmrm"
137: #define TAOBLMVM    "blmvm"
138: #define TAOBQNLS    "bqnls"
139: #define TAOBNCG     "bncg"
140: #define TAOBNLS     "bnls"
141: #define TAOBNTR     "bntr"
142: #define TAOBNTL     "bntl"
143: #define TAOBQNKLS   "bqnkls"
144: #define TAOBQNKTR   "bqnktr"
145: #define TAOBQNKTL   "bqnktl"
146: #define TAOBQPIP    "bqpip"
147: #define TAOGPCG     "gpcg"
148: #define TAONM       "nm"
149: #define TAOPOUNDERS "pounders"
150: #define TAOBRGN     "brgn"
151: #define TAOLCL      "lcl"
152: #define TAOSSILS    "ssils"
153: #define TAOSSFLS    "ssfls"
154: #define TAOASILS    "asils"
155: #define TAOASFLS    "asfls"
156: #define TAOIPM      "ipm"
157: #define TAOPDIPM    "pdipm"
158: #define TAOSHELL    "shell"
159: #define TAOADMM     "admm"
160: #define TAOALMM     "almm"

162: PETSC_EXTERN PetscClassId TAO_CLASSID;
163: PETSC_EXTERN PetscFunctionList TaoList;

165: /*E
166:     TaoConvergedReason - reason a TAO method was said to have converged or diverged

168:    Level: beginner

170:    The two most common reasons for divergence are
171: $   1) an incorrectly coded or computed gradient or Hessian
172: $   2) failure or lack of convergence in the linear system (in this case we recommend
173: $      testing with -pc_type lu to eliminate the linear solver as the cause of the problem).

175:    Developer Notes:
176:     this must match petsc/finclude/petsctao.h

178:        The string versions of these are in TAOConvergedReasons, if you change any value here you must
179:      also adjust that array.

181: .seealso: TAOSolve(), TaoGetConvergedReason(), KSPConvergedReason, SNESConvergedReason, TSConvergedReason
182: E*/
183: typedef enum {/* converged */
184:   TAO_CONVERGED_GATOL         =  3, /* ||g(X)|| < gatol */
185:   TAO_CONVERGED_GRTOL         =  4, /* ||g(X)|| / f(X)  < grtol */
186:   TAO_CONVERGED_GTTOL         =  5, /* ||g(X)|| / ||g(X0)|| < gttol */
187:   TAO_CONVERGED_STEPTOL       =  6, /* step size small */
188:   TAO_CONVERGED_MINF          =  7, /* F < F_min */
189:   TAO_CONVERGED_USER          =  8, /* User defined */
190:   /* diverged */
191:   TAO_DIVERGED_MAXITS         = -2,
192:   TAO_DIVERGED_NAN            = -4,
193:   TAO_DIVERGED_MAXFCN         = -5,
194:   TAO_DIVERGED_LS_FAILURE     = -6,
195:   TAO_DIVERGED_TR_REDUCTION   = -7,
196:   TAO_DIVERGED_USER           = -8, /* User defined */
197:   /* keep going */
198:   TAO_CONTINUE_ITERATING      =  0} TaoConvergedReason;

200: PETSC_EXTERN const char **TaoConvergedReasons;

202: PETSC_EXTERN PetscErrorCode TaoInitializePackage(void);
203: PETSC_EXTERN PetscErrorCode TaoFinalizePackage(void);
204: PETSC_EXTERN PetscErrorCode TaoCreate(MPI_Comm,Tao*);
205: PETSC_EXTERN PetscErrorCode TaoSetFromOptions(Tao);
206: PETSC_EXTERN PetscErrorCode TaoSetUp(Tao);
207: PETSC_EXTERN PetscErrorCode TaoSetType(Tao,TaoType);
208: PETSC_EXTERN PetscErrorCode TaoGetType(Tao,TaoType *);
209: PETSC_EXTERN PetscErrorCode TaoSetApplicationContext(Tao, void*);
210: PETSC_EXTERN PetscErrorCode TaoGetApplicationContext(Tao, void*);
211: PETSC_EXTERN PetscErrorCode TaoDestroy(Tao*);

213: PETSC_EXTERN PetscErrorCode TaoSetOptionsPrefix(Tao,const char []);
214: PETSC_EXTERN PetscErrorCode TaoView(Tao, PetscViewer);
215: PETSC_EXTERN PetscErrorCode TaoViewFromOptions(Tao,PetscObject,const char[]);

217: PETSC_EXTERN PetscErrorCode TaoSolve(Tao);

219: PETSC_EXTERN PetscErrorCode TaoRegister(const char [],PetscErrorCode (*)(Tao));
220: PETSC_EXTERN PetscErrorCode TaoRegisterDestroy(void);

222: PETSC_EXTERN PetscErrorCode TaoGetConvergedReason(Tao,TaoConvergedReason*);
223: PETSC_EXTERN PetscErrorCode TaoGetSolutionStatus(Tao, PetscInt*, PetscReal*, PetscReal*, PetscReal*, PetscReal*, TaoConvergedReason*);
224: PETSC_EXTERN PetscErrorCode TaoSetConvergedReason(Tao,TaoConvergedReason);
225: PETSC_EXTERN PetscErrorCode TaoSetInitialVector(Tao, Vec);
226: PETSC_EXTERN PetscErrorCode TaoGetSolutionVector(Tao, Vec*);
227: PETSC_EXTERN PetscErrorCode TaoGetGradientVector(Tao, Vec*);
228: PETSC_EXTERN PetscErrorCode TaoSetGradientNorm(Tao, Mat);
229: PETSC_EXTERN PetscErrorCode TaoGetGradientNorm(Tao, Mat*);
230: PETSC_EXTERN PetscErrorCode TaoSetLMVMMatrix(Tao, Mat);
231: PETSC_EXTERN PetscErrorCode TaoGetLMVMMatrix(Tao, Mat*);
232: PETSC_EXTERN PetscErrorCode TaoSetRecycleHistory(Tao, PetscBool);
233: PETSC_EXTERN PetscErrorCode TaoGetRecycleHistory(Tao, PetscBool*);
234: PETSC_EXTERN PetscErrorCode TaoLMVMSetH0(Tao, Mat);
235: PETSC_EXTERN PetscErrorCode TaoLMVMGetH0(Tao, Mat*);
236: PETSC_EXTERN PetscErrorCode TaoLMVMGetH0KSP(Tao, KSP*);
237: PETSC_EXTERN PetscErrorCode TaoLMVMRecycle(Tao, PetscBool);
238: PETSC_EXTERN PetscErrorCode TaoSetObjectiveRoutine(Tao, PetscErrorCode(*)(Tao, Vec, PetscReal*,void*), void*);
239: PETSC_EXTERN PetscErrorCode TaoSetGradientRoutine(Tao, PetscErrorCode(*)(Tao, Vec, Vec, void*), void*);
240: PETSC_EXTERN PetscErrorCode TaoSetObjectiveAndGradientRoutine(Tao, PetscErrorCode(*)(Tao, Vec, PetscReal*, Vec, void*), void*);
241: PETSC_EXTERN PetscErrorCode TaoSetHessianRoutine(Tao,Mat,Mat,PetscErrorCode(*)(Tao,Vec, Mat, Mat, void*), void*);
242: PETSC_EXTERN PetscErrorCode TaoSetResidualRoutine(Tao, Vec, PetscErrorCode(*)(Tao, Vec, Vec, void*), void*);
243: PETSC_EXTERN PetscErrorCode TaoSetResidualWeights(Tao, Vec, PetscInt, PetscInt*, PetscInt*, PetscReal*);
244: PETSC_EXTERN PetscErrorCode TaoSetConstraintsRoutine(Tao, Vec, PetscErrorCode(*)(Tao, Vec, Vec, void*), void*);
245: PETSC_EXTERN PetscErrorCode TaoSetInequalityConstraintsRoutine(Tao, Vec, PetscErrorCode(*)(Tao, Vec, Vec, void*), void*);
246: PETSC_EXTERN PetscErrorCode TaoSetEqualityConstraintsRoutine(Tao, Vec, PetscErrorCode(*)(Tao, Vec, Vec, void*), void*);
247: PETSC_EXTERN PetscErrorCode TaoSetJacobianResidualRoutine(Tao, Mat, Mat, PetscErrorCode(*)(Tao, Vec, Mat, Mat, void*), void*);
248: PETSC_EXTERN PetscErrorCode TaoSetJacobianRoutine(Tao,Mat,Mat, PetscErrorCode(*)(Tao,Vec, Mat, Mat, void*), void*);
249: PETSC_EXTERN PetscErrorCode TaoSetJacobianStateRoutine(Tao,Mat,Mat,Mat, PetscErrorCode(*)(Tao,Vec, Mat, Mat, Mat, void*), void*);
250: PETSC_EXTERN PetscErrorCode TaoSetJacobianDesignRoutine(Tao,Mat,PetscErrorCode(*)(Tao,Vec, Mat, void*), void*);
251: PETSC_EXTERN PetscErrorCode TaoSetJacobianInequalityRoutine(Tao,Mat,Mat,PetscErrorCode(*)(Tao,Vec, Mat, Mat, void*), void*);
252: PETSC_EXTERN PetscErrorCode TaoSetJacobianEqualityRoutine(Tao,Mat,Mat,PetscErrorCode(*)(Tao,Vec, Mat, Mat, void*), void*);

254: PETSC_EXTERN PetscErrorCode TaoShellSetSolve(Tao, PetscErrorCode(*)(Tao));
255: PETSC_EXTERN PetscErrorCode TaoShellSetContext(Tao, void*);
256: PETSC_EXTERN PetscErrorCode TaoShellGetContext(Tao, void**);

258: PETSC_DEPRECATED_FUNCTION("Use TaoSetResidualRoutine() (since version 3.11)") PETSC_STATIC_INLINE PetscErrorCode TaoSetSeparableObjectiveRoutine(Tao tao, Vec res, PetscErrorCode (*func)(Tao, Vec, Vec, void*),void *ctx) {return TaoSetResidualRoutine(tao, res, func, ctx);}
259: PETSC_DEPRECATED_FUNCTION("Use TaoSetResidualWeights() (since version 3.11)") PETSC_STATIC_INLINE PetscErrorCode TaoSetSeparableObjectiveWeights(Tao tao, Vec sigma_v, PetscInt n, PetscInt *rows, PetscInt *cols, PetscReal *vals) {return TaoSetResidualWeights(tao, sigma_v, n, rows, cols, vals);}

261: PETSC_EXTERN PetscErrorCode TaoSetStateDesignIS(Tao, IS, IS);

263: PETSC_EXTERN PetscErrorCode TaoComputeObjective(Tao, Vec, PetscReal*);
264: PETSC_EXTERN PetscErrorCode TaoComputeResidual(Tao, Vec, Vec);
265: PETSC_EXTERN PetscErrorCode TaoTestGradient(Tao,Vec,Vec);
266: PETSC_EXTERN PetscErrorCode TaoComputeGradient(Tao, Vec, Vec);
267: PETSC_EXTERN PetscErrorCode TaoComputeObjectiveAndGradient(Tao, Vec, PetscReal*, Vec);
268: PETSC_EXTERN PetscErrorCode TaoComputeConstraints(Tao, Vec, Vec);
269: PETSC_EXTERN PetscErrorCode TaoComputeInequalityConstraints(Tao, Vec, Vec);
270: PETSC_EXTERN PetscErrorCode TaoComputeEqualityConstraints(Tao, Vec, Vec);
271: PETSC_EXTERN PetscErrorCode TaoDefaultComputeGradient(Tao, Vec, Vec, void*);
272: PETSC_EXTERN PetscErrorCode TaoIsObjectiveDefined(Tao,PetscBool*);
273: PETSC_EXTERN PetscErrorCode TaoIsGradientDefined(Tao,PetscBool*);
274: PETSC_EXTERN PetscErrorCode TaoIsObjectiveAndGradientDefined(Tao,PetscBool*);

276: PETSC_DEPRECATED_FUNCTION("Use TaoComputeResidual() (since version 3.11)") PETSC_STATIC_INLINE PetscErrorCode TaoComputeSeparableObjective(Tao tao, Vec X, Vec F) {return TaoComputeResidual(tao, X, F);}

278: PETSC_EXTERN PetscErrorCode TaoTestHessian(Tao);
279: PETSC_EXTERN PetscErrorCode TaoComputeHessian(Tao, Vec, Mat, Mat);
280: PETSC_EXTERN PetscErrorCode TaoComputeResidualJacobian(Tao, Vec, Mat, Mat);
281: PETSC_EXTERN PetscErrorCode TaoComputeJacobian(Tao, Vec, Mat, Mat);
282: PETSC_EXTERN PetscErrorCode TaoComputeJacobianState(Tao, Vec, Mat, Mat, Mat);
283: PETSC_EXTERN PetscErrorCode TaoComputeJacobianEquality(Tao, Vec, Mat, Mat);
284: PETSC_EXTERN PetscErrorCode TaoComputeJacobianInequality(Tao, Vec, Mat, Mat);
285: PETSC_EXTERN PetscErrorCode TaoComputeJacobianDesign(Tao, Vec, Mat);

287: PETSC_EXTERN PetscErrorCode TaoDefaultComputeHessian(Tao, Vec, Mat, Mat, void*);
288: PETSC_EXTERN PetscErrorCode TaoDefaultComputeHessianColor(Tao, Vec, Mat, Mat, void*);
289: PETSC_EXTERN PetscErrorCode TaoDefaultComputeHessianMFFD(Tao, Vec, Mat, Mat, void*);
290: PETSC_EXTERN PetscErrorCode TaoComputeDualVariables(Tao, Vec, Vec);
291: PETSC_EXTERN PetscErrorCode TaoSetVariableBounds(Tao, Vec, Vec);
292: PETSC_EXTERN PetscErrorCode TaoGetVariableBounds(Tao, Vec*, Vec*);
293: PETSC_EXTERN PetscErrorCode TaoGetDualVariables(Tao, Vec*, Vec*);
294: PETSC_EXTERN PetscErrorCode TaoSetInequalityBounds(Tao, Vec, Vec);
295: PETSC_EXTERN PetscErrorCode TaoGetInequalityBounds(Tao, Vec*, Vec*);
296: PETSC_EXTERN PetscErrorCode TaoSetVariableBoundsRoutine(Tao, PetscErrorCode(*)(Tao, Vec, Vec, void*), void*);
297: PETSC_EXTERN PetscErrorCode TaoComputeVariableBounds(Tao);

299: PETSC_EXTERN PetscErrorCode TaoGetTolerances(Tao, PetscReal*, PetscReal*, PetscReal*);
300: PETSC_EXTERN PetscErrorCode TaoSetTolerances(Tao, PetscReal, PetscReal, PetscReal);
301: PETSC_EXTERN PetscErrorCode TaoGetConstraintTolerances(Tao, PetscReal*, PetscReal*);
302: PETSC_EXTERN PetscErrorCode TaoSetConstraintTolerances(Tao, PetscReal, PetscReal);
303: PETSC_EXTERN PetscErrorCode TaoSetFunctionLowerBound(Tao, PetscReal);
304: PETSC_EXTERN PetscErrorCode TaoSetInitialTrustRegionRadius(Tao, PetscReal);
305: PETSC_EXTERN PetscErrorCode TaoSetMaximumIterations(Tao, PetscInt);
306: PETSC_EXTERN PetscErrorCode TaoSetMaximumFunctionEvaluations(Tao, PetscInt);
307: PETSC_EXTERN PetscErrorCode TaoGetFunctionLowerBound(Tao, PetscReal*);
308: PETSC_EXTERN PetscErrorCode TaoGetInitialTrustRegionRadius(Tao, PetscReal*);
309: PETSC_EXTERN PetscErrorCode TaoGetCurrentTrustRegionRadius(Tao, PetscReal*);
310: PETSC_EXTERN PetscErrorCode TaoGetMaximumIterations(Tao, PetscInt*);
311: PETSC_EXTERN PetscErrorCode TaoGetCurrentFunctionEvaluations(Tao, PetscInt*);
312: PETSC_EXTERN PetscErrorCode TaoGetMaximumFunctionEvaluations(Tao, PetscInt*);
313: PETSC_EXTERN PetscErrorCode TaoGetIterationNumber(Tao, PetscInt*);
314: PETSC_EXTERN PetscErrorCode TaoSetIterationNumber(Tao, PetscInt);
315: PETSC_EXTERN PetscErrorCode TaoGetTotalIterationNumber(Tao, PetscInt*);
316: PETSC_EXTERN PetscErrorCode TaoSetTotalIterationNumber(Tao, PetscInt);
317: PETSC_EXTERN PetscErrorCode TaoGetResidualNorm(Tao,PetscReal*);
318: PETSC_EXTERN PetscErrorCode TaoGetObjective(Tao,PetscReal*);

320: PETSC_EXTERN PetscErrorCode TaoAppendOptionsPrefix(Tao, const char p[]);
321: PETSC_EXTERN PetscErrorCode TaoGetOptionsPrefix(Tao, const char *p[]);
322: PETSC_EXTERN PetscErrorCode TaoResetStatistics(Tao);
323: PETSC_EXTERN PetscErrorCode TaoSetUpdate(Tao, PetscErrorCode(*)(Tao, PetscInt, void*), void*);

325: PETSC_EXTERN PetscErrorCode TaoGetKSP(Tao, KSP*);
326: PETSC_EXTERN PetscErrorCode TaoGetLinearSolveIterations(Tao,PetscInt *);

328: #include <petsctaolinesearch.h>
329: PETSC_EXTERN PetscErrorCode TaoLineSearchUseTaoRoutines(TaoLineSearch, Tao);
330: PETSC_EXTERN PetscErrorCode TaoGetLineSearch(Tao, TaoLineSearch*);

332: PETSC_EXTERN PetscErrorCode TaoSetConvergenceHistory(Tao,PetscReal*,PetscReal*,PetscReal*,PetscInt*,PetscInt,PetscBool);
333: PETSC_EXTERN PetscErrorCode TaoGetConvergenceHistory(Tao,PetscReal**,PetscReal**,PetscReal**,PetscInt**,PetscInt*);
334: PETSC_EXTERN PetscErrorCode TaoSetMonitor(Tao, PetscErrorCode (*)(Tao,void*),void *,PetscErrorCode (*)(void**));
335: PETSC_EXTERN PetscErrorCode TaoCancelMonitors(Tao);
336: PETSC_EXTERN PetscErrorCode TaoMonitorDefault(Tao, void*);
337: PETSC_DEPRECATED_FUNCTION("Use TaoMonitorDefault() (since version 3.9)") PETSC_STATIC_INLINE PetscErrorCode TaoDefaultMonitor(Tao tao, void*ctx) {return TaoMonitorDefault(tao,ctx);}
338: PETSC_EXTERN PetscErrorCode TaoDefaultGMonitor(Tao, void*);
339: PETSC_EXTERN PetscErrorCode TaoDefaultSMonitor(Tao, void*);
340: PETSC_EXTERN PetscErrorCode TaoDefaultCMonitor(Tao, void*);
341: PETSC_EXTERN PetscErrorCode TaoSolutionMonitor(Tao, void*);
342: PETSC_EXTERN PetscErrorCode TaoResidualMonitor(Tao, void*);
343: PETSC_EXTERN PetscErrorCode TaoGradientMonitor(Tao, void*);
344: PETSC_EXTERN PetscErrorCode TaoStepDirectionMonitor(Tao, void*);
345: PETSC_EXTERN PetscErrorCode TaoDrawSolutionMonitor(Tao, void*);
346: PETSC_EXTERN PetscErrorCode TaoDrawStepMonitor(Tao, void*);
347: PETSC_EXTERN PetscErrorCode TaoDrawGradientMonitor(Tao, void*);
348: PETSC_EXTERN PetscErrorCode TaoAddLineSearchCounts(Tao);

350: PETSC_EXTERN PetscErrorCode TaoDefaultConvergenceTest(Tao,void*);
351: PETSC_EXTERN PetscErrorCode TaoSetConvergenceTest(Tao, PetscErrorCode (*)(Tao, void*),void *);

353: PETSC_EXTERN PetscErrorCode TaoLCLSetStateDesignIS(Tao, IS, IS);
354: PETSC_EXTERN PetscErrorCode TaoMonitor(Tao, PetscInt, PetscReal, PetscReal, PetscReal, PetscReal);
355: typedef struct _n_TaoMonitorDrawCtx* TaoMonitorDrawCtx;
356: PETSC_EXTERN PetscErrorCode TaoMonitorDrawCtxCreate(MPI_Comm,const char[],const char[],int,int,int,int,PetscInt,TaoMonitorDrawCtx*);
357: PETSC_EXTERN PetscErrorCode TaoMonitorDrawCtxDestroy(TaoMonitorDrawCtx*);

359: PETSC_EXTERN PetscErrorCode TaoBRGNGetSubsolver(Tao,Tao *);
360: PETSC_EXTERN PetscErrorCode TaoBRGNSetRegularizerObjectiveAndGradientRoutine(Tao,PetscErrorCode (*)(Tao,Vec,PetscReal*,Vec,void*),void*);
361: PETSC_EXTERN PetscErrorCode TaoBRGNSetRegularizerHessianRoutine(Tao,Mat,PetscErrorCode (*)(Tao,Vec,Mat,void*),void*);
362: PETSC_EXTERN PetscErrorCode TaoBRGNSetRegularizerWeight(Tao,PetscReal);
363: PETSC_EXTERN PetscErrorCode TaoBRGNSetL1SmoothEpsilon(Tao,PetscReal);
364: PETSC_EXTERN PetscErrorCode TaoBRGNSetDictionaryMatrix(Tao,Mat);
365: PETSC_EXTERN PetscErrorCode TaoBRGNGetDampingVector(Tao,Vec *);

367: PETSC_EXTERN PetscErrorCode TaoADMMGetMisfitSubsolver(Tao,Tao *);
368: PETSC_EXTERN PetscErrorCode TaoADMMGetRegularizationSubsolver(Tao,Tao *);
369: PETSC_EXTERN PetscErrorCode TaoADMMGetDualVector(Tao,Vec*);
370: PETSC_EXTERN PetscErrorCode TaoADMMGetSpectralPenalty(Tao,PetscReal*);
371: PETSC_EXTERN PetscErrorCode TaoADMMSetSpectralPenalty(Tao,PetscReal);
372: PETSC_EXTERN PetscErrorCode TaoGetADMMParentTao(Tao, Tao *);
373: PETSC_EXTERN PetscErrorCode TaoADMMSetConstraintVectorRHS(Tao,Vec);
374: PETSC_EXTERN PetscErrorCode TaoADMMSetRegularizerCoefficient(Tao,PetscReal);
375: PETSC_EXTERN PetscErrorCode TaoADMMSetMisfitConstraintJacobian(Tao,Mat, Mat,PetscErrorCode (*)(Tao,Vec,Mat,Mat,void*),void*);
376: PETSC_EXTERN PetscErrorCode TaoADMMSetRegularizerConstraintJacobian(Tao,Mat, Mat,PetscErrorCode (*)(Tao,Vec,Mat,Mat,void*),void*);
377: PETSC_EXTERN PetscErrorCode TaoADMMSetRegularizerHessianRoutine(Tao,Mat,Mat,PetscErrorCode (*)(Tao,Vec,Mat,Mat,void*),void*);
378: PETSC_EXTERN PetscErrorCode TaoADMMSetRegularizerObjectiveAndGradientRoutine(Tao,PetscErrorCode (*)(Tao,Vec,PetscReal *,Vec,void*),void*);
379: PETSC_EXTERN PetscErrorCode TaoADMMSetMisfitHessianRoutine(Tao,Mat,Mat,PetscErrorCode (*)(Tao,Vec,Mat,Mat,void*),void*);
380: PETSC_EXTERN PetscErrorCode TaoADMMSetMisfitObjectiveAndGradientRoutine(Tao,PetscErrorCode (*)(Tao,Vec,PetscReal *,Vec,void*),void*);
381: PETSC_EXTERN PetscErrorCode TaoADMMSetMisfitHessianChangeStatus(Tao, PetscBool);
382: PETSC_EXTERN PetscErrorCode TaoADMMSetRegHessianChangeStatus(Tao, PetscBool);
383: PETSC_EXTERN PetscErrorCode TaoADMMSetMinimumSpectralPenalty(Tao, PetscReal);
384: PETSC_EXTERN PetscErrorCode TaoADMMSetRegularizerType(Tao, TaoADMMRegularizerType);
385: PETSC_EXTERN PetscErrorCode TaoADMMGetRegularizerType(Tao, TaoADMMRegularizerType*);
386: PETSC_EXTERN PetscErrorCode TaoADMMSetUpdateType(Tao, TaoADMMUpdateType);
387: PETSC_EXTERN PetscErrorCode TaoADMMGetUpdateType(Tao, TaoADMMUpdateType*);

389: PETSC_EXTERN PetscErrorCode TaoALMMGetType(Tao, TaoALMMType*);
390: PETSC_EXTERN PetscErrorCode TaoALMMSetType(Tao, TaoALMMType);
391: PETSC_EXTERN PetscErrorCode TaoALMMGetSubsolver(Tao, Tao*);
392: PETSC_EXTERN PetscErrorCode TaoALMMSetSubsolver(Tao, Tao);
393: PETSC_EXTERN PetscErrorCode TaoALMMGetMultipliers(Tao, Vec*);
394: PETSC_EXTERN PetscErrorCode TaoALMMSetMultipliers(Tao, Vec);
395: PETSC_EXTERN PetscErrorCode TaoALMMGetPrimalIS(Tao, IS*, IS*);
396: PETSC_EXTERN PetscErrorCode TaoALMMGetDualIS(Tao, IS*, IS*);
397: #endif