| 6 |
dsic.upv.es!jroman |
1 |
/*
|
| 2265 |
jroman |
2 |
This include file contains definitions of system functions. It is included
|
|
|
3 |
by all other SLEPc include files.
|
| 1376 |
slepc |
4 |
|
|
|
5 |
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
| 1672 |
slepc |
6 |
SLEPc - Scalable Library for Eigenvalue Problem Computations
|
| 2575 |
eromero |
7 |
Copyright (c) 2002-2011, Universitat Politecnica de Valencia, Spain
|
| 1376 |
slepc |
8 |
|
| 1672 |
slepc |
9 |
This file is part of SLEPc.
|
|
|
10 |
|
|
|
11 |
SLEPc is free software: you can redistribute it and/or modify it under the
|
|
|
12 |
terms of version 3 of the GNU Lesser General Public License as published by
|
|
|
13 |
the Free Software Foundation.
|
|
|
14 |
|
|
|
15 |
SLEPc is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
|
16 |
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
|
17 |
FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
|
|
|
18 |
more details.
|
|
|
19 |
|
|
|
20 |
You should have received a copy of the GNU Lesser General Public License
|
|
|
21 |
along with SLEPc. If not, see <http://www.gnu.org/licenses/>.
|
| 1376 |
slepc |
22 |
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
| 6 |
dsic.upv.es!jroman |
23 |
*/
|
| 1376 |
slepc |
24 |
|
| 6 |
dsic.upv.es!jroman |
25 |
#if !defined(__SLEPC_H)
|
|
|
26 |
#define __SLEPC_H
|
|
|
27 |
|
|
|
28 |
/* ========================================================================== */
|
|
|
29 |
/*
|
| 2265 |
jroman |
30 |
slepcconf.h is created by the configure script and placed in ${PETSC_ARCH}/include.
|
|
|
31 |
It contains macro definitions set at configure time.
|
|
|
32 |
*/
|
|
|
33 |
#include "slepcconf.h"
|
|
|
34 |
|
|
|
35 |
/* ========================================================================== */
|
|
|
36 |
/*
|
| 6 |
dsic.upv.es!jroman |
37 |
Current SLEPc version number and release date
|
|
|
38 |
*/
|
|
|
39 |
#include "slepcversion.h"
|
| 2269 |
jroman |
40 |
#define SLEPC_AUTHOR_INFO " The SLEPc Team\n slepc-maint@grycap.upv.es\n http://www.grycap.upv.es/slepc\n"
|
|
|
41 |
#if (SLEPC_VERSION_RELEASE == 1)
|
|
|
42 |
#define SlepcGetVersion(version,len) PetscSNPrintf(version,len,"SLEPc Release Version %d.%d, Patch %d, %s", \
|
|
|
43 |
SLEPC_VERSION_MAJOR,SLEPC_VERSION_MINOR, \
|
| 2316 |
jroman |
44 |
SLEPC_VERSION_PATCH,SLEPC_VERSION_PATCH_DATE)
|
| 2269 |
jroman |
45 |
#else
|
|
|
46 |
#define SlepcGetVersion(version,len) PetscSNPrintf(version,len,"SLEPc Development SVN revision: %d SVN Date: %s", \
|
|
|
47 |
SLEPC_VERSION_SVN, SLEPC_VERSION_DATE_SVN)
|
|
|
48 |
#endif
|
|
|
49 |
/*MC
|
|
|
50 |
SlepcGetVersion - Gets the SLEPc version information in a string.
|
| 6 |
dsic.upv.es!jroman |
51 |
|
| 2269 |
jroman |
52 |
Input Parameter:
|
|
|
53 |
. len - length of the string
|
|
|
54 |
|
|
|
55 |
Output Parameter:
|
|
|
56 |
. version - version string
|
|
|
57 |
|
|
|
58 |
Level: developer
|
|
|
59 |
|
|
|
60 |
Usage:
|
|
|
61 |
char version[256];
|
|
|
62 |
ierr = SlepcGetVersion(version,256);CHKERRQ(ierr)
|
|
|
63 |
|
|
|
64 |
Fortran Note:
|
|
|
65 |
This routine is not supported in Fortran.
|
|
|
66 |
M*/
|
|
|
67 |
|
| 6 |
dsic.upv.es!jroman |
68 |
/* ========================================================================== */
|
|
|
69 |
/*
|
|
|
70 |
The PETSc include files.
|
|
|
71 |
*/
|
| 2265 |
jroman |
72 |
#include "petscsys.h"
|
| 6 |
dsic.upv.es!jroman |
73 |
#include "petscvec.h"
|
|
|
74 |
#include "petscmat.h"
|
| 2283 |
jroman |
75 |
/*
|
| 2345 |
jroman |
76 |
slepcvec.h contains extensions to PETSc Vec's
|
|
|
77 |
*/
|
|
|
78 |
#include "slepcvec.h"
|
|
|
79 |
/*
|
| 2283 |
jroman |
80 |
slepcimpl.h contains definitions common to all SLEPc objects
|
|
|
81 |
*/
|
|
|
82 |
#include "private/slepcimpl.h"
|
| 6 |
dsic.upv.es!jroman |
83 |
|
| 476 |
dsic.upv.es!antodo |
84 |
PETSC_EXTERN_CXX_BEGIN
|
| 6 |
dsic.upv.es!jroman |
85 |
/*
|
|
|
86 |
Initialization of SLEPc and other system routines
|
|
|
87 |
*/
|
| 2428 |
jroman |
88 |
extern PetscErrorCode SlepcInitialize(int*,char***,const char[],const char[]);
|
| 2240 |
jroman |
89 |
extern PetscErrorCode SlepcFinalize(void);
|
|
|
90 |
extern PetscErrorCode SlepcInitializeFortran(void);
|
| 2428 |
jroman |
91 |
extern PetscErrorCode SlepcInitialized(PetscBool*);
|
| 6 |
dsic.upv.es!jroman |
92 |
|
| 2545 |
eromero |
93 |
#undef __FUNCT__
|
|
|
94 |
#define __FUNCT__ "SlepcAbs"
|
|
|
95 |
/*@C
|
|
|
96 |
SlepcAbs - Returns sqrt(x**2+y**2), taking care not to cause unnecessary
|
|
|
97 |
overflow. It is based on LAPACK's DLAPY2.
|
|
|
98 |
|
|
|
99 |
Not Collective
|
|
|
100 |
|
|
|
101 |
Input parameters:
|
|
|
102 |
. x,y - the real numbers
|
|
|
103 |
|
|
|
104 |
Output parameter:
|
|
|
105 |
. return - the result
|
|
|
106 |
|
|
|
107 |
Level: developer
|
|
|
108 |
@*/
|
|
|
109 |
PETSC_STATIC_INLINE PetscReal SlepcAbs(PetscReal x,PetscReal y)
|
|
|
110 |
{
|
|
|
111 |
PetscReal w,z,t,xabs=PetscAbs(x),yabs=PetscAbs(y);
|
|
|
112 |
|
|
|
113 |
w = PetscMax(xabs,yabs);
|
|
|
114 |
z = PetscMin(xabs,yabs);
|
|
|
115 |
if (z == 0.0) return w;
|
|
|
116 |
t = z/w;
|
|
|
117 |
return w*PetscSqrtReal(1.0+t*t);
|
|
|
118 |
}
|
|
|
119 |
|
|
|
120 |
|
| 2546 |
eromero |
121 |
/*MC
|
| 2545 |
eromero |
122 |
SlepcAbsEigenvalue - Returns the absolute value of a complex number given
|
|
|
123 |
its real and imaginary parts.
|
|
|
124 |
|
|
|
125 |
Synopsis:
|
|
|
126 |
PetscReal SlepcAbsEigenvalue(PetscScalar x,PetscScalar y)
|
|
|
127 |
Not Collective
|
|
|
128 |
|
|
|
129 |
Input parameters:
|
|
|
130 |
+ x - the real part of the complex number
|
|
|
131 |
- y - the imaginary part of the complex number
|
|
|
132 |
|
|
|
133 |
Notes:
|
|
|
134 |
This function computes sqrt(x**2+y**2), taking care not to cause unnecessary
|
|
|
135 |
overflow. It is based on LAPACK's DLAPY2.
|
|
|
136 |
|
|
|
137 |
Level: developer
|
|
|
138 |
|
| 2546 |
eromero |
139 |
M*/
|
| 502 |
dsic.upv.es!antodo |
140 |
#if !defined(PETSC_USE_COMPLEX)
|
| 2545 |
eromero |
141 |
#define SlepcAbsEigenvalue(x,y) SlepcAbs(x,y)
|
| 502 |
dsic.upv.es!antodo |
142 |
#else
|
|
|
143 |
#define SlepcAbsEigenvalue(x,y) PetscAbsScalar(x)
|
|
|
144 |
#endif
|
| 2240 |
jroman |
145 |
extern PetscErrorCode SlepcMatConvertSeqDense(Mat,Mat*);
|
| 2294 |
jroman |
146 |
extern PetscErrorCode SlepcMatTile(PetscScalar,Mat,PetscScalar,Mat,PetscScalar,Mat,PetscScalar,Mat,Mat*);
|
| 2538 |
jroman |
147 |
extern PetscErrorCode SlepcCheckOrthogonality(Vec*,PetscInt,Vec *,PetscInt,Mat,PetscReal*);
|
| 877 |
dsic.upv.es!jroman |
148 |
|
| 2216 |
jroman |
149 |
extern PetscBool SlepcInitializeCalled;
|
| 1409 |
slepc |
150 |
|
| 476 |
dsic.upv.es!antodo |
151 |
PETSC_EXTERN_CXX_END
|
| 6 |
dsic.upv.es!jroman |
152 |
#endif
|
|
|
153 |
|