Skip to content

Commit

Permalink
[BUG FIX] parpack.h\hpp: rwork should be real instead of complex.
Browse files Browse the repository at this point in the history
  • Loading branch information
wztzjhn authored and fghoussen committed Aug 14, 2022
1 parent d280435 commit f36eb6c
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 16 deletions.
3 changes: 3 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
arpack-ng - 3.9.0

[ Zhentao Wang ]
* [BUG FIX] parpack.h and parpack.hpp: type of rwork should be real instead of complex.

[ Jose E. Roman ]
* Avoid using isnan() in tests, since is GNU-specific

Expand Down
8 changes: 4 additions & 4 deletions ICB/parpack.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
extern "C" {
#endif

void pcnaupd_c(MPI_Fint comm, a_int* ido, char const* bmat, a_int n, char const* which, a_int nev, float tol, a_fcomplex* resid, a_int ncv, a_fcomplex* v, a_int ldv, a_int* iparam, a_int* ipntr, a_fcomplex* workd, a_fcomplex* workl, a_int lworkl, a_fcomplex* rwork, a_int* info);
void pcneupd_c(MPI_Fint comm, a_int rvec, char const* howmny, a_int const* select, a_fcomplex* d, a_fcomplex* z, a_int ldz, a_fcomplex sigma, a_fcomplex* workev, char const* bmat, a_int n, char const* which, a_int nev, float tol, a_fcomplex* resid, a_int ncv, a_fcomplex* v, a_int ldv, a_int* iparam, a_int* ipntr, a_fcomplex* workd, a_fcomplex* workl, a_int lworkl, a_fcomplex* rwork, a_int* info);
void pcnaupd_c(MPI_Fint comm, a_int* ido, char const* bmat, a_int n, char const* which, a_int nev, float tol, a_fcomplex* resid, a_int ncv, a_fcomplex* v, a_int ldv, a_int* iparam, a_int* ipntr, a_fcomplex* workd, a_fcomplex* workl, a_int lworkl, float* rwork, a_int* info);
void pcneupd_c(MPI_Fint comm, a_int rvec, char const* howmny, a_int const* select, a_fcomplex* d, a_fcomplex* z, a_int ldz, a_fcomplex sigma, a_fcomplex* workev, char const* bmat, a_int n, char const* which, a_int nev, float tol, a_fcomplex* resid, a_int ncv, a_fcomplex* v, a_int ldv, a_int* iparam, a_int* ipntr, a_fcomplex* workd, a_fcomplex* workl, a_int lworkl, float* rwork, a_int* info);
void pdnaupd_c(MPI_Fint comm, a_int* ido, char const* bmat, a_int n, char const* which, a_int nev, double tol, double* resid, a_int ncv, double* v, a_int ldv, a_int* iparam, a_int* ipntr, double* workd, double* workl, a_int lworkl, a_int* info);
void pdneupd_c(MPI_Fint comm, a_int rvec, char const* howmny, a_int const* select, double* dr, double* di, double* z, a_int ldz, double sigmar, double sigmai, double * workev, char const* bmat, a_int n, char const* which, a_int nev, double tol, double* resid, a_int ncv, double* v, a_int ldv, a_int* iparam, a_int* ipntr, double* workd, double* workl, a_int lworkl, a_int* info);
void pdsaupd_c(MPI_Fint comm, a_int* ido, char const* bmat, a_int n, char const* which, a_int nev, double tol, double* resid, a_int ncv, double* v, a_int ldv, a_int* iparam, a_int* ipntr, double* workd, double* workl, a_int lworkl, a_int* info);
Expand All @@ -24,8 +24,8 @@ void psnaupd_c(MPI_Fint comm, a_int* ido, char const* bmat, a_int n, char const*
void psneupd_c(MPI_Fint comm, a_int rvec, char const* howmny, a_int const* select, float* dr, float* di, float* z, a_int ldz, float sigmar, float sigmai, float * workev, char const* bmat, a_int n, char const* which, a_int nev, float tol, float* resid, a_int ncv, float* v, a_int ldv, a_int* iparam, a_int* ipntr, float* workd, float* workl, a_int lworkl, a_int* info);
void pssaupd_c(MPI_Fint comm, a_int* ido, char const* bmat, a_int n, char const* which, a_int nev, float tol, float* resid, a_int ncv, float* v, a_int ldv, a_int* iparam, a_int* ipntr, float* workd, float* workl, a_int lworkl, a_int* info);
void psseupd_c(MPI_Fint comm, a_int rvec, char const* howmny, a_int const* select, float* d, float* z, a_int ldz, float sigma, char const* bmat, a_int n, char const* which, a_int nev, float tol, float* resid, a_int ncv, float* v, a_int ldv, a_int* iparam, a_int* ipntr, float* workd, float* workl, a_int lworkl, a_int* info);
void pznaupd_c(MPI_Fint comm, a_int* ido, char const* bmat, a_int n, char const* which, a_int nev, double tol, a_dcomplex* resid, a_int ncv, a_dcomplex* v, a_int ldv, a_int* iparam, a_int* ipntr, a_dcomplex* workd, a_dcomplex* workl, a_int lworkl, a_dcomplex* rwork, a_int* info);
void pzneupd_c(MPI_Fint comm, a_int rvec, char const* howmny, a_int const* select, a_dcomplex* d, a_dcomplex* z, a_int ldz, a_dcomplex sigma, a_dcomplex* workev, char const* bmat, a_int n, char const* which, a_int nev, double tol, a_dcomplex* resid, a_int ncv, a_dcomplex* v, a_int ldv, a_int* iparam, a_int* ipntr, a_dcomplex* workd, a_dcomplex* workl, a_int lworkl, a_dcomplex* rwork, a_int* info);
void pznaupd_c(MPI_Fint comm, a_int* ido, char const* bmat, a_int n, char const* which, a_int nev, double tol, a_dcomplex* resid, a_int ncv, a_dcomplex* v, a_int ldv, a_int* iparam, a_int* ipntr, a_dcomplex* workd, a_dcomplex* workl, a_int lworkl, double* rwork, a_int* info);
void pzneupd_c(MPI_Fint comm, a_int rvec, char const* howmny, a_int const* select, a_dcomplex* d, a_dcomplex* z, a_int ldz, a_dcomplex sigma, a_dcomplex* workev, char const* bmat, a_int n, char const* which, a_int nev, double tol, a_dcomplex* resid, a_int ncv, a_dcomplex* v, a_int ldv, a_int* iparam, a_int* ipntr, a_dcomplex* workd, a_dcomplex* workl, a_int lworkl, double* rwork, a_int* info);

#ifdef __cplusplus
}
Expand Down
16 changes: 8 additions & 8 deletions ICB/parpack.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,14 @@ inline void naupd(MPI_Fint comm, a_int& ido, bmat const bmat_option, a_int n,
std::complex<float>* resid, a_int ncv, std::complex<float>* v,
a_int ldv, a_int* iparam, a_int* ipntr, std::complex<float>* workd,
std::complex<float>* workl, a_int lworkl,
std::complex<float>* rwork, a_int& info) {
float* rwork, a_int& info) {
internal::pcnaupd_c(comm, &ido, internal::convert_to_char(bmat_option), n,
internal::convert_to_char(which_option), nev, tol,
reinterpret_cast<a_fcomplex*>(resid), ncv,
reinterpret_cast<a_fcomplex*>(v), ldv, iparam, ipntr,
reinterpret_cast<a_fcomplex*>(workd),
reinterpret_cast<a_fcomplex*>(workl), lworkl,
reinterpret_cast<a_fcomplex*>(rwork), &info);
rwork, &info);
}

