Actual source code: slepcsvd.h
1: /*
2: User interface for the SLEPC singular value solvers.
4: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
5: SLEPc - Scalable Library for Eigenvalue Problem Computations
6: Copyright (c) 2002-2009, Universidad Politecnica de Valencia, Spain
8: This file is part of SLEPc.
9:
10: SLEPc is free software: you can redistribute it and/or modify it under the
11: terms of version 3 of the GNU Lesser General Public License as published by
12: the Free Software Foundation.
14: SLEPc is distributed in the hope that it will be useful, but WITHOUT ANY
15: WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16: FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
17: more details.
19: You should have received a copy of the GNU Lesser General Public License
20: along with SLEPc. If not, see <http://www.gnu.org/licenses/>.
21: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
22: */
26: #include slepc.h
27: #include slepceps.h
32: /*S
33: SVD - Abstract SLEPc object that manages all the singular value
34: problem solvers.
36: Level: beginner
38: .seealso: SVDCreate()
39: S*/
40: typedef struct _p_SVD* SVD;
42: /*E
43: SVDType - String with the name of a SLEPc singular value solver
45: Level: beginner
47: .seealso: SVDSetType(), SVD
48: E*/
49: #define SVDType char*
50: #define SVDCROSS "cross"
51: #define SVDCYCLIC "cyclic"
52: #define SVDLAPACK "lapack"
53: #define SVDLANCZOS "lanczos"
54: #define SVDTRLANCZOS "trlanczos"
56: /*E
57: SVDTransposeMode - determines how to handle the transpose of the matrix
59: Level: advanced
61: .seealso: SVDSetTransposeMode(), SVDGetTransposeMode()
62: E*/
63: typedef enum { SVD_TRANSPOSE_EXPLICIT, SVD_TRANSPOSE_IMPLICIT } SVDTransposeMode;
65: /*E
66: SVDWhich - determines whether largest or smallest singular triplets
67: are to be computed
69: Level: intermediate
71: .seealso: SVDSetWhichSingularTriplets(), SVDGetWhichSingularTriplets()
72: E*/
73: typedef enum { SVD_LARGEST, SVD_SMALLEST } SVDWhich;
75: /*E
76: SVDConvergedReason - reason a singular value solver was said to
77: have converged or diverged
79: Level: beginner
81: .seealso: SVDSolve(), SVDGetConvergedReason(), SVDSetTolerances()
82: E*/
83: typedef enum {/* converged */
84: SVD_CONVERGED_TOL = 2,
85: /* diverged */
86: SVD_DIVERGED_ITS = -3,
87: SVD_DIVERGED_BREAKDOWN = -4,
88: SVD_CONVERGED_ITERATING = 0 } SVDConvergedReason;
90: EXTERN PetscErrorCode SVDCreate(MPI_Comm,SVD*);
91: EXTERN PetscErrorCode SVDSetIP(SVD,IP);
92: EXTERN PetscErrorCode SVDGetIP(SVD,IP*);
93: EXTERN PetscErrorCode SVDSetType(SVD,const SVDType);
94: EXTERN PetscErrorCode SVDGetType(SVD,const SVDType*);
95: EXTERN PetscErrorCode SVDSetOperator(SVD,Mat);
96: EXTERN PetscErrorCode SVDGetOperator(SVD,Mat*);
97: EXTERN PetscErrorCode SVDSetInitialVector(SVD,Vec);
98: EXTERN PetscErrorCode SVDGetInitialVector(SVD,Vec*);
99: EXTERN PetscErrorCode SVDSetTransposeMode(SVD,SVDTransposeMode);
100: EXTERN PetscErrorCode SVDGetTransposeMode(SVD,SVDTransposeMode*);
101: EXTERN PetscErrorCode SVDSetDimensions(SVD,PetscInt,PetscInt,PetscInt);
102: EXTERN PetscErrorCode SVDGetDimensions(SVD,PetscInt*,PetscInt*,PetscInt*);
103: EXTERN PetscErrorCode SVDSetTolerances(SVD,PetscReal,PetscInt);
104: EXTERN PetscErrorCode SVDGetTolerances(SVD,PetscReal*,PetscInt*);
105: EXTERN PetscErrorCode SVDSetWhichSingularTriplets(SVD,SVDWhich);
106: EXTERN PetscErrorCode SVDGetWhichSingularTriplets(SVD,SVDWhich*);
107: EXTERN PetscErrorCode SVDSetFromOptions(SVD);
108: EXTERN PetscErrorCode SVDSetOptionsPrefix(SVD,const char*);
109: EXTERN PetscErrorCode SVDAppendOptionsPrefix(SVD,const char*);
110: EXTERN PetscErrorCode SVDGetOptionsPrefix(SVD,const char*[]);
111: EXTERN PetscErrorCode SVDSetUp(SVD);
112: EXTERN PetscErrorCode SVDSolve(SVD);
113: EXTERN PetscErrorCode SVDGetIterationNumber(SVD,PetscInt*);
114: EXTERN PetscErrorCode SVDGetConvergedReason(SVD,SVDConvergedReason*);
115: EXTERN PetscErrorCode SVDGetConverged(SVD,PetscInt*);
116: EXTERN PetscErrorCode SVDGetSingularTriplet(SVD,PetscInt,PetscReal*,Vec,Vec);
117: EXTERN PetscErrorCode SVDComputeResidualNorms(SVD,PetscInt,PetscReal*,PetscReal*);
118: EXTERN PetscErrorCode SVDComputeRelativeError(SVD,PetscInt,PetscReal*);
119: EXTERN PetscErrorCode SVDGetOperationCounters(SVD,PetscInt*,PetscInt*);
120: EXTERN PetscErrorCode SVDView(SVD,PetscViewer);
121: EXTERN PetscErrorCode SVDDestroy(SVD);
122: EXTERN PetscErrorCode SVDInitializePackage(char*);
124: EXTERN PetscErrorCode SVDMonitorSet(SVD,PetscErrorCode (*)(SVD,PetscInt,PetscInt,PetscReal*,PetscReal*,PetscInt,void*),
125: void*,PetscErrorCode (*monitordestroy)(void*));
126: EXTERN PetscErrorCode SVDMonitorCancel(SVD);
127: EXTERN PetscErrorCode SVDGetMonitorContext(SVD,void **);
128: EXTERN PetscErrorCode SVDMonitorDefault(SVD,PetscInt,PetscInt,PetscReal*,PetscReal*,PetscInt,void*);
129: EXTERN PetscErrorCode SVDMonitorLG(SVD,PetscInt,PetscInt,PetscReal*,PetscReal*,PetscInt,void*);
131: EXTERN PetscErrorCode SVDDense(PetscInt,PetscInt,PetscScalar*,PetscReal*,PetscScalar*,PetscScalar*);
133: EXTERN PetscErrorCode SVDCrossSetEPS(SVD,EPS);
134: EXTERN PetscErrorCode SVDCrossGetEPS(SVD,EPS*);
136: EXTERN PetscErrorCode SVDCyclicSetExplicitMatrix(SVD,PetscTruth);
137: EXTERN PetscErrorCode SVDCyclicGetExplicitMatrix(SVD,PetscTruth*);
138: EXTERN PetscErrorCode SVDCyclicSetEPS(SVD,EPS);
139: EXTERN PetscErrorCode SVDCyclicGetEPS(SVD,EPS*);
141: EXTERN PetscErrorCode SVDLanczosSetOneSide(SVD,PetscTruth);
143: EXTERN PetscErrorCode SVDTRLanczosSetOneSide(SVD,PetscTruth);
145: EXTERN PetscErrorCode SVDRegister(const char*,const char*,const char*,PetscErrorCode(*)(SVD));
146: #if defined(PETSC_USE_DYNAMIC_LIBRARIES)
147: #define SVDRegisterDynamic(a,b,c,d) SVDRegister(a,b,c,0)
148: #else
149: #define SVDRegisterDynamic(a,b,c,d) SVDRegister(a,b,c,d)
150: #endif
151: EXTERN PetscErrorCode SVDRegisterDestroy(void);
154: #endif