Actual source code: petsctao.h

petsc-3.13.6 2020-09-29
Report Typos and Errors
  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: typedef struct _p_Tao*   Tao;

109: /*J
110:         TaoType - String with the name of a TAO method

112:        Level: beginner

114: J*/
115: typedef const char *TaoType;
116: #define TAOLMVM     "lmvm"
117: #define TAONLS      "nls"
118: #define TAONTR      "ntr"
119: #define TAONTL      "ntl"
120: #define TAOCG       "cg"
121: #define TAOTRON     "tron"
122: #define TAOOWLQN    "owlqn"
123: #define TAOBMRM     "bmrm"
124: #define TAOBLMVM    "blmvm"
125: #define TAOBQNLS    "bqnls"
126: #define TAOBNCG     "bncg"
127: #define TAOBNLS     "bnls"
128: #define TAOBNTR     "bntr"
129: #define TAOBNTL     "bntl"
130: #define TAOBQNKLS   "bqnkls"
131: #define TAOBQNKTR   "bqnktr"
132: #define TAOBQNKTL   "bqnktl"
133: #define TAOBQPIP    "bqpip"
134: #define TAOGPCG     "gpcg"
135: #define TAONM       "nm"
136: #define TAOPOUNDERS "pounders"
137: #define TAOBRGN     "brgn"
138: #define TAOLCL      "lcl"
139: #define TAOSSILS    "ssils"
140: #define TAOSSFLS    "ssfls"
141: #define TAOASILS    "asils"
142: #define TAOASFLS    "asfls"
143: #define TAOIPM      "ipm"
144: #define TAOPDIPM    "pdipm"
145: #define TAOSHELL    "shell"
146: #define TAOADMM     "admm"

148: PETSC_EXTERN PetscClassId TAO_CLASSID;
149: PETSC_EXTERN PetscFunctionList TaoList;

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

154:    Level: beginner

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

161:    Developer Notes:
162:     this must match petsc/finclude/petsctao.h

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

167: .seealso: TAOSolve(), TaoGetConvergedReason(), KSPConvergedReason, SNESConvergedReason, TSConvergedReason
168: E*/
169: typedef enum {/* converged */
170:   TAO_CONVERGED_GATOL         =  3, /* ||g(X)|| < gatol */
171:   TAO_CONVERGED_GRTOL         =  4, /* ||g(X)|| / f(X)  < grtol */
172:   TAO_CONVERGED_GTTOL         =  5, /* ||g(X)|| / ||g(X0)|| < gttol */
173:   TAO_CONVERGED_STEPTOL       =  6, /* step size small */
174:   TAO_CONVERGED_MINF          =  7, /* F < F_min */
175:   TAO_CONVERGED_USER          =  8, /* User defined */
176:   /* diverged */
177:   TAO_DIVERGED_MAXITS         = -2,
178:   TAO_DIVERGED_NAN            = -4,
179:   TAO_DIVERGED_MAXFCN         = -5,
180:   TAO_DIVERGED_LS_FAILURE     = -6,
181:   TAO_DIVERGED_TR_REDUCTION   = -7,
182:   TAO_DIVERGED_USER           = -8, /* User defined */
183:   /* keep going */
184:   TAO_CONTINUE_ITERATING      =  0} TaoConvergedReason;

186: PETSC_EXTERN const char **TaoConvergedReasons;

188: PETSC_EXTERN PetscErrorCode TaoInitializePackage(void);
189: PETSC_EXTERN PetscErrorCode TaoFinalizePackage(void);
190: PETSC_EXTERN PetscErrorCode TaoCreate(MPI_Comm,Tao*);
191: PETSC_EXTERN PetscErrorCode TaoSetFromOptions(Tao);
192: PETSC_EXTERN PetscErrorCode TaoSetUp(Tao);
193: PETSC_EXTERN PetscErrorCode TaoSetType(Tao,TaoType);
194: PETSC_EXTERN PetscErrorCode TaoGetType(Tao,TaoType *);
195: PETSC_EXTERN PetscErrorCode TaoSetApplicationContext(Tao, void*);
196: PETSC_EXTERN PetscErrorCode TaoGetApplicationContext(Tao, void*);
197: PETSC_EXTERN PetscErrorCode TaoDestroy(Tao*);

