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