Subversion Repositories slepc-dev

Rev

Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
6 dsic.upv.es!jroman 1
/*
2548 eromero 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
2116 eromero 7
   Copyright (c) 2002-2010, Universidad 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
/*
2548 eromero 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"
2548 eromero 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, \
44
                                         SLEPC_VERSION_PATCH,SLEPC_VERSION_PATCH_DATE)
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
 
2548 eromero 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
*/
2548 eromero 72
#include "petscsys.h"
6 dsic.upv.es!jroman 73
#include "petscvec.h"
74
#include "petscmat.h"
2548 eromero 75
/*
76
    slepcvec.h contains extensions to PETSc Vec's
77
*/
78
#include "slepcvec.h"
79
/*
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
*/
2548 eromero 88
extern PetscErrorCode SlepcInitialize(int*,char***,const char[],const char[]);
89
extern PetscErrorCode SlepcFinalize(void);
90
extern PetscErrorCode SlepcInitializeFortran(void);
91
extern PetscErrorCode SlepcInitialized(PetscBool*);
6 dsic.upv.es!jroman 92
 
2548 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
 
121
#undef __FUNCT__  
122
#define __FUNCT__ "SlepcAbsEigenvalue"
123
/*@MC
124
   SlepcAbsEigenvalue - Returns the absolute value of a complex number given
125
   its real and imaginary parts.
126
 
127
  Synopsis:
128
   PetscReal SlepcAbsEigenvalue(PetscScalar x,PetscScalar y)
129
   Not Collective
130
 
131
   Input parameters:
132
+  x  - the real part of the complex number
133
-  y  - the imaginary part of the complex number
134
 
135
   Notes:
136
   This function computes sqrt(x**2+y**2), taking care not to cause unnecessary
137
   overflow. It is based on LAPACK's DLAPY2.
138
 
139
   Level: developer
140
 
141
@*/
502 dsic.upv.es!antodo 142
#if !defined(PETSC_USE_COMPLEX)
2548 eromero 143
#define SlepcAbsEigenvalue(x,y) SlepcAbs(x,y)
502 dsic.upv.es!antodo 144
#else
145
#define SlepcAbsEigenvalue(x,y) PetscAbsScalar(x)
146
#endif
2548 eromero 147
extern PetscErrorCode SlepcMatConvertSeqDense(Mat,Mat*);
148
extern PetscErrorCode SlepcMatTile(PetscScalar,Mat,PetscScalar,Mat,PetscScalar,Mat,PetscScalar,Mat,Mat*);
149
extern PetscErrorCode SlepcCheckOrthogonality(Vec*,PetscInt,Vec *,PetscInt,Mat,PetscReal*);
877 dsic.upv.es!jroman 150
 
2548 eromero 151
extern PetscBool SlepcInitializeCalled;
1409 slepc 152
 
476 dsic.upv.es!antodo 153
PETSC_EXTERN_CXX_END
6 dsic.upv.es!jroman 154
#endif
155