199: PETSC_EXTERN PetscErrorCode TaoSetOptionsPrefix(Tao,const char []);
200: PETSC_EXTERN PetscErrorCode TaoView(Tao, PetscViewer);
201: PETSC_EXTERN PetscErrorCode TaoViewFromOptions(Tao,PetscObject,const char[]);

203: PETSC_EXTERN PetscErrorCode TaoSolve(Tao);

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

208: PETSC_EXTERN PetscErrorCode TaoGetConvergedReason(Tao,TaoConvergedReason*);
209: PETSC_EXTERN PetscErrorCode TaoGetSolutionStatus(Tao, PetscInt*, PetscReal*, PetscReal*, PetscReal*, PetscReal*, TaoConvergedReason*);
210: PETSC_EXTERN PetscErrorCode TaoSetConvergedReason(Tao,TaoConvergedReason);
211: PETSC_EXTERN PetscErrorCode TaoSetInitialVector(Tao, Vec);
212: PETSC_EXTERN PetscErrorCode TaoGetSolutionVector(Tao, Vec*);
213: PETSC_EXTERN PetscErrorCode TaoGetGradientVector(Tao, Vec*);
214: PETSC_EXTERN PetscErrorCode TaoSetGradientNorm(Tao, Mat);
215: PETSC_EXTERN PetscErrorCode TaoGetGradientNorm(Tao, Mat*);
216: PETSC_EXTERN PetscErrorCode TaoGetLMVMMatrix(Tao, Mat*);
217: PETSC_EXTERN PetscErrorCode TaoLMVMSetH0(Tao, Mat);
218: PETSC_EXTERN PetscErrorCode TaoLMVMGetH0(Tao, Mat*);
219: PETSC_EXTERN PetscErrorCode TaoLMVMGetH0KSP(Tao, KSP*);
220: PETSC_EXTERN PetscErrorCode TaoLMVMRecycle(Tao, PetscBool);
221: PETSC_EXTERN PetscErrorCode TaoSetObjectiveRoutine(Tao, PetscErrorCode(*)(Tao, Vec, PetscReal*,void*), void*);
222: PETSC_EXTERN PetscErrorCode TaoSetGradientRoutine(Tao, PetscErrorCode(*)(Tao, Vec, Vec, void*), void*);
223: PETSC_EXTERN PetscErrorCode TaoSetObjectiveAndGradientRoutine(Tao, PetscErrorCode(*)(Tao, Vec, PetscReal*, Vec, void*), void*);
224: PETSC_EXTERN PetscErrorCode TaoSetHessianRoutine(Tao,Mat,Mat,PetscErrorCode(*)(Tao,Vec, Mat, Mat, void*), void*);
225: PETSC_EXTERN PetscErrorCode TaoSetResidualRoutine(Tao, Vec, PetscErrorCode(*)(Tao, Vec, Vec, void*), void*);
226: PETSC_EXTERN PetscErrorCode TaoSetResidualWeights(Tao, Vec, PetscInt, PetscInt*, PetscInt*, PetscReal*);
227: PETSC_EXTERN PetscErrorCode TaoSetConstraintsRoutine(Tao, Vec, PetscErrorCode(*)(Tao, Vec, Vec, void*), void*);
228: PETSC_EXTERN PetscErrorCode TaoSetInequalityConstraintsRoutine(Tao, Vec, PetscErrorCode(*)(Tao, Vec, Vec, void*), void*);
229: PETSC_EXTERN PetscErrorCode TaoSetEqualityConstraintsRoutine(Tao, Vec, PetscErrorCode(*)(Tao, Vec, Vec, void*), void*);
230: PETSC_EXTERN PetscErrorCode TaoSetJacobianResidualRoutine(Tao, Mat, Mat, PetscErrorCode(*)(Tao, Vec, Mat, Mat, void*), void*);
231: PETSC_EXTERN PetscErrorCode TaoSetJacobianRoutine(Tao,Mat,Mat, PetscErrorCode(*)(Tao,Vec, Mat, Mat, void*), void*);
232: PETSC_EXTERN PetscErrorCode TaoSetJacobianStateRoutine(Tao,Mat,Mat,Mat, PetscErrorCode(*)(Tao,Vec, Mat, Mat, Mat, void*), void*);
233: PETSC_EXTERN PetscErrorCode TaoSetJacobianDesignRoutine(Tao,Mat,PetscErrorCode(*)(Tao,Vec, Mat, void*), void*);
234: PETSC_EXTERN PetscErrorCode TaoSetJacobianInequalityRoutine(Tao,Mat,Mat,PetscErrorCode(*)(Tao,Vec, Mat, Mat, void*), void*);
235: PETSC_EXTERN PetscErrorCode TaoSetJacobianEqualityRoutine(Tao,Mat,Mat,PetscErrorCode(*)(Tao,Vec, Mat, Mat, void*), void*);