inline void neupd(MPI_Fint comm, a_int rvec, howmny const howmny_option,
Expand All @@ -129,7 +129,7 @@ inline void neupd(MPI_Fint comm, a_int rvec, howmny const howmny_option,
std::complex<float>* resid, a_int ncv, std::complex<float>* v,
a_int ldv, a_int* iparam, a_int* ipntr, std::complex<float>* workd,
std::complex<float>* workl, a_int lworkl,
std::complex<float>* rwork, a_int& info)
float* rwork, a_int& info)

{
std::complex<float> sigma2 = sigma;
Expand All @@ -144,22 +144,22 @@ inline void neupd(MPI_Fint comm, a_int rvec, howmny const howmny_option,
reinterpret_cast<a_fcomplex*>(v), ldv, iparam, ipntr,
reinterpret_cast<a_fcomplex*>(workd),
reinterpret_cast<a_fcomplex*>(workl), lworkl,
reinterpret_cast<a_fcomplex*>(rwork), &info);
rwork, &info);
}

inline void naupd(MPI_Fint comm, a_int& ido, bmat const bmat_option, a_int n,
which const which_option, a_int nev, double tol,
std::complex<double>* resid, a_int ncv, std::complex<double>* v,
a_int ldv, a_int* iparam, a_int* ipntr, std::complex<double>* workd,
std::complex<double>* workl, a_int lworkl,
std::complex<double>* rwork, a_int& info) {
double* rwork, a_int& info) {
internal::pznaupd_c(comm, &ido, internal::convert_to_char(bmat_option), n,
internal::convert_to_char(which_option), nev, tol,
reinterpret_cast<a_dcomplex*>(resid), ncv,
reinterpret_cast<a_dcomplex*>(v), ldv, iparam, ipntr,
reinterpret_cast<a_dcomplex*>(workd),
reinterpret_cast<a_dcomplex*>(workl), lworkl,
reinterpret_cast<a_dcomplex*>(rwork), &info);
rwork, &info);
}

