Actual source code: slepcds.h

  1: /*
  2:    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  3:    SLEPc - Scalable Library for Eigenvalue Problem Computations
  4:    Copyright (c) 2002-2013, Universitat Politecnica de Valencia, Spain

  6:    This file is part of SLEPc.

  8:    SLEPc is free software: you can redistribute it and/or modify it under  the
  9:    terms of version 3 of the GNU Lesser General Public License as published by
 10:    the Free Software Foundation.

 12:    SLEPc  is  distributed in the hope that it will be useful, but WITHOUT  ANY
 13:    WARRANTY;  without even the implied warranty of MERCHANTABILITY or  FITNESS
 14:    FOR  A  PARTICULAR PURPOSE. See the GNU Lesser General Public  License  for
 15:    more details.

 17:    You  should have received a copy of the GNU Lesser General  Public  License
 18:    along with SLEPc. If not, see <http://www.gnu.org/licenses/>.
 19:    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 20: */

 24: #include <slepcfn.h>

 26: #define DS_MAX_SOLVE 6
 27: #define DS_MAX_FUN   6

 29: PETSC_EXTERN PetscErrorCode DSInitializePackage(void);
 30: /*S
 31:     DS - Direct solver (or dense system), to represent low-dimensional
 32:     eigenproblems that must be solved within iterative solvers. This is an
 33:     auxiliary object and is not normally needed by application programmers.

 35:     Level: beginner

 37: .seealso:  DSCreate()
 38: S*/
 39: typedef struct _p_DS* DS;

 41: /*J
 42:     DSType - String with the name of the type of direct solver. Roughly,
 43:     there are as many types as problem types are available within SLEPc.

 45:     Level: advanced

 47: .seealso: DSSetType(), DS
 48: J*/
 49: typedef const char* DSType;
 50: #define DSHEP             "hep"
 51: #define DSNHEP            "nhep"
 52: #define DSGHEP            "ghep"
 53: #define DSGHIEP           "ghiep"
 54: #define DSGNHEP           "gnhep"
 55: #define DSSVD             "svd"
 56: #define DSQEP             "qep"
 57: #define DSNEP             "nep"

 59: /* Logging support */
 60: PETSC_EXTERN PetscClassId DS_CLASSID;

 62: /*E
 63:     DSStateType - Indicates in which state the direct solver is

 65:     Level: advanced

 67: .seealso: DSSetState()
 68: E*/
 69: typedef enum { DS_STATE_RAW,
 70:                DS_STATE_INTERMEDIATE,
 71:                DS_STATE_CONDENSED,
 72:                DS_STATE_TRUNCATED } DSStateType;

 74: /*E
 75:     DSMatType - Used to refer to one of the matrices stored internally in DS

 77:     Notes:
 78:     The matrices preferently refer to
 79: +   DS_MAT_A  - first matrix of eigenproblem/singular value problem
 80: .   DS_MAT_B  - second matrix of a generalized eigenproblem
 81: .   DS_MAT_C  - third matrix of a quadratic eigenproblem
 82: .   DS_MAT_T  - tridiagonal matrix
 83: .   DS_MAT_D  - diagonal matrix
 84: .   DS_MAT_F  - result of matrix function
 85: .   DS_MAT_Q  - orthogonal matrix of (right) Schur vectors
 86: .   DS_MAT_Z  - orthogonal matrix of left Schur vectors
 87: .   DS_MAT_X  - right eigenvectors
 88: .   DS_MAT_Y  - left eigenvectors
 89: .   DS_MAT_U  - left singular vectors
 90: .   DS_MAT_VT - right singular vectors
 91: .   DS_MAT_W  - workspace matrix
 92: -   DS_MAT_Ex - extra matrices (x=0,..,9)

 94:     All matrices can have space to hold ld x ld elements, except for
 95:     DS_MAT_T that has space for 3 x ld elements (ld = leading dimension)
 96:     and DS_MAT_D that has space for just ld elements.

 98:     Level: advanced

100: .seealso: DSAllocate(), DSGetArray(), DSGetArrayReal(), DSVectors()
101: E*/
102: typedef enum { DS_MAT_A,
103:                DS_MAT_B,
104:                DS_MAT_C,
105:                DS_MAT_T,
106:                DS_MAT_D,
107:                DS_MAT_F,
108:                DS_MAT_Q,
109:                DS_MAT_Z,
110:                DS_MAT_X,
111:                DS_MAT_Y,
112:                DS_MAT_U,
113:                DS_MAT_VT,
114:                DS_MAT_W,
115:                DS_MAT_E0,
116:                DS_MAT_E1,
117:                DS_MAT_E2,
118:                DS_MAT_E3,
119:                DS_MAT_E4,
120:                DS_MAT_E5,
121:                DS_MAT_E6,
122:                DS_MAT_E7,
123:                DS_MAT_E8,
124:                DS_MAT_E9,
125:                DS_NUM_MAT } DSMatType;

127: /* Convenience for indexing extra matrices */
128: PETSC_EXTERN DSMatType DSMatExtra[];
129: #define DS_NUM_EXTRA  10