237: PETSC_EXTERN PetscErrorCode TaoShellSetSolve(Tao, PetscErrorCode(*)(Tao));
238: PETSC_EXTERN PetscErrorCode TaoShellSetContext(Tao, void*);
239: PETSC_EXTERN PetscErrorCode TaoShellGetContext(Tao, void**);

241: 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);}
242: 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);}

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

246: PETSC_EXTERN PetscErrorCode TaoComputeObjective(Tao, Vec, PetscReal*);
247: PETSC_EXTERN PetscErrorCode TaoComputeResidual(Tao, Vec, Vec);
248: PETSC_EXTERN PetscErrorCode TaoTestGradient(Tao,Vec,Vec);
249: PETSC_EXTERN PetscErrorCode TaoComputeGradient(Tao, Vec, Vec);
250: PETSC_EXTERN PetscErrorCode TaoComputeObjectiveAndGradient(Tao, Vec, PetscReal*, Vec);
251: PETSC_EXTERN PetscErrorCode TaoComputeConstraints(Tao, Vec, Vec);
252: PETSC_EXTERN PetscErrorCode TaoComputeInequalityConstraints(Tao, Vec, Vec);
253: PETSC_EXTERN PetscErrorCode TaoComputeEqualityConstraints(Tao, Vec, Vec);
254: PETSC_EXTERN PetscErrorCode TaoDefaultComputeGradient(Tao, Vec, Vec, void*);
255: PETSC_EXTERN PetscErrorCode TaoIsObjectiveDefined(Tao,PetscBool*);
256: PETSC_EXTERN PetscErrorCode TaoIsGradientDefined(Tao,PetscBool*);
257: PETSC_EXTERN PetscErrorCode TaoIsObjectiveAndGradientDefined(Tao,PetscBool*);

259: 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);}

261: PETSC_EXTERN PetscErrorCode TaoTestHessian(Tao);
262: PETSC_EXTERN PetscErrorCode TaoComputeHessian(Tao, Vec, Mat, Mat);
263: PETSC_EXTERN PetscErrorCode TaoComputeResidualJacobian(Tao, Vec, Mat, Mat);
264: PETSC_EXTERN PetscErrorCode TaoComputeJacobian(Tao, Vec, Mat, Mat);
265: PETSC_EXTERN PetscErrorCode TaoComputeJacobianState(Tao, Vec, Mat, Mat, Mat);
266: PETSC_EXTERN PetscErrorCode TaoComputeJacobianEquality(Tao, Vec, Mat, Mat);
267: PETSC_EXTERN PetscErrorCode TaoComputeJacobianInequality(Tao, Vec, Mat, Mat);
268: PETSC_EXTERN PetscErrorCode TaoComputeJacobianDesign(Tao, Vec, Mat);

