Nektar++
Arpack.hpp
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File Arpack.hpp
4 //
5 // For more information, please see: http://www.nektar.info
6 //
7 // The MIT License
8 //
9 // Copyright (c) 2006 Division of Applied Mathematics, Brown University (USA),
10 // Department of Aeronautics, Imperial College London (UK), and Scientific
11 // Computing and Imaging Institute, University of Utah (USA).
12 //
13 // License for the specific language governing rights and limitations under
14 // Permission is hereby granted, free of charge, to any person obtaining a
15 // copy of this software and associated documentation files (the "Software"),
16 // to deal in the Software without restriction, including without limitation
17 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
18 // and/or sell copies of the Software, and to permit persons to whom the
19 // Software is furnished to do so, subject to the following conditions:
20 //
21 // The above copyright notice and this permission notice shall be included
22 // in all copies or substantial portions of the Software.
23 //
24 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
25 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
27 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
29 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
30 // DEALINGS IN THE SOFTWARE.
31 //
32 // Description: wrapper of functions around standard Arpack routines.
33 //
34 ///////////////////////////////////////////////////////////////////////////////
35 
36 #ifndef NEKTAR_LIB_UTILITIES_LINEAR_ALGEBRA_ARPACK_HPP
37 #define NEKTAR_LIB_UTILITIES_LINEAR_ALGEBRA_ARPACK_HPP
38 
40 
41 // Translations for using Fortran version of arpack
42 namespace Arpack
43 {
44  extern "C"
45  {
46  //ARPACK ROUTINES
47 
48  //Computation of eigenvalues
49 
50  void F77NAME(dsaupd) (int& ido, const char* bmat,
51  const int& n, const char* which,
52  const int& nev, const double& tol,
53  double* resid, const int& ncv,
54  double* v, const int& ldv,
55  int* iparam, int* ipntr,
56  double* workd, double* workl,
57  const int& lworkl, int& info );
58 
59  void F77NAME(dnaupd) (int& ido, const char* bmat,
60  const int& n, const char* which,
61  const int& nev, const double& tol,
62  double* resid, const int& ncv,
63  double* v, const int& ldv,
64  int* iparam, int* ipntr,
65  double* workd, double* workl,
66  const int& lworkl, int& info);
67 
68 
69 
70  //Computation of eigenvectors
71  void F77NAME(dseupd) (const int& rvec, const char* howmny,
72  const int* select, double* d,
73  double* z , const int& ldz,
74  const double& sigma,const char* bmat,
75  const int& n, const char* which,
76  const int& nev, const double& tol,
77  double* resid, const int& ncv,
78  double* v, const int& ldv,
79  const int* iparam, int* ipntr,
80  const double* workd,double* workl,
81  const int& lworkl, int& info);
82 
83  void F77NAME(dneupd) (const int& rvec, const char* howmny,
84  const int* select, double* dr,
85  double* di, double* z ,
86  const int& ldz, const double& sigmar,
87  const double& sigmai,double* workev,
88  const char* bmat, const int& n,
89  const char* which, const int& nev,
90  const double& tol, double* resid,
91  const int& ncv, double* v,
92  const int& ldv, int* iparam,
93  int* ipntr, double* workd,
94  double* workl, const int& lworkl, int& info);
95 
96  }
97 
98 //#ifdef NEKTAR_USING_ARPACK
99 
100 
101  ///Top level reverse communication interface to solve real double-precision symmetric problems
102 
103  static inline void Dsaupd ( int& ido, const char* bmat,
104  const int& n, const char* which,
105  const int& nev, const double& tol,
106  double* resid, const int& ncv,
107  double* v, const int& ldv,
108  int* iparam, int* ipntr,
109  double* workd, double* workl,
110  const int& lworkl, int& info)
111  {
112  F77NAME(dsaupd) (ido,bmat,n,which,nev,tol,resid,ncv,v,ldv,iparam,ipntr,workd,workl,lworkl,info);
113  }
114 
115 
116 
117  /// Post-processing routine to computed eigenvector of computed eigenvalues in Dsaupd
118  static inline void Dseupd (const int& rvec, const char* howmny,
119  const int* select, double* d,
120  double* z , const int& ldz,
121  const double& sigma, const char* bmat,
122  const int& n, const char* which,
123  const int& nev, const double& tol,
124  double* resid, const int& ncv,
125  double* v, const int& ldv,
126  int* iparam, int* ipntr,
127  double* workd, double* workl,
128  const int& lworkl, int& info)
129  {
130  F77NAME(dseupd) (rvec,howmny, select,d,z,ldz,sigma,bmat,n,which,nev,tol,resid,ncv,v,ldv,iparam,ipntr,workd,workl,lworkl,info);
131  }
132 
133 
134  ///Top level reverse communication interface to solve real double-precision non-symmetric problems
135  static inline void Dnaupd ( int& ido, const char* bmat,
136  const int& n, const char* which,
137  const int& nev, const double& tol,
138  double* resid, const int& ncv,
139  double* v, const int& ldv,
140  int* iparam, int* ipntr,
141  double* workd, double* workl,
142  const int& lworkl, int& info)
143  {
144  F77NAME(dnaupd) (ido,bmat,n,which,nev,tol,resid,ncv,v,ldv,iparam,ipntr,workd,workl,lworkl,info);
145  }
146 
147  /// Post-processing routine to computed eigenvector of computed eigenvalues in Dnaupd
148 
149  static inline void Dneupd(const int& rvec, const char* howmny,
150  const int* select, double* dr,
151  double* di, double* z ,
152  const int& ldz, const double& sigmar,
153  const double& sigmai,double* workev,
154  const char* bmat, const int& n,
155  const char* which, const int& nev,
156  const double& tol, double* resid,
157  const int& ncv, double* v,
158  const int& ldv, int* iparam,
159  int* ipntr, double* workd,
160  double* workl, const int& lworkl, int& info)
161  {
162  F77NAME(dneupd) (rvec,howmny,select,dr,di,z,ldz,sigmar,sigmai,workev,bmat,n,which,nev,tol,resid,ncv,v,ldv,iparam,ipntr,workd,workl,lworkl,info);
163  }
164 
165 
166 
167 //#endif //NEKTAR_USING_ARPACK
168 }
169 #endif //NEKTAR_LIB_UTILITIES_LINEAR_ALGEBRA_ARPACK_HPP
170 
static void Dneupd(const int &rvec, const char *howmny, const int *select, double *dr, double *di, double *z, const int &ldz, const double &sigmar, const double &sigmai, double *workev, const char *bmat, const int &n, const char *which, const int &nev, const double &tol, double *resid, const int &ncv, double *v, const int &ldv, int *iparam, int *ipntr, double *workd, double *workl, const int &lworkl, int &info)
Post-processing routine to computed eigenvector of computed eigenvalues in Dnaupd.
Definition: Arpack.hpp:149
static void Dsaupd(int &ido, const char *bmat, const int &n, const char *which, const int &nev, const double &tol, double *resid, const int &ncv, double *v, const int &ldv, int *iparam, int *ipntr, double *workd, double *workl, const int &lworkl, int &info)
Top level reverse communication interface to solve real double-precision symmetric problems...
Definition: Arpack.hpp:103
static void Dseupd(const int &rvec, const char *howmny, const int *select, double *d, double *z, const int &ldz, const double &sigma, const char *bmat, const int &n, const char *which, const int &nev, const double &tol, double *resid, const int &ncv, double *v, const int &ldv, int *iparam, int *ipntr, double *workd, double *workl, const int &lworkl, int &info)
Post-processing routine to computed eigenvector of computed eigenvalues in Dsaupd.
Definition: Arpack.hpp:118
#define F77NAME(x)
Fortran routines need an underscore.
Definition: TransF77.hpp:47
void F77NAME() dsaupd(int &ido, const char *bmat, const int &n, const char *which, const int &nev, const double &tol, double *resid, const int &ncv, double *v, const int &ldv, int *iparam, int *ipntr, double *workd, double *workl, const int &lworkl, int &info)
void F77NAME() dnaupd(int &ido, const char *bmat, const int &n, const char *which, const int &nev, const double &tol, double *resid, const int &ncv, double *v, const int &ldv, int *iparam, int *ipntr, double *workd, double *workl, const int &lworkl, int &info)
void F77NAME() dneupd(const int &rvec, const char *howmny, const int *select, double *dr, double *di, double *z, const int &ldz, const double &sigmar, const double &sigmai, double *workev, const char *bmat, const int &n, const char *which, const int &nev, const double &tol, double *resid, const int &ncv, double *v, const int &ldv, int *iparam, int *ipntr, double *workd, double *workl, const int &lworkl, int &info)
static void Dnaupd(int &ido, const char *bmat, const int &n, const char *which, const int &nev, const double &tol, double *resid, const int &ncv, double *v, const int &ldv, int *iparam, int *ipntr, double *workd, double *workl, const int &lworkl, int &info)
Top level reverse communication interface to solve real double-precision non-symmetric problems...
Definition: Arpack.hpp:135
void F77NAME() dseupd(const int &rvec, const char *howmny, const int *select, double *d, double *z, const int &ldz, const double &sigma, const char *bmat, const int &n, const char *which, const int &nev, const double &tol, double *resid, const int &ncv, double *v, const int &ldv, const int *iparam, int *ipntr, const double *workd, double *workl, const int &lworkl, int &info)