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