270: PETSC_EXTERN PetscErrorCode TaoDefaultComputeHessian(Tao, Vec, Mat, Mat, void*);
271: PETSC_EXTERN PetscErrorCode TaoDefaultComputeHessianColor(Tao, Vec, Mat, Mat, void*);
272: PETSC_EXTERN PetscErrorCode TaoDefaultComputeHessianMFFD(Tao, Vec, Mat, Mat, void*);
273: PETSC_EXTERN PetscErrorCode TaoComputeDualVariables(Tao, Vec, Vec);
274: PETSC_EXTERN PetscErrorCode TaoSetVariableBounds(Tao, Vec, Vec);
275: PETSC_EXTERN PetscErrorCode TaoGetVariableBounds(Tao, Vec*, Vec*);
276: PETSC_EXTERN PetscErrorCode TaoGetDualVariables(Tao, Vec*, Vec*);
277: PETSC_EXTERN PetscErrorCode TaoSetInequalityBounds(Tao, Vec, Vec);
278: PETSC_EXTERN PetscErrorCode TaoGetInequalityBounds(Tao, Vec*, Vec*);
279: PETSC_EXTERN PetscErrorCode TaoSetVariableBoundsRoutine(Tao, PetscErrorCode(*)(Tao, Vec, Vec, void*), void*);
280: PETSC_EXTERN PetscErrorCode TaoComputeVariableBounds(Tao);

282: PETSC_EXTERN PetscErrorCode TaoGetTolerances(Tao, PetscReal*, PetscReal*, PetscReal*);
283: PETSC_EXTERN PetscErrorCode TaoSetTolerances(Tao, PetscReal, PetscReal, PetscReal);
284: PETSC_EXTERN PetscErrorCode TaoGetConstraintTolerances(Tao, PetscReal*, PetscReal*);
285: PETSC_EXTERN PetscErrorCode TaoSetConstraintTolerances(Tao, PetscReal, PetscReal);
286: PETSC_EXTERN PetscErrorCode TaoSetFunctionLowerBound(Tao, PetscReal);
287: PETSC_EXTERN PetscErrorCode TaoSetInitialTrustRegionRadius(Tao, PetscReal);
288: PETSC_EXTERN PetscErrorCode TaoSetMaximumIterations(Tao, PetscInt);
289: PETSC_EXTERN PetscErrorCode TaoSetMaximumFunctionEvaluations(Tao, PetscInt);
290: PETSC_EXTERN PetscErrorCode TaoGetFunctionLowerBound(Tao, PetscReal*);
291: PETSC_EXTERN PetscErrorCode TaoGetInitialTrustRegionRadius(Tao, PetscReal*);
292: PETSC_EXTERN PetscErrorCode TaoGetCurrentTrustRegionRadius(Tao, PetscReal*);
293: PETSC_EXTERN PetscErrorCode TaoGetMaximumIterations(Tao, PetscInt*);
294: PETSC_EXTERN PetscErrorCode TaoGetCurrentFunctionEvaluations(Tao, PetscInt*);
295: PETSC_EXTERN PetscErrorCode TaoGetMaximumFunctionEvaluations(Tao, PetscInt*);
296: PETSC_EXTERN PetscErrorCode TaoGetIterationNumber(Tao, PetscInt*);
297: PETSC_EXTERN PetscErrorCode TaoSetIterationNumber(Tao, PetscInt);
298: PETSC_EXTERN PetscErrorCode TaoGetTotalIterationNumber(Tao, PetscInt*);
299: PETSC_EXTERN PetscErrorCode TaoSetTotalIterationNumber(Tao, PetscInt);
300: PETSC_EXTERN PetscErrorCode TaoGetResidualNorm(Tao,PetscReal*);
301: PETSC_EXTERN PetscErrorCode TaoGetObjective(Tao,PetscReal*);

303: PETSC_EXTERN PetscErrorCode TaoAppendOptionsPrefix(Tao, const char p[]);
304: PETSC_EXTERN PetscErrorCode TaoGetOptionsPrefix(Tao, const char *p[]);
305: PETSC_EXTERN PetscErrorCode TaoResetStatistics(Tao);
306: PETSC_EXTERN PetscErrorCode TaoSetUpdate(Tao, PetscErrorCode(*)(Tao, PetscInt, void*), void*);