inline void neupd(MPI_Fint comm, a_int rvec, howmny const howmny_option,
Expand All @@ -170,7 +170,7 @@ inline void neupd(MPI_Fint comm, a_int rvec, howmny const howmny_option,
std::complex<double>* resid, a_int ncv, std::complex<double>* v,
a_int ldv, a_int* iparam, a_int* ipntr, std::complex<double>* workd,
std::complex<double>* workl, a_int lworkl,
std::complex<double>* rwork, a_int& info) {
double* rwork, a_int& info) {
std::complex<double> sigma2 = sigma;
internal::pzneupd_c(comm, rvec, internal::convert_to_char(howmny_option),
select, reinterpret_cast<a_dcomplex*>(d),
Expand All @@ -183,7 +183,7 @@ inline void neupd(MPI_Fint comm, a_int rvec, howmny const howmny_option,
reinterpret_cast<a_dcomplex*>(v), ldv, iparam, ipntr,
reinterpret_cast<a_dcomplex*>(workd),
reinterpret_cast<a_dcomplex*>(workl), lworkl,
reinterpret_cast<a_dcomplex*>(rwork), &info);
rwork, &info);
}
} // namespace arpack
#endif
4 changes: 2 additions & 2 deletions PARPACK/SRC/MPI/icbpcn.F90
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ subroutine pcnaupd_c(comm, ido, bmat, n, which, nev, tol, resid, ncv, v, ldv,&
complex(kind=c_float_complex),dimension(3*n), intent(out) :: workd
complex(kind=c_float_complex),dimension(lworkl), intent(out) :: workl
integer(kind=i_int), value, intent(in) :: lworkl
complex(kind=c_float_complex),dimension(ncv), intent(out) :: rwork
real(kind=c_float), dimension(ncv), intent(out) :: rwork
integer(kind=i_int), intent(inout) :: info

character(len=2):: w
Expand Down Expand Up @@ -66,7 +66,7 @@ subroutine pcneupd_c(comm, rvec, howmny, select, d, z, ldz, sigma, workev,&
complex(kind=c_float_complex),dimension(3*n), intent(out) :: workd
complex(kind=c_float_complex),dimension(lworkl), intent(out) :: workl
integer(kind=i_int), value, intent(in) :: lworkl
complex(kind=c_float_complex),dimension(ncv), intent(out) :: rwork
real(kind=c_float), dimension(ncv), intent(out) :: rwork
integer(kind=i_int), intent(inout) :: info

! convert parameters if needed.
Expand Down
4 changes: 2 additions & 2 deletions PARPACK/SRC/MPI/icbpzn.F90
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ subroutine pznaupd_c(comm, ido, bmat, n, which, nev, tol, resid, ncv, v, ldv,&
complex(kind=c_double_complex), dimension(3*n), intent(out) :: workd
complex(kind=c_double_complex), dimension(lworkl), intent(out) :: workl
integer(kind=i_int), value, intent(in) :: lworkl
complex(kind=c_double_complex), dimension(ncv), intent(out) :: rwork
real(kind=c_double), dimension(ncv), intent(out) :: rwork
integer(kind=i_int), intent(inout) :: info

character(len=2):: w
Expand Down Expand Up @@ -66,7 +66,7 @@ subroutine pzneupd_c(comm, rvec, howmny, select, d, z, ldz, sigma, workev,&
complex(kind=c_double_complex), dimension(3*n), intent(out) :: workd
complex(kind=c_double_complex), dimension(lworkl), intent(out) :: workl
integer(kind=i_int), value, intent(in) :: lworkl
complex(kind=c_double_complex), dimension(ncv), intent(out) :: rwork
real(kind=c_double), dimension(ncv), intent(out) :: rwork
integer(kind=i_int), intent(inout) :: info

! convert parameters if needed.
Expand Down

0 comments on commit f36eb6c

Please sign in to comment.