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, const int &n,
50  const char *which, const int &nev, const double &tol,
51  double *resid, const int &ncv, double *v,
52  const int &ldv, int *iparam, int *ipntr, double *workd,
53  double *workl, const int &lworkl, int &info);
54 
55  void F77NAME(dnaupd)(int &ido, const char *bmat, const int &n,
56  const char *which, const int &nev, const double &tol,
57  double *resid, const int &ncv, double *v,
58  const int &ldv, int *iparam, int *ipntr, double *workd,
59  double *workl, const int &lworkl, int &info);
60 
61  // Computation of eigenvectors
62  void F77NAME(dseupd)(const int &rvec, const char *howmny, const int *select,
63  double *d, double *z, const int &ldz,
64  const double &sigma, const char *bmat, const int &n,
65  const char *which, const int &nev, const double &tol,
66  double *resid, const int &ncv, double *v,
67  const int &ldv, const int *iparam, int *ipntr,
68  const double *workd, double *workl, const int &lworkl,
69  int &info);
70 
71  void F77NAME(dneupd)(const int &rvec, const char *howmny, const int *select,
72  double *dr, double *di, double *z, const int &ldz,
73  const double &sigmar, const double &sigmai,
74  double *workev, const char *bmat, const int &n,
75  const char *which, const int &nev, const double &tol,
76  double *resid, const int &ncv, double *v,
77  const int &ldv, int *iparam, int *ipntr, double *workd,
78  double *workl, const int &lworkl, int &info);
79 }
80 
81 //#ifdef NEKTAR_USING_ARPACK
82 
83 /// Top level reverse communication interface to solve real double-precision
84 /// symmetric problems
85 
86 static inline void Dsaupd(int &ido, const char *bmat, const int &n,
87  const char *which, const int &nev, const double &tol,
88  double *resid, const int &ncv, double *v,
89  const int &ldv, int *iparam, int *ipntr,
90  double *workd, double *workl, const int &lworkl,
91  int &info)
92 {
94  (ido, bmat, n, which, nev, tol, resid, ncv, v, ldv, iparam, ipntr, workd,
95  workl, lworkl, info);
96 }
97 
98 /// Post-processing routine to computed eigenvector of computed eigenvalues in
99 /// Dsaupd
100 static inline void Dseupd(const int &rvec, const char *howmny,
101  const int *select, double *d, double *z,
102  const int &ldz, const double &sigma, const char *bmat,
103  const int &n, const char *which, const int &nev,
104  const double &tol, double *resid, const int &ncv,
105  double *v, const int &ldv, int *iparam, int *ipntr,
106  double *workd, double *workl, const int &lworkl,
107  int &info)
108 {
109  F77NAME(dseupd)
110  (rvec, howmny, select, d, z, ldz, sigma, bmat, n, which, nev, tol, resid,
111  ncv, v, ldv, iparam, ipntr, workd, workl, lworkl, info);
112 }
113 
114 /// Top level reverse communication interface to solve real double-precision
115 /// non-symmetric problems
116 static inline void Dnaupd(int &ido, const char *bmat, const int &n,
117  const char *which, const int &nev, const double &tol,
118  double *resid, const int &ncv, double *v,
119  const int &ldv, int *iparam, int *ipntr,
120  double *workd, double *workl, const int &lworkl,
121  int &info)
122 {
123  F77NAME(dnaupd)
124  (ido, bmat, n, which, nev, tol, resid, ncv, v, ldv, iparam, ipntr, workd,
125  workl, lworkl, info);
126 }
127 
128 /// Post-processing routine to computed eigenvector of computed eigenvalues in
129 /// Dnaupd
130 
131 static inline void Dneupd(const int &rvec, const char *howmny,
132  const int *select, double *dr, double *di, double *z,
133  const int &ldz, const double &sigmar,
134  const double &sigmai, double *workev,
135  const char *bmat, const int &n, const char *which,
136  const int &nev, const double &tol, double *resid,
137  const int &ncv, double *v, const int &ldv,
138  int *iparam, int *ipntr, double *workd, double *workl,
139  const int &lworkl, int &info)
140 {
141  F77NAME(dneupd)
142  (rvec, howmny, select, dr, di, z, ldz, sigmar, sigmai, workev, bmat, n,
143  which, nev, tol, resid, ncv, v, ldv, iparam, ipntr, workd, workl, lworkl,
144  info);
145 }
146 
147 //#endif //NEKTAR_USING_ARPACK
148 } // namespace Arpack
149 #endif // NEKTAR_LIB_UTILITIES_LINEAR_ALGEBRA_ARPACK_HPP
#define F77NAME(x)
Fortran routines need an underscore.
Definition: TransF77.hpp:46
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)
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:116
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)
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() 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)
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:131
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:86
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:100