308: PETSC_EXTERN PetscErrorCode TaoGetKSP(Tao, KSP*);
309: PETSC_EXTERN PetscErrorCode TaoGetLinearSolveIterations(Tao,PetscInt *);

311:  #include <petsctaolinesearch.h>
312: PETSC_EXTERN PetscErrorCode TaoLineSearchUseTaoRoutines(TaoLineSearch, Tao);
313: PETSC_EXTERN PetscErrorCode TaoGetLineSearch(Tao, TaoLineSearch*);

315: PETSC_EXTERN PetscErrorCode TaoSetConvergenceHistory(Tao,PetscReal*,PetscReal*,PetscReal*,PetscInt*,PetscInt,PetscBool);
316: PETSC_EXTERN PetscErrorCode TaoGetConvergenceHistory(Tao,PetscReal**,PetscReal**,PetscReal**,PetscInt**,PetscInt*);
317: PETSC_EXTERN PetscErrorCode TaoSetMonitor(Tao, PetscErrorCode (*)(Tao,void*),void *,PetscErrorCode (*)(void**));
318: PETSC_EXTERN PetscErrorCode TaoCancelMonitors(Tao);
319: PETSC_EXTERN PetscErrorCode TaoMonitorDefault(Tao, void*);
320: PETSC_DEPRECATED_FUNCTION("Use TaoMonitorDefault() (since version 3.9)") PETSC_STATIC_INLINE PetscErrorCode TaoDefaultMonitor(Tao tao, void*ctx) {return TaoMonitorDefault(tao,ctx);}
321: PETSC_EXTERN PetscErrorCode TaoDefaultGMonitor(Tao, void*);
322: PETSC_EXTERN PetscErrorCode TaoDefaultSMonitor(Tao, void*);
323: PETSC_EXTERN PetscErrorCode TaoDefaultCMonitor(Tao, void*);
324: PETSC_EXTERN PetscErrorCode TaoSolutionMonitor(Tao, void*);
325: PETSC_EXTERN PetscErrorCode TaoResidualMonitor(Tao, void*);
326: PETSC_EXTERN PetscErrorCode TaoGradientMonitor(Tao, void*);
327: PETSC_EXTERN PetscErrorCode TaoStepDirectionMonitor(Tao, void*);
328: PETSC_EXTERN PetscErrorCode TaoDrawSolutionMonitor(Tao, void*);
329: PETSC_EXTERN PetscErrorCode TaoDrawStepMonitor(Tao, void*);
330: PETSC_EXTERN PetscErrorCode TaoDrawGradientMonitor(Tao, void*);
331: PETSC_EXTERN PetscErrorCode TaoAddLineSearchCounts(Tao);

333: PETSC_EXTERN PetscErrorCode TaoDefaultConvergenceTest(Tao,void*);
334: PETSC_EXTERN PetscErrorCode TaoSetConvergenceTest(Tao, PetscErrorCode (*)(Tao, void*),void *);

336: PETSC_EXTERN PetscErrorCode TaoSQPCONSetStateDesignIS(Tao, IS, IS);
337: PETSC_EXTERN PetscErrorCode TaoLCLSetStateDesignIS(Tao, IS, IS);
338: PETSC_EXTERN PetscErrorCode TaoMonitor(Tao, PetscInt, PetscReal, PetscReal, PetscReal, PetscReal);
339: typedef struct _n_TaoMonitorDrawCtx* TaoMonitorDrawCtx;
340: PETSC_EXTERN PetscErrorCode TaoMonitorDrawCtxCreate(MPI_Comm,const char[],const char[],int,int,int,int,PetscInt,TaoMonitorDrawCtx*);
341: PETSC_EXTERN PetscErrorCode TaoMonitorDrawCtxDestroy(TaoMonitorDrawCtx*);