131: PETSC_EXTERN PetscErrorCode DSCreate(MPI_Comm,DS*);
132: PETSC_EXTERN PetscErrorCode DSSetType(DS,DSType);
133: PETSC_EXTERN PetscErrorCode DSGetType(DS,DSType*);
134: PETSC_EXTERN PetscErrorCode DSSetOptionsPrefix(DS,const char *);
135: PETSC_EXTERN PetscErrorCode DSAppendOptionsPrefix(DS,const char *);
136: PETSC_EXTERN PetscErrorCode DSGetOptionsPrefix(DS,const char *[]);
137: PETSC_EXTERN PetscErrorCode DSSetFromOptions(DS);
138: PETSC_EXTERN PetscErrorCode DSView(DS,PetscViewer);
139: PETSC_EXTERN PetscErrorCode DSDestroy(DS*);
140: PETSC_EXTERN PetscErrorCode DSReset(DS);

142: PETSC_EXTERN PetscErrorCode DSAllocate(DS,PetscInt);
143: PETSC_EXTERN PetscErrorCode DSGetLeadingDimension(DS,PetscInt*);
144: PETSC_EXTERN PetscErrorCode DSSetState(DS,DSStateType);
145: PETSC_EXTERN PetscErrorCode DSGetState(DS,DSStateType*);
146: PETSC_EXTERN PetscErrorCode DSSetDimensions(DS,PetscInt,PetscInt,PetscInt,PetscInt);
147: PETSC_EXTERN PetscErrorCode DSGetDimensions(DS,PetscInt*,PetscInt*,PetscInt*,PetscInt*,PetscInt*);
148: PETSC_EXTERN PetscErrorCode DSTruncate(DS,PetscInt);
149: PETSC_EXTERN PetscErrorCode DSSetMethod(DS,PetscInt);
150: PETSC_EXTERN PetscErrorCode DSGetMethod(DS,PetscInt*);
151: PETSC_EXTERN PetscErrorCode DSSetFunctionMethod(DS,PetscInt);
152: PETSC_EXTERN PetscErrorCode DSGetFunctionMethod(DS,PetscInt*);
153: PETSC_EXTERN PetscErrorCode DSSetCompact(DS,PetscBool);
154: PETSC_EXTERN PetscErrorCode DSGetCompact(DS,PetscBool*);
155: PETSC_EXTERN PetscErrorCode DSSetExtraRow(DS,PetscBool);
156: PETSC_EXTERN PetscErrorCode DSGetExtraRow(DS,PetscBool*);
157: PETSC_EXTERN PetscErrorCode DSSetRefined(DS,PetscBool);
158: PETSC_EXTERN PetscErrorCode DSGetRefined(DS,PetscBool*);
159: PETSC_EXTERN PetscErrorCode DSGetArray(DS,DSMatType,PetscScalar *a[]);
160: PETSC_EXTERN PetscErrorCode DSRestoreArray(DS,DSMatType,PetscScalar *a[]);
161: PETSC_EXTERN PetscErrorCode DSGetArrayReal(DS,DSMatType,PetscReal *a[]);
162: PETSC_EXTERN PetscErrorCode DSRestoreArrayReal(DS,DSMatType,PetscReal *a[]);
163: PETSC_EXTERN PetscErrorCode DSVectors(DS,DSMatType,PetscInt*,PetscReal*);
164: PETSC_EXTERN PetscErrorCode DSSolve(DS,PetscScalar*,PetscScalar*);
165: PETSC_EXTERN PetscErrorCode DSSort(DS,PetscScalar*,PetscScalar*,PetscScalar*,PetscScalar*,PetscInt*);
166: PETSC_EXTERN PetscErrorCode DSComputeFunction(DS,SlepcFunction);
167: PETSC_EXTERN PetscErrorCode DSSetEigenvalueComparison(DS,PetscErrorCode (*)(PetscScalar,PetscScalar,PetscScalar,PetscScalar,PetscInt*,void*),void*);
168: PETSC_EXTERN PetscErrorCode DSGetEigenvalueComparison(DS,PetscErrorCode (**)(PetscScalar,PetscScalar,PetscScalar,PetscScalar,PetscInt*,void*),void**);
169: PETSC_EXTERN PetscErrorCode DSUpdateExtraRow(DS);
170: PETSC_EXTERN PetscErrorCode DSCond(DS,PetscReal*);
171: PETSC_EXTERN PetscErrorCode DSTranslateHarmonic(DS,PetscScalar,PetscReal,PetscBool,PetscScalar*,PetscReal*);
172: PETSC_EXTERN PetscErrorCode DSTranslateRKS(DS,PetscScalar);
173: PETSC_EXTERN PetscErrorCode DSNormalize(DS,DSMatType,PetscInt);

175: PETSC_EXTERN PetscErrorCode DSSetFN(DS,PetscInt,FN*);
176: PETSC_EXTERN PetscErrorCode DSGetFN(DS,PetscInt,FN*);
177: PETSC_EXTERN PetscErrorCode DSGetNumFN(DS,PetscInt*);

179: PETSC_EXTERN PetscFunctionList DSList;
180: PETSC_EXTERN PetscBool         DSRegisterAllCalled;
181: PETSC_EXTERN PetscErrorCode DSRegisterAll(void);
182: PETSC_EXTERN PetscErrorCode DSRegister(const char[],PetscErrorCode(*)(DS));

184: #endif