Skip to content

Commit

Permalink
Fix C and C++ bindings for PARPACK
Browse files Browse the repository at this point in the history
  • Loading branch information
10110111 authored and sylvestre committed Jun 9, 2018
1 parent a50b68b commit 449dc71
Show file tree
Hide file tree
Showing 4 changed files with 114 additions and 253 deletions.
80 changes: 40 additions & 40 deletions PARPACK/SRC/MPI/icbpcn.f90
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,23 @@ subroutine pcnaupd_c(comm, ido, bmat, n, which, nev, tol, resid, ncv, v, ldv,&
bind(c, name="pcnaupd_c")
use :: iso_c_binding
implicit none
integer(kind=c_int), value, intent(in) :: comm
integer(kind=c_int), value, intent(in) :: comm
integer(kind=c_int), intent(inout) :: ido
character(kind=c_char), dimension(1), intent(in) :: bmat
integer(kind=c_int), value, intent(in) :: n
character(kind=c_char), dimension(2), intent(in) :: which
integer(kind=c_int), value, intent(in) :: nev
real(kind=c_float_complex), value, intent(in) :: tol
real(kind=c_float_complex), dimension(n), intent(inout) :: resid
integer(kind=c_int), value, intent(in) :: ncv
real(kind=c_float_complex), dimension(ldv, ncv), intent(out) :: v
integer(kind=c_int), value, intent(in) :: ldv
integer(kind=c_int), dimension(11), intent(inout) :: iparam
integer(kind=c_int), dimension(11), intent(out) :: ipntr
real(kind=c_float_complex), dimension(3*n), intent(out) :: workd
real(kind=c_float_complex), dimension(lworkl), intent(out) :: workl
integer(kind=c_int), value, intent(in) :: lworkl
real(kind=c_float_complex), dimension(ncv), intent(out) :: rwork
character(kind=c_char), dimension(1), intent(in) :: bmat
integer(kind=c_int), value, intent(in) :: n
character(kind=c_char), dimension(2), intent(in) :: which
integer(kind=c_int), value, intent(in) :: nev
real(kind=c_float), value, intent(in) :: tol
complex(kind=c_float_complex),dimension(n), intent(inout) :: resid
integer(kind=c_int), value, intent(in) :: ncv
complex(kind=c_float_complex),dimension(ldv, ncv),intent(out) :: v
integer(kind=c_int), value, intent(in) :: ldv
integer(kind=c_int), dimension(11), intent(inout) :: iparam
integer(kind=c_int), dimension(11), intent(out) :: ipntr
complex(kind=c_float_complex),dimension(3*n), intent(out) :: workd
complex(kind=c_float_complex),dimension(lworkl), intent(out) :: workl
integer(kind=c_int), value, intent(in) :: lworkl
complex(kind=c_float_complex),dimension(ncv), intent(out) :: rwork
integer(kind=c_int), intent(inout) :: info
call pcnaupd(comm, ido, bmat, n, which, nev, tol, resid, ncv, v, ldv,&
iparam, ipntr, workd, workl, lworkl, rwork, info)
Expand All @@ -33,30 +33,30 @@ subroutine pcneupd_c(comm, rvec, howmny, select, d, z, ldz, sigma, workev,&
bind(c, name="pcneupd_c")
use :: iso_c_binding
implicit none
integer(kind=c_int), value, intent(in) :: comm
logical(kind=c_bool), value, intent(in) :: rvec
character(kind=c_char), dimension(1), intent(in) :: howmny
logical(kind=c_bool), dimension(ncv), intent(in) :: select
real(kind=c_float_complex), dimension(nev), intent(out) :: d
real(kind=c_float_complex), dimension(n, nev), intent(out) :: z
integer(kind=c_int), value, intent(in) :: ldz
real(kind=c_float_complex), value, intent(in) :: sigma
real(kind=c_float_complex), dimension(2*ncv), intent(in) :: workev
character(kind=c_char), dimension(1), intent(in) :: bmat
integer(kind=c_int), value, intent(in) :: n
character(kind=c_char), dimension(2), intent(in) :: which
integer(kind=c_int), value, intent(in) :: nev
real(kind=c_float_complex), value, intent(in) :: tol
real(kind=c_float_complex), dimension(n), intent(inout) :: resid
integer(kind=c_int), value, intent(in) :: ncv
real(kind=c_float_complex), dimension(ldv, ncv), intent(out) :: v
integer(kind=c_int), value, intent(in) :: ldv
integer(kind=c_int), dimension(11), intent(inout) :: iparam
integer(kind=c_int), dimension(11), intent(out) :: ipntr
real(kind=c_float_complex), dimension(3*n), intent(out) :: workd
real(kind=c_float_complex), dimension(lworkl), intent(out) :: workl
integer(kind=c_int), value, intent(in) :: lworkl
real(kind=c_float_complex), dimension(ncv), intent(out) :: rwork
integer(kind=c_int), value, intent(in) :: comm
logical(kind=c_bool), value, intent(in) :: rvec
character(kind=c_char), dimension(1), intent(in) :: howmny
logical(kind=c_bool), dimension(ncv), intent(in) :: select
complex(kind=c_float_complex),dimension(nev), intent(out) :: d
complex(kind=c_float_complex),dimension(n, nev), intent(out) :: z
integer(kind=c_int), value, intent(in) :: ldz
complex(kind=c_float_complex),value, intent(in) :: sigma
complex(kind=c_float_complex),dimension(2*ncv), intent(out) :: workev
character(kind=c_char), dimension(1), intent(in) :: bmat
integer(kind=c_int), value, intent(in) :: n
character(kind=c_char), dimension(2), intent(in) :: which
integer(kind=c_int), value, intent(in) :: nev
real(kind=c_float), value, intent(in) :: tol
complex(kind=c_float_complex),dimension(n), intent(inout) :: resid
integer(kind=c_int), value, intent(in) :: ncv
complex(kind=c_float_complex),dimension(ldv, ncv),intent(out) :: v
integer(kind=c_int), value, intent(in) :: ldv
integer(kind=c_int), dimension(11), intent(inout) :: iparam
integer(kind=c_int), dimension(11), intent(out) :: ipntr
complex(kind=c_float_complex),dimension(3*n), intent(out) :: workd
complex(kind=c_float_complex),dimension(lworkl), intent(out) :: workl
integer(kind=c_int), value, intent(in) :: lworkl
complex(kind=c_float_complex),dimension(ncv), intent(out) :: rwork
integer(kind=c_int), intent(inout) :: info
call pcneupd(comm, rvec, howmny, select, d, z, ldz, sigma, workev,&
bmat, n, which, nev, tol, resid, ncv, v, ldv, &
Expand Down
86 changes: 43 additions & 43 deletions PARPACK/SRC/MPI/icbpzn.f90
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,24 @@ subroutine pznaupd_c(comm, ido, bmat, n, which, nev, tol, resid, ncv, v, ldv,&
bind(c, name="pznaupd_c")
use :: iso_c_binding
implicit none
integer(kind=c_int), value, intent(in) :: comm
integer(kind=c_int), intent(inout) :: ido
character(kind=c_char), dimension(1), intent(in) :: bmat
integer(kind=c_int), value, intent(in) :: n
character(kind=c_char), dimension(2), intent(in) :: which
integer(kind=c_int), value, intent(in) :: nev
real(kind=c_double_complex), value, intent(in) :: tol
real(kind=c_double_complex), dimension(n), intent(inout) :: resid
integer(kind=c_int), value, intent(in) :: ncv
real(kind=c_double_complex), dimension(ldv, ncv), intent(out) :: v
integer(kind=c_int), value, intent(in) :: ldv
integer(kind=c_int), dimension(11), intent(inout) :: iparam
integer(kind=c_int), dimension(11), intent(out) :: ipntr
real(kind=c_double_complex), dimension(3*n), intent(out) :: workd
real(kind=c_double_complex), dimension(lworkl), intent(out) :: workl
integer(kind=c_int), value, intent(in) :: lworkl
real(kind=c_double_complex), dimension(ncv), intent(out) :: rwork
integer(kind=c_int), intent(inout) :: info
integer(kind=c_int), value, intent(in) :: comm
integer(kind=c_int), intent(inout) :: ido
character(kind=c_char), dimension(1), intent(in) :: bmat
integer(kind=c_int), value, intent(in) :: n
character(kind=c_char), dimension(2), intent(in) :: which
integer(kind=c_int), value, intent(in) :: nev
real(kind=c_double), value, intent(in) :: tol
complex(kind=c_double_complex), dimension(n), intent(inout) :: resid
integer(kind=c_int), value, intent(in) :: ncv
complex(kind=c_double_complex), dimension(ldv, ncv),intent(out) :: v
integer(kind=c_int), value, intent(in) :: ldv
integer(kind=c_int), dimension(11), intent(inout) :: iparam
integer(kind=c_int), dimension(11), intent(out) :: ipntr
complex(kind=c_double_complex), dimension(3*n), intent(out) :: workd
complex(kind=c_double_complex), dimension(lworkl), intent(out) :: workl
integer(kind=c_int), value, intent(in) :: lworkl
complex(kind=c_double_complex), dimension(ncv), intent(out) :: rwork
integer(kind=c_int), intent(inout) :: info
call pznaupd(comm, ido, bmat, n, which, nev, tol, resid, ncv, v, ldv,&
iparam, ipntr, workd, workl, lworkl, rwork, info)
end subroutine pznaupd_c
Expand All @@ -33,31 +33,31 @@ subroutine pzneupd_c(comm, rvec, howmny, select, d, z, ldz, sigma, workev,&
bind(c, name="pzneupd_c")
use :: iso_c_binding
implicit none
integer(kind=c_int), value, intent(in) :: comm
logical(kind=c_bool), value, intent(in) :: rvec
character(kind=c_char), dimension(1), intent(in) :: howmny
logical(kind=c_bool), dimension(ncv), intent(in) :: select
real(kind=c_double_complex), dimension(nev), intent(out) :: d
real(kind=c_double_complex), dimension(n, nev), intent(out) :: z
integer(kind=c_int), value, intent(in) :: ldz
real(kind=c_double_complex), value, intent(in) :: sigma
real(kind=c_double_complex), dimension(2*ncv), intent(in) :: workev
character(kind=c_char), dimension(1), intent(in) :: bmat
integer(kind=c_int), value, intent(in) :: n
character(kind=c_char), dimension(2), intent(in) :: which
integer(kind=c_int), value, intent(in) :: nev
real(kind=c_double_complex), value, intent(in) :: tol
real(kind=c_double_complex), dimension(n), intent(inout) :: resid
integer(kind=c_int), value, intent(in) :: ncv
real(kind=c_double_complex), dimension(ldv, ncv), intent(out) :: v
integer(kind=c_int), value, intent(in) :: ldv
integer(kind=c_int), dimension(11), intent(inout) :: iparam
integer(kind=c_int), dimension(11), intent(out) :: ipntr
real(kind=c_double_complex), dimension(3*n), intent(out) :: workd
real(kind=c_double_complex), dimension(lworkl), intent(out) :: workl
integer(kind=c_int), value, intent(in) :: lworkl
real(kind=c_double_complex), dimension(ncv), intent(out) :: rwork
integer(kind=c_int), intent(inout) :: info
integer(kind=c_int), value, intent(in) :: comm
logical(kind=c_bool), value, intent(in) :: rvec
character(kind=c_char), dimension(1), intent(in) :: howmny
logical(kind=c_bool), dimension(ncv), intent(in) :: select
complex(kind=c_double_complex), dimension(nev), intent(out) :: d
complex(kind=c_double_complex), dimension(n, nev), intent(out) :: z
integer(kind=c_int), value, intent(in) :: ldz
complex(kind=c_double_complex), value, intent(in) :: sigma
complex(kind=c_double_complex), dimension(2*ncv), intent(out) :: workev
character(kind=c_char), dimension(1), intent(in) :: bmat
integer(kind=c_int), value, intent(in) :: n
character(kind=c_char), dimension(2), intent(in) :: which
integer(kind=c_int), value, intent(in) :: nev
real(kind=c_double), value, intent(in) :: tol
complex(kind=c_double_complex), dimension(n), intent(inout) :: resid
integer(kind=c_int), value, intent(in) :: ncv
complex(kind=c_double_complex), dimension(ldv, ncv),intent(out) :: v
integer(kind=c_int), value, intent(in) :: ldv
integer(kind=c_int), dimension(11), intent(inout) :: iparam
integer(kind=c_int), dimension(11), intent(out) :: ipntr
complex(kind=c_double_complex), dimension(3*n), intent(out) :: workd
complex(kind=c_double_complex), dimension(lworkl), intent(out) :: workl
integer(kind=c_int), value, intent(in) :: lworkl
complex(kind=c_double_complex), dimension(ncv), intent(out) :: rwork
integer(kind=c_int), intent(inout) :: info
call pzneupd(comm, rvec, howmny, select, d, z, ldz, sigma, workev,&
bmat, n, which, nev, tol, resid, ncv, v, ldv, &
iparam, ipntr, workd, workl, lworkl, rwork, info)
Expand Down
Loading

0 comments on commit 449dc71

Please sign in to comment.