343: PETSC_EXTERN PetscErrorCode TaoBRGNGetSubsolver(Tao,Tao *);
344: PETSC_EXTERN PetscErrorCode TaoBRGNSetRegularizerObjectiveAndGradientRoutine(Tao,PetscErrorCode (*)(Tao,Vec,PetscReal*,Vec,void*),void*);
345: PETSC_EXTERN PetscErrorCode TaoBRGNSetRegularizerHessianRoutine(Tao,Mat,PetscErrorCode (*)(Tao,Vec,Mat,void*),void*);
346: PETSC_EXTERN PetscErrorCode TaoBRGNSetRegularizerWeight(Tao,PetscReal);
347: PETSC_EXTERN PetscErrorCode TaoBRGNSetL1SmoothEpsilon(Tao,PetscReal);
348: PETSC_EXTERN PetscErrorCode TaoBRGNSetDictionaryMatrix(Tao,Mat);

350: PETSC_EXTERN PetscErrorCode TaoADMMGetMisfitSubsolver(Tao,Tao *);
351: PETSC_EXTERN PetscErrorCode TaoADMMGetRegularizationSubsolver(Tao,Tao *);
352: PETSC_EXTERN PetscErrorCode TaoADMMGetDualVector(Tao,Vec*);
353: PETSC_EXTERN PetscErrorCode TaoADMMGetSpectralPenalty(Tao,PetscReal*);
354: PETSC_EXTERN PetscErrorCode TaoADMMSetSpectralPenalty(Tao,PetscReal);
355: PETSC_EXTERN PetscErrorCode TaoGetADMMParentTao(Tao, Tao *);
356: PETSC_EXTERN PetscErrorCode TaoADMMSetConstraintVectorRHS(Tao,Vec);
357: PETSC_EXTERN PetscErrorCode TaoADMMSetRegularizerCoefficient(Tao,PetscReal);
358: PETSC_EXTERN PetscErrorCode TaoADMMSetMisfitConstraintJacobian(Tao,Mat, Mat,PetscErrorCode (*)(Tao,Vec,Mat,Mat,void*),void*);
359: PETSC_EXTERN PetscErrorCode TaoADMMSetRegularizerConstraintJacobian(Tao,Mat, Mat,PetscErrorCode (*)(Tao,Vec,Mat,Mat,void*),void*);
360: PETSC_EXTERN PetscErrorCode TaoADMMSetRegularizerHessianRoutine(Tao,Mat,Mat,PetscErrorCode (*)(Tao,Vec,Mat,Mat,void*),void*);
361: PETSC_EXTERN PetscErrorCode TaoADMMSetRegularizerObjectiveAndGradientRoutine(Tao,PetscErrorCode (*)(Tao,Vec,PetscReal *,Vec,void*),void*);
362: PETSC_EXTERN PetscErrorCode TaoADMMSetMisfitHessianRoutine(Tao,Mat,Mat,PetscErrorCode (*)(Tao,Vec,Mat,Mat,void*),void*);
363: PETSC_EXTERN PetscErrorCode TaoADMMSetMisfitObjectiveAndGradientRoutine(Tao,PetscErrorCode (*)(Tao,Vec,PetscReal *,Vec,void*),void*);
364: PETSC_EXTERN PetscErrorCode TaoADMMSetMisfitHessianChangeStatus(Tao, PetscBool);
365: PETSC_EXTERN PetscErrorCode TaoADMMSetRegHessianChangeStatus(Tao, PetscBool);
366: PETSC_EXTERN PetscErrorCode TaoADMMSetMinimumSpectralPenalty(Tao, PetscReal);
367: PETSC_EXTERN PetscErrorCode TaoADMMSetRegularizerType(Tao, TaoADMMRegularizerType);
368: PETSC_EXTERN PetscErrorCode TaoADMMGetRegularizerType(Tao, TaoADMMRegularizerType*);
369: PETSC_EXTERN PetscErrorCode TaoADMMSetUpdateType(Tao, TaoADMMUpdateType);
370: PETSC_EXTERN PetscErrorCode TaoADMMGetUpdateType(Tao, TaoADMMUpdateType*);
371: #endif