Actual source code: slepclme.h
slepc-3.13.1 2020-04-12
1: /*
2: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
3: SLEPc - Scalable Library for Eigenvalue Problem Computations
4: Copyright (c) 2002-2020, Universitat Politecnica de Valencia, Spain
6: This file is part of SLEPc.
7: SLEPc is distributed under a 2-clause BSD license (see LICENSE).
8: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
9: */
10: /*
11: User interface for the SLEPc object for solving linear matrix equations
12: */
14: #if !defined(SLEPCLME_H)
15: #define SLEPCLME_H
16: #include <slepcbv.h>
18: SLEPC_EXTERN PetscErrorCode LMEInitializePackage(void);
20: /*S
21: LME - SLEPc object that encapsulates functionality for linear matrix equations
23: Level: beginner
25: .seealso: LMECreate()
26: S*/
27: typedef struct _p_LME* LME;
29: /*J
30: LMEType - String with the name of a method for solving linear matrix equations
32: Level: beginner
34: .seealso: LMESetType(), LME
35: J*/
36: typedef const char* LMEType;
37: #define LMEKRYLOV "krylov"
39: /* Logging support */
40: SLEPC_EXTERN PetscClassId LME_CLASSID;
42: /*E
43: LMEProblemType - Determines the type of linear matrix equation
45: Level: beginner
47: .seealso: LMESetProblemType(), LMEGetProblemType()
48: E*/
49: typedef enum { LME_LYAPUNOV,
50: LME_SYLVESTER,
51: LME_GEN_LYAPUNOV,
52: LME_GEN_SYLVESTER,
53: LME_DT_LYAPUNOV ,
54: LME_STEIN} LMEProblemType;
55: SLEPC_EXTERN const char *LMEProblemTypes[];
57: SLEPC_EXTERN PetscErrorCode LMECreate(MPI_Comm,LME *);
58: SLEPC_EXTERN PetscErrorCode LMEDestroy(LME*);
59: SLEPC_EXTERN PetscErrorCode LMEReset(LME);
60: SLEPC_EXTERN PetscErrorCode LMESetType(LME,LMEType);
61: SLEPC_EXTERN PetscErrorCode LMEGetType(LME,LMEType*);
62: SLEPC_EXTERN PetscErrorCode LMESetProblemType(LME,LMEProblemType);
63: SLEPC_EXTERN PetscErrorCode LMEGetProblemType(LME,LMEProblemType*);
64: SLEPC_EXTERN PetscErrorCode LMESetCoefficients(LME,Mat,Mat,Mat,Mat);
65: SLEPC_EXTERN PetscErrorCode LMEGetCoefficients(LME,Mat*,Mat*,Mat*,Mat*);
66: SLEPC_EXTERN PetscErrorCode LMESetRHS(LME,Mat);
67: SLEPC_EXTERN PetscErrorCode LMEGetRHS(LME,Mat*);
68: SLEPC_EXTERN PetscErrorCode LMESetSolution(LME,Mat);
69: SLEPC_EXTERN PetscErrorCode LMEGetSolution(LME,Mat*);
70: SLEPC_EXTERN PetscErrorCode LMESetFromOptions(LME);
71: SLEPC_EXTERN PetscErrorCode LMESetUp(LME);
72: SLEPC_EXTERN PetscErrorCode LMESolve(LME);
73: SLEPC_EXTERN PetscErrorCode LMEView(LME,PetscViewer);
74: SLEPC_EXTERN PetscErrorCode LMEViewFromOptions(LME,PetscObject,const char[]);
75: SLEPC_EXTERN PetscErrorCode LMEReasonView(LME,PetscViewer);
76: SLEPC_EXTERN PetscErrorCode LMEReasonViewFromOptions(LME);
78: SLEPC_EXTERN PetscErrorCode LMESetBV(LME,BV);
79: SLEPC_EXTERN PetscErrorCode LMEGetBV(LME,BV*);
80: SLEPC_EXTERN PetscErrorCode LMESetTolerances(LME,PetscReal,PetscInt);
81: SLEPC_EXTERN PetscErrorCode LMEGetTolerances(LME,PetscReal*,PetscInt*);
82: SLEPC_EXTERN PetscErrorCode LMESetDimensions(LME,PetscInt);
83: SLEPC_EXTERN PetscErrorCode LMEGetDimensions(LME,PetscInt*);
85: SLEPC_EXTERN PetscErrorCode LMEMonitor(LME,PetscInt,PetscReal);
86: SLEPC_EXTERN PetscErrorCode LMEMonitorSet(LME,PetscErrorCode (*)(LME,PetscInt,PetscReal,void*),void*,PetscErrorCode (*)(void**));
87: SLEPC_EXTERN PetscErrorCode LMEMonitorSetFromOptions(LME,const char*,const char*,const char*,PetscErrorCode (*)(LME,PetscInt,PetscReal,PetscViewerAndFormat*));
88: SLEPC_EXTERN PetscErrorCode LMEMonitorCancel(LME);
89: SLEPC_EXTERN PetscErrorCode LMEGetMonitorContext(LME,void **);
90: SLEPC_EXTERN PetscErrorCode LMEGetIterationNumber(LME,PetscInt*);
92: SLEPC_EXTERN PetscErrorCode LMEGetErrorEstimate(LME,PetscReal*);
93: SLEPC_EXTERN PetscErrorCode LMEComputeError(LME,PetscReal*);
94: SLEPC_EXTERN PetscErrorCode LMESetErrorIfNotConverged(LME,PetscBool);
95: SLEPC_EXTERN PetscErrorCode LMEGetErrorIfNotConverged(LME,PetscBool*);
97: SLEPC_EXTERN PetscErrorCode LMEDenseLyapunov(LME,PetscInt,PetscScalar*,PetscInt,PetscScalar*,PetscInt,PetscScalar*,PetscInt);
98: SLEPC_EXTERN PetscErrorCode LMEDenseHessLyapunovChol(LME,PetscInt,PetscScalar*,PetscInt,PetscInt,PetscScalar*,PetscInt,PetscScalar*,PetscInt,PetscReal*);
99: PETSC_DEPRECATED_FUNCTION("Use LMEDenseHessLyapunovChol()") PETSC_STATIC_INLINE PetscErrorCode LMEDenseLyapunovChol(LME lme,PetscScalar *H,PetscInt m,PetscInt ldh,PetscScalar *r,PetscScalar *L,PetscInt ldl,PetscReal *res) {return LMEDenseHessLyapunovChol(lme,m,H,ldh,1,r,m,L,ldl,res);}
101: SLEPC_EXTERN PetscErrorCode LMEMonitorDefault(LME,PetscInt,PetscReal,PetscViewerAndFormat*);
102: SLEPC_EXTERN PetscErrorCode LMEMonitorLGCreate(MPI_Comm,const char[],const char[],int,int,int,int,PetscDrawLG*);
103: SLEPC_EXTERN PetscErrorCode LMEMonitorLG(LME,PetscInt,PetscReal,void*);
105: SLEPC_EXTERN PetscErrorCode LMESetOptionsPrefix(LME,const char*);
106: SLEPC_EXTERN PetscErrorCode LMEAppendOptionsPrefix(LME,const char*);
107: SLEPC_EXTERN PetscErrorCode LMEGetOptionsPrefix(LME,const char*[]);
109: /*E
110: LMEConvergedReason - reason a matrix function iteration was said to
111: have converged or diverged
113: Level: intermediate
115: .seealso: LMESolve(), LMEGetConvergedReason(), LMESetTolerances()
116: E*/
117: typedef enum {/* converged */
118: LME_CONVERGED_TOL = 1,
119: /* diverged */
120: LME_DIVERGED_ITS = -1,
121: LME_DIVERGED_BREAKDOWN = -2,
122: LME_CONVERGED_ITERATING = 0} LMEConvergedReason;
123: SLEPC_EXTERN const char *const*LMEConvergedReasons;
125: SLEPC_EXTERN PetscErrorCode LMEGetConvergedReason(LME,LMEConvergedReason *);
127: SLEPC_EXTERN PetscFunctionList LMEList;
128: SLEPC_EXTERN PetscErrorCode LMERegister(const char[],PetscErrorCode(*)(LME));
130: SLEPC_EXTERN PetscErrorCode LMEAllocateSolution(LME,PetscInt);
132: #endif