Actual source code: petsctaolinesearch.h
petsc-3.7.3 2016-08-01
1: #ifndef __TAOLINESEARCH_H
3: #include <petscvec.h>
5: typedef struct _p_TaoLineSearch* TaoLineSearch;
6: typedef enum {
7: TAOLINESEARCH_FAILED_INFORNAN = -1,
8: TAOLINESEARCH_FAILED_BADPARAMETER = -2,
9: TAOLINESEARCH_FAILED_ASCENT = -3,
10: TAOLINESEARCH_CONTINUE_ITERATING = 0,
11: TAOLINESEARCH_SUCCESS = 1,
12: TAOLINESEARCH_SUCCESS_USER = 2,
13: TAOLINESEARCH_HALTED_OTHER = 3,
14: TAOLINESEARCH_HALTED_MAXFCN = 4,
15: TAOLINESEARCH_HALTED_UPPERBOUND = 5,
16: TAOLINESEARCH_HALTED_LOWERBOUND = 6,
17: TAOLINESEARCH_HALTED_RTOL = 7,
18: TAOLINESEARCH_HALTED_USER = 8
19: } TaoLineSearchConvergedReason;
21: #define TaoLineSearchType char*
22: #define TAOLINESEARCHUNIT "unit"
23: #define TAOLINESEARCHMT "more-thuente"
24: #define TAOLINESEARCHGPCG "gpcg"
25: #define TAOLINESEARCHARMIJO "armijo"
26: #define TAOLINESEARCHOWARMIJO "owarmijo"
27: #define TAOLINESEARCHIPM "ipm"
29: PETSC_EXTERN PetscClassId TAOLINESEARCH_CLASSID;
30: PETSC_EXTERN PetscFunctionList TaoLineSearchList;
32: #include <petsctao.h>
34: PETSC_EXTERN PetscErrorCode TaoLineSearchCreate(MPI_Comm,TaoLineSearch*);
35: PETSC_EXTERN PetscErrorCode TaoLineSearchSetFromOptions(TaoLineSearch);
36: PETSC_EXTERN PetscErrorCode TaoLineSearchSetUp(TaoLineSearch);
37: PETSC_EXTERN PetscErrorCode TaoLineSearchDestroy(TaoLineSearch*);
38: PETSC_EXTERN PetscErrorCode TaoLineSearchView(TaoLineSearch,PetscViewer);
39: PETSC_STATIC_INLINE PetscErrorCode TaoLineSearchViewFromOptions(TaoLineSearch A,PetscObject obj,const char name[]) {return PetscObjectViewFromOptions((PetscObject)A,obj,name);}
41: PETSC_EXTERN PetscErrorCode TaoLineSearchSetOptionsPrefix(TaoLineSearch,const char prefix[]);
42: PETSC_EXTERN PetscErrorCode TaoLineSearchReset(TaoLineSearch);
43: PETSC_EXTERN PetscErrorCode TaoLineSearchAppendOptionsPrefix(TaoLineSearch,const char prefix[]);
44: PETSC_EXTERN PetscErrorCode TaoLineSearchGetOptionsPrefix(TaoLineSearch,const char *prefix[]);
45: PETSC_EXTERN PetscErrorCode TaoLineSearchApply(TaoLineSearch,Vec,PetscReal *,Vec,Vec, PetscReal *, TaoLineSearchConvergedReason *);
46: PETSC_EXTERN PetscErrorCode TaoLineSearchGetStepLength(TaoLineSearch, PetscReal*);
47: PETSC_EXTERN PetscErrorCode TaoLineSearchGetStartingVector(TaoLineSearch,Vec*);
48: PETSC_EXTERN PetscErrorCode TaoLineSearchGetStepDirection(TaoLineSearch,Vec*);
49: PETSC_EXTERN PetscErrorCode TaoLineSearchSetInitialStepLength(TaoLineSearch, PetscReal);
50: PETSC_EXTERN PetscErrorCode TaoLineSearchGetSolution(TaoLineSearch, Vec, PetscReal*, Vec, PetscReal*, TaoLineSearchConvergedReason*);
51: PETSC_EXTERN PetscErrorCode TaoLineSearchGetFullStepObjective(TaoLineSearch, PetscReal*);
52: PETSC_EXTERN PetscErrorCode TaoLineSearchGetNumberFunctionEvaluations(TaoLineSearch, PetscInt*, PetscInt*, PetscInt*);
54: PETSC_EXTERN PetscErrorCode TaoLineSearchGetType(TaoLineSearch, const TaoLineSearchType *);
55: PETSC_EXTERN PetscErrorCode TaoLineSearchSetType(TaoLineSearch, const TaoLineSearchType);
57: PETSC_EXTERN PetscErrorCode TaoLineSearchIsUsingTaoRoutines(TaoLineSearch, PetscBool *);
58: PETSC_EXTERN PetscErrorCode TaoLineSearchSetObjectiveAndGTSRoutine(TaoLineSearch, PetscErrorCode(*)(TaoLineSearch, Vec, Vec, PetscReal*, PetscReal*, void*), void*);
59: PETSC_EXTERN PetscErrorCode TaoLineSearchSetObjectiveRoutine(TaoLineSearch, PetscErrorCode(*)(TaoLineSearch, Vec, PetscReal*,void*), void*);
60: PETSC_EXTERN PetscErrorCode TaoLineSearchSetGradientRoutine(TaoLineSearch, PetscErrorCode(*)(TaoLineSearch, Vec, Vec, void*), void*);
61: PETSC_EXTERN PetscErrorCode TaoLineSearchSetObjectiveAndGradientRoutine(TaoLineSearch, PetscErrorCode(*)(TaoLineSearch, Vec, PetscReal*, Vec, void*), void*);
63: PETSC_EXTERN PetscErrorCode TaoLineSearchComputeObjective(TaoLineSearch, Vec, PetscReal*);
64: PETSC_EXTERN PetscErrorCode TaoLineSearchComputeGradient(TaoLineSearch, Vec, Vec);
65: PETSC_EXTERN PetscErrorCode TaoLineSearchComputeObjectiveAndGradient(TaoLineSearch, Vec, PetscReal*, Vec);
66: PETSC_EXTERN PetscErrorCode TaoLineSearchComputeObjectiveAndGTS(TaoLineSearch, Vec, PetscReal*, PetscReal*);
67: PETSC_EXTERN PetscErrorCode TaoLineSearchSetVariableBounds(TaoLineSearch, Vec, Vec);
69: PETSC_EXTERN PetscErrorCode TaoLineSearchInitializePackage(void);
70: PETSC_EXTERN PetscErrorCode TaoLineSearchFinalizePackage(void);
72: PETSC_EXTERN PetscErrorCode TaoLineSearchRegister(const char[], PetscErrorCode (*)(TaoLineSearch));
74: #endif