psblas:
base/serial/Makefile base/serial/aux/camsr.f90 base/serial/aux/camsrx.f90 base/serial/aux/dmsr.f90 base/serial/aux/dmsrx.f90 base/serial/aux/imsr.f90 base/serial/aux/imsrx.f90 base/serial/aux/smsr.f90 base/serial/aux/smsrx.f90 base/serial/aux/zamsr.f90 base/serial/aux/zamsrx.f90 base/serial/dp/Makefile base/serial/dp/ccoco.f base/serial/dp/ccocr.f base/serial/dp/dcoco.f base/serial/dp/dcocr.f base/serial/dp/djdcox.f base/serial/dp/reordvn.f base/serial/dp/scoco.f base/serial/dp/scocr.f base/serial/dp/zcoco.f base/serial/dp/zcocr.f base/serial/psb_cfixcoo.f90 base/serial/psb_dfixcoo.f90 base/serial/psb_ip_reord_mod.f90 base/serial/psb_sfixcoo.f90 base/serial/psb_zfixcoo.f90 Defined a new module ip_reord to handle reordering based on a list-sort output; this will avoid future type mismatch, such as the one causing trouble in the final mld2p4 testing for complex single precision.psblas3-type-indexed
parent
7f2074779d
commit
866cf36165
@ -1,391 +0,0 @@
|
||||
C
|
||||
C Parallel Sparse BLAS version 2.2
|
||||
C (C) Copyright 2006/2007/2008
|
||||
C Salvatore Filippone University of Rome Tor Vergata
|
||||
C Alfredo Buttari University of Rome Tor Vergata
|
||||
C
|
||||
C Redistribution and use in source and binary forms, with or without
|
||||
C modification, are permitted provided that the following conditions
|
||||
C are met:
|
||||
C 1. Redistributions of source code must retain the above copyright
|
||||
C notice, this list of conditions and the following disclaimer.
|
||||
C 2. Redistributions in binary form must reproduce the above copyright
|
||||
C notice, this list of conditions, and the following disclaimer in the
|
||||
C documentation and/or other materials provided with the distribution.
|
||||
C 3. The name of the PSBLAS group or the names of its contributors may
|
||||
C not be used to endorse or promote products derived from this
|
||||
C software without specific written permission.
|
||||
C
|
||||
C THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
C ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
C TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
C PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PSBLAS GROUP OR ITS CONTRIBUTORS
|
||||
C BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
C CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
C SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
C INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
C CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
C ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
C POSSIBILITY OF SUCH DAMAGE.
|
||||
C
|
||||
C
|
||||
subroutine reordvn(nnz,ar,ia1,ia2,idx)
|
||||
use psb_const_mod
|
||||
integer nnz
|
||||
integer ia1(*),ia2(*),idx(0:*)
|
||||
real(psb_dpk_) ar(*)
|
||||
integer lp, kk, swapia1, swapia2, lswap
|
||||
real(psb_dpk_) swapar
|
||||
|
||||
LP = IDX(0)
|
||||
KK = 1
|
||||
500 CONTINUE
|
||||
IF ((LP.EQ.0).OR.(KK.GT.NNZ)) GOTO 800
|
||||
600 CONTINUE
|
||||
IF (LP.GE.KK) GOTO 700
|
||||
LP = IDX(LP)
|
||||
GOTO 600
|
||||
700 CONTINUE
|
||||
C ... Swap of vectors IA2, IA1, AR ...
|
||||
SWAPIA2 = IA2(KK)
|
||||
SWAPIA1 = IA1(KK)
|
||||
SWAPAR = AR(KK)
|
||||
IA2(KK) = IA2(LP)
|
||||
IA1(KK) = IA1(LP)
|
||||
AR(KK) = AR(LP)
|
||||
IA2(LP) = SWAPIA2
|
||||
IA1(LP) = SWAPIA1
|
||||
AR(LP) = SWAPAR
|
||||
LSWAP = IDX(LP)
|
||||
IDX(LP) = IDX(KK)
|
||||
IDX(KK) = LP
|
||||
LP = LSWAP
|
||||
KK = KK+1
|
||||
GOTO 500
|
||||
800 CONTINUE
|
||||
return
|
||||
end
|
||||
subroutine sreordvn(nnz,ar,ia1,ia2,idx)
|
||||
use psb_const_mod
|
||||
integer nnz
|
||||
integer ia1(*),ia2(*),idx(0:*)
|
||||
real(psb_spk_) ar(*)
|
||||
integer lp, kk, swapia1, swapia2, lswap
|
||||
real(psb_spk_) swapar
|
||||
|
||||
LP = IDX(0)
|
||||
KK = 1
|
||||
500 CONTINUE
|
||||
IF ((LP.EQ.0).OR.(KK.GT.NNZ)) GOTO 800
|
||||
600 CONTINUE
|
||||
IF (LP.GE.KK) GOTO 700
|
||||
LP = IDX(LP)
|
||||
GOTO 600
|
||||
700 CONTINUE
|
||||
C ... Swap of vectors IA2, IA1, AR ...
|
||||
SWAPIA2 = IA2(KK)
|
||||
SWAPIA1 = IA1(KK)
|
||||
SWAPAR = AR(KK)
|
||||
IA2(KK) = IA2(LP)
|
||||
IA1(KK) = IA1(LP)
|
||||
AR(KK) = AR(LP)
|
||||
IA2(LP) = SWAPIA2
|
||||
IA1(LP) = SWAPIA1
|
||||
AR(LP) = SWAPAR
|
||||
LSWAP = IDX(LP)
|
||||
IDX(LP) = IDX(KK)
|
||||
IDX(KK) = LP
|
||||
LP = LSWAP
|
||||
KK = KK+1
|
||||
GOTO 500
|
||||
800 CONTINUE
|
||||
return
|
||||
end
|
||||
subroutine ireordv2(nnz,ia1,ia2,idx)
|
||||
use psb_const_mod
|
||||
integer nnz
|
||||
integer ia1(*),ia2(*),idx(0:*)
|
||||
integer lp, kk, swapia1, swapia2, lswap
|
||||
|
||||
LP = IDX(0)
|
||||
KK = 1
|
||||
500 CONTINUE
|
||||
IF ((LP.EQ.0).OR.(KK.GT.NNZ)) GOTO 800
|
||||
600 CONTINUE
|
||||
IF (LP.GE.KK) GOTO 700
|
||||
LP = IDX(LP)
|
||||
GOTO 600
|
||||
700 CONTINUE
|
||||
C ... Swap of vectors IA2, IA1 ..
|
||||
SWAPIA2 = IA2(KK)
|
||||
SWAPIA1 = IA1(KK)
|
||||
IA2(KK) = IA2(LP)
|
||||
IA1(KK) = IA1(LP)
|
||||
IA2(LP) = SWAPIA2
|
||||
IA1(LP) = SWAPIA1
|
||||
LSWAP = IDX(LP)
|
||||
IDX(LP) = IDX(KK)
|
||||
IDX(KK) = LP
|
||||
LP = LSWAP
|
||||
KK = KK+1
|
||||
GOTO 500
|
||||
800 CONTINUE
|
||||
return
|
||||
end
|
||||
subroutine ireordv1(nnz,ia1,idx)
|
||||
use psb_const_mod
|
||||
integer nnz
|
||||
integer ia1(*),idx(0:*)
|
||||
integer lp, kk, swapia1, lswap
|
||||
|
||||
LP = IDX(0)
|
||||
KK = 1
|
||||
500 CONTINUE
|
||||
IF ((LP.EQ.0).OR.(KK.GT.NNZ)) GOTO 800
|
||||
600 CONTINUE
|
||||
IF (LP.GE.KK) GOTO 700
|
||||
LP = IDX(LP)
|
||||
GOTO 600
|
||||
700 CONTINUE
|
||||
C ... Swap of vectors IA2, IA1, AR ...
|
||||
SWAPIA1 = IA1(KK)
|
||||
IA1(KK) = IA1(LP)
|
||||
IA1(LP) = SWAPIA1
|
||||
LSWAP = IDX(LP)
|
||||
IDX(LP) = IDX(KK)
|
||||
IDX(KK) = LP
|
||||
LP = LSWAP
|
||||
KK = KK+1
|
||||
GOTO 500
|
||||
800 CONTINUE
|
||||
return
|
||||
end
|
||||
subroutine sreordvn3(nnz,ar,ia1,ia2,ia3,idx)
|
||||
use psb_const_mod
|
||||
integer nnz
|
||||
integer ia1(*),ia2(*),ia3(*),idx(0:*)
|
||||
real(psb_spk_) ar(*)
|
||||
integer lp, kk, swapia1, swapia2, swapia3,lswap
|
||||
real(psb_spk_) swapar
|
||||
|
||||
LP = IDX(0)
|
||||
KK = 1
|
||||
500 CONTINUE
|
||||
IF ((LP.EQ.0).OR.(KK.GT.NNZ)) GOTO 800
|
||||
600 CONTINUE
|
||||
IF (LP.GE.KK) GOTO 700
|
||||
LP = IDX(LP)
|
||||
GOTO 600
|
||||
700 CONTINUE
|
||||
C ... Swap of vectors IA2, IA1, AR ...
|
||||
SWAPIA3 = IA3(KK)
|
||||
SWAPIA2 = IA2(KK)
|
||||
SWAPIA1 = IA1(KK)
|
||||
SWAPAR = AR(KK)
|
||||
IA3(KK) = IA3(LP)
|
||||
IA2(KK) = IA2(LP)
|
||||
IA1(KK) = IA1(LP)
|
||||
AR(KK) = AR(LP)
|
||||
IA3(LP) = SWAPIA3
|
||||
IA2(LP) = SWAPIA2
|
||||
IA1(LP) = SWAPIA1
|
||||
AR(LP) = SWAPAR
|
||||
LSWAP = IDX(LP)
|
||||
IDX(LP) = IDX(KK)
|
||||
IDX(KK) = LP
|
||||
LP = LSWAP
|
||||
KK = KK+1
|
||||
GOTO 500
|
||||
800 CONTINUE
|
||||
return
|
||||
end
|
||||
subroutine reordvn3(nnz,ar,ia1,ia2,ia3,idx)
|
||||
use psb_const_mod
|
||||
integer nnz
|
||||
integer ia1(*),ia2(*),ia3(*),idx(0:*)
|
||||
real(psb_dpk_) ar(*)
|
||||
integer lp, kk, swapia1, swapia2, swapia3,lswap
|
||||
real(psb_dpk_) swapar
|
||||
|
||||
LP = IDX(0)
|
||||
KK = 1
|
||||
500 CONTINUE
|
||||
IF ((LP.EQ.0).OR.(KK.GT.NNZ)) GOTO 800
|
||||
600 CONTINUE
|
||||
IF (LP.GE.KK) GOTO 700
|
||||
LP = IDX(LP)
|
||||
GOTO 600
|
||||
700 CONTINUE
|
||||
C ... Swap of vectors IA2, IA1, AR ...
|
||||
SWAPIA3 = IA3(KK)
|
||||
SWAPIA2 = IA2(KK)
|
||||
SWAPIA1 = IA1(KK)
|
||||
SWAPAR = AR(KK)
|
||||
IA3(KK) = IA3(LP)
|
||||
IA2(KK) = IA2(LP)
|
||||
IA1(KK) = IA1(LP)
|
||||
AR(KK) = AR(LP)
|
||||
IA3(LP) = SWAPIA3
|
||||
IA2(LP) = SWAPIA2
|
||||
IA1(LP) = SWAPIA1
|
||||
AR(LP) = SWAPAR
|
||||
LSWAP = IDX(LP)
|
||||
IDX(LP) = IDX(KK)
|
||||
IDX(KK) = LP
|
||||
LP = LSWAP
|
||||
KK = KK+1
|
||||
GOTO 500
|
||||
800 CONTINUE
|
||||
return
|
||||
end
|
||||
subroutine creordvn(nnz,ar,ia1,ia2,idx)
|
||||
use psb_const_mod
|
||||
integer nnz
|
||||
integer ia1(*),ia2(*),idx(0:*)
|
||||
complex(psb_spk_) ar(*)
|
||||
integer lp, kk, swapia1, swapia2, lswap
|
||||
complex(psb_spk_) swapar
|
||||
|
||||
LP = IDX(0)
|
||||
KK = 1
|
||||
500 CONTINUE
|
||||
IF ((LP.EQ.0).OR.(KK.GT.NNZ)) GOTO 800
|
||||
600 CONTINUE
|
||||
IF (LP.GE.KK) GOTO 700
|
||||
LP = IDX(LP)
|
||||
GOTO 600
|
||||
700 CONTINUE
|
||||
C ... Swap of vectors IA2, IA1, AR ...
|
||||
SWAPIA2 = IA2(KK)
|
||||
SWAPIA1 = IA1(KK)
|
||||
SWAPAR = AR(KK)
|
||||
IA2(KK) = IA2(LP)
|
||||
IA1(KK) = IA1(LP)
|
||||
AR(KK) = AR(LP)
|
||||
IA2(LP) = SWAPIA2
|
||||
IA1(LP) = SWAPIA1
|
||||
AR(LP) = SWAPAR
|
||||
LSWAP = IDX(LP)
|
||||
IDX(LP) = IDX(KK)
|
||||
IDX(KK) = LP
|
||||
LP = LSWAP
|
||||
KK = KK+1
|
||||
GOTO 500
|
||||
800 CONTINUE
|
||||
return
|
||||
end
|
||||
subroutine creordvn3(nnz,ar,ia1,ia2,ia3,idx)
|
||||
use psb_const_mod
|
||||
integer nnz
|
||||
integer ia1(*),ia2(*),ia3(*),idx(0:*)
|
||||
complex(psb_spk_) ar(*)
|
||||
integer lp, kk, swapia1, swapia2, swapia3,lswap
|
||||
complex(psb_spk_) swapar
|
||||
|
||||
LP = IDX(0)
|
||||
KK = 1
|
||||
500 CONTINUE
|
||||
IF ((LP.EQ.0).OR.(KK.GT.NNZ)) GOTO 800
|
||||
600 CONTINUE
|
||||
IF (LP.GE.KK) GOTO 700
|
||||
LP = IDX(LP)
|
||||
GOTO 600
|
||||
700 CONTINUE
|
||||
C ... Swap of vectors IA2, IA1, AR ...
|
||||
SWAPIA3 = IA3(KK)
|
||||
SWAPIA2 = IA2(KK)
|
||||
SWAPIA1 = IA1(KK)
|
||||
SWAPAR = AR(KK)
|
||||
IA3(KK) = IA3(LP)
|
||||
IA2(KK) = IA2(LP)
|
||||
IA1(KK) = IA1(LP)
|
||||
AR(KK) = AR(LP)
|
||||
IA3(LP) = SWAPIA3
|
||||
IA2(LP) = SWAPIA2
|
||||
IA1(LP) = SWAPIA1
|
||||
AR(LP) = SWAPAR
|
||||
LSWAP = IDX(LP)
|
||||
IDX(LP) = IDX(KK)
|
||||
IDX(KK) = LP
|
||||
LP = LSWAP
|
||||
KK = KK+1
|
||||
GOTO 500
|
||||
800 CONTINUE
|
||||
return
|
||||
end
|
||||
subroutine zreordvn(nnz,ar,ia1,ia2,idx)
|
||||
use psb_const_mod
|
||||
integer nnz
|
||||
integer ia1(*),ia2(*),idx(0:*)
|
||||
complex(psb_dpk_) ar(*)
|
||||
integer lp, kk, swapia1, swapia2, lswap
|
||||
complex(psb_dpk_) swapar
|
||||
|
||||
LP = IDX(0)
|
||||
KK = 1
|
||||
500 CONTINUE
|
||||
IF ((LP.EQ.0).OR.(KK.GT.NNZ)) GOTO 800
|
||||
600 CONTINUE
|
||||
IF (LP.GE.KK) GOTO 700
|
||||
LP = IDX(LP)
|
||||
GOTO 600
|
||||
700 CONTINUE
|
||||
C ... Swap of vectors IA2, IA1, AR ...
|
||||
SWAPIA2 = IA2(KK)
|
||||
SWAPIA1 = IA1(KK)
|
||||
SWAPAR = AR(KK)
|
||||
IA2(KK) = IA2(LP)
|
||||
IA1(KK) = IA1(LP)
|
||||
AR(KK) = AR(LP)
|
||||
IA2(LP) = SWAPIA2
|
||||
IA1(LP) = SWAPIA1
|
||||
AR(LP) = SWAPAR
|
||||
LSWAP = IDX(LP)
|
||||
IDX(LP) = IDX(KK)
|
||||
IDX(KK) = LP
|
||||
LP = LSWAP
|
||||
KK = KK+1
|
||||
GOTO 500
|
||||
800 CONTINUE
|
||||
return
|
||||
end
|
||||
subroutine zreordvn3(nnz,ar,ia1,ia2,ia3,idx)
|
||||
use psb_const_mod
|
||||
integer nnz
|
||||
integer ia1(*),ia2(*),ia3(*),idx(0:*)
|
||||
complex(psb_dpk_) ar(*)
|
||||
integer lp, kk, swapia1, swapia2, swapia3,lswap
|
||||
complex(psb_dpk_) swapar
|
||||
|
||||
LP = IDX(0)
|
||||
KK = 1
|
||||
500 CONTINUE
|
||||
IF ((LP.EQ.0).OR.(KK.GT.NNZ)) GOTO 800
|
||||
600 CONTINUE
|
||||
IF (LP.GE.KK) GOTO 700
|
||||
LP = IDX(LP)
|
||||
GOTO 600
|
||||
700 CONTINUE
|
||||
C ... Swap of vectors IA2, IA1, AR ...
|
||||
SWAPIA3 = IA3(KK)
|
||||
SWAPIA2 = IA2(KK)
|
||||
SWAPIA1 = IA1(KK)
|
||||
SWAPAR = AR(KK)
|
||||
IA3(KK) = IA3(LP)
|
||||
IA2(KK) = IA2(LP)
|
||||
IA1(KK) = IA1(LP)
|
||||
AR(KK) = AR(LP)
|
||||
IA3(LP) = SWAPIA3
|
||||
IA2(LP) = SWAPIA2
|
||||
IA1(LP) = SWAPIA1
|
||||
AR(LP) = SWAPAR
|
||||
LSWAP = IDX(LP)
|
||||
IDX(LP) = IDX(KK)
|
||||
IDX(KK) = LP
|
||||
LP = LSWAP
|
||||
KK = KK+1
|
||||
GOTO 500
|
||||
800 CONTINUE
|
||||
return
|
||||
end
|
||||
|
@ -0,0 +1,670 @@
|
||||
!!$
|
||||
!!$ Parallel Sparse BLAS version 2.2
|
||||
!!$ (C) Copyright 2006/2007/2008
|
||||
!!$ Salvatore Filippone University of Rome Tor Vergata
|
||||
!!$ Alfredo Buttari University of Rome Tor Vergata
|
||||
!!$
|
||||
!!$ Redistribution and use in source and binary forms, with or without
|
||||
!!$ modification, are permitted provided that the following conditions
|
||||
!!$ are met:
|
||||
!!$ 1. Redistributions of source code must retain the above copyright
|
||||
!!$ notice, this list of conditions and the following disclaimer.
|
||||
!!$ 2. Redistributions in binary form must reproduce the above copyright
|
||||
!!$ notice, this list of conditions, and the following disclaimer in the
|
||||
!!$ documentation and/or other materials provided with the distribution.
|
||||
!!$ 3. The name of the PSBLAS group or the names of its contributors may
|
||||
!!$ not be used to endorse or promote products derived from this
|
||||
!!$ software without specific written permission.
|
||||
!!$
|
||||
!!$ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
!!$ ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
!!$ TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
!!$ PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PSBLAS GROUP OR ITS CONTRIBUTORS
|
||||
!!$ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
!!$ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
!!$ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
!!$ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
!!$ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
!!$ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
!!$ POSSIBILITY OF SUCH DAMAGE.
|
||||
!!$
|
||||
!!$
|
||||
!
|
||||
! Reorder (an) input vector(s) based on a list sort output.
|
||||
! Based on: D. E. Knuth: The Art of Computer Programming
|
||||
! vol. 3: Sorting and Searching, Addison Wesley, 1973
|
||||
! ex. 5.2.12
|
||||
!
|
||||
!
|
||||
module psb_ip_reord_mod
|
||||
use psb_const_mod
|
||||
|
||||
interface psb_ip_reord
|
||||
module procedure psb_ip_reord_i1,&
|
||||
& psb_ip_reord_s1, psb_ip_reord_d1,&
|
||||
& psb_ip_reord_c1, psb_ip_reord_z1,&
|
||||
& psb_ip_reord_i1i1,&
|
||||
& psb_ip_reord_s1i1, psb_ip_reord_d1i1,&
|
||||
& psb_ip_reord_c1i1, psb_ip_reord_z1i1,&
|
||||
& psb_ip_reord_s1i2, psb_ip_reord_d1i2,&
|
||||
& psb_ip_reord_c1i2, psb_ip_reord_z1i2,&
|
||||
& psb_ip_reord_s1i3, psb_ip_reord_d1i3,&
|
||||
& psb_ip_reord_c1i3, psb_ip_reord_z1i3
|
||||
|
||||
|
||||
end interface
|
||||
|
||||
contains
|
||||
|
||||
subroutine psb_ip_reord_i1(n,x,iaux)
|
||||
integer, intent(in) :: n
|
||||
integer :: iaux(0:*)
|
||||
integer :: x(*)
|
||||
|
||||
integer :: lswap, lp, k
|
||||
integer :: swap
|
||||
|
||||
lp = iaux(0)
|
||||
k = 1
|
||||
do
|
||||
if ((lp==0).or.(k>n)) exit
|
||||
do
|
||||
if (lp >= k) exit
|
||||
lp = iaux(lp)
|
||||
end do
|
||||
swap = x(lp)
|
||||
x(lp) = x(k)
|
||||
x(k) = swap
|
||||
lswap = iaux(lp)
|
||||
iaux(lp) = iaux(k)
|
||||
iaux(k) = lp
|
||||
lp = lswap
|
||||
k = k + 1
|
||||
enddo
|
||||
return
|
||||
end subroutine psb_ip_reord_i1
|
||||
|
||||
|
||||
subroutine psb_ip_reord_s1(n,x,iaux)
|
||||
integer, intent(in) :: n
|
||||
integer :: iaux(0:*)
|
||||
real(psb_spk_) :: x(*)
|
||||
|
||||
integer :: lswap, lp, k
|
||||
real(psb_spk_) :: swap
|
||||
|
||||
lp = iaux(0)
|
||||
k = 1
|
||||
do
|
||||
if ((lp==0).or.(k>n)) exit
|
||||
do
|
||||
if (lp >= k) exit
|
||||
lp = iaux(lp)
|
||||
end do
|
||||
swap = x(lp)
|
||||
x(lp) = x(k)
|
||||
x(k) = swap
|
||||
lswap = iaux(lp)
|
||||
iaux(lp) = iaux(k)
|
||||
iaux(k) = lp
|
||||
lp = lswap
|
||||
k = k + 1
|
||||
enddo
|
||||
return
|
||||
end subroutine psb_ip_reord_s1
|
||||
|
||||
subroutine psb_ip_reord_d1(n,x,iaux)
|
||||
integer, intent(in) :: n
|
||||
integer :: iaux(0:*)
|
||||
real(psb_dpk_) :: x(*)
|
||||
|
||||
integer :: lswap, lp, k
|
||||
real(psb_dpk_) :: swap
|
||||
|
||||
lp = iaux(0)
|
||||
k = 1
|
||||
do
|
||||
if ((lp==0).or.(k>n)) exit
|
||||
do
|
||||
if (lp >= k) exit
|
||||
lp = iaux(lp)
|
||||
end do
|
||||
swap = x(lp)
|
||||
x(lp) = x(k)
|
||||
x(k) = swap
|
||||
lswap = iaux(lp)
|
||||
iaux(lp) = iaux(k)
|
||||
iaux(k) = lp
|
||||
lp = lswap
|
||||
k = k + 1
|
||||
enddo
|
||||
return
|
||||
end subroutine psb_ip_reord_d1
|
||||
|
||||
|
||||
|
||||
subroutine psb_ip_reord_c1(n,x,iaux)
|
||||
integer, intent(in) :: n
|
||||
integer :: iaux(0:*)
|
||||
complex(psb_spk_) :: x(*)
|
||||
|
||||
integer :: lswap, lp, k
|
||||
complex(psb_spk_) :: swap
|
||||
|
||||
lp = iaux(0)
|
||||
k = 1
|
||||
do
|
||||
if ((lp==0).or.(k>n)) exit
|
||||
do
|
||||
if (lp >= k) exit
|
||||
lp = iaux(lp)
|
||||
end do
|
||||
swap = x(lp)
|
||||
x(lp) = x(k)
|
||||
x(k) = swap
|
||||
lswap = iaux(lp)
|
||||
iaux(lp) = iaux(k)
|
||||
iaux(k) = lp
|
||||
lp = lswap
|
||||
k = k + 1
|
||||
enddo
|
||||
return
|
||||
end subroutine psb_ip_reord_c1
|
||||
|
||||
subroutine psb_ip_reord_z1(n,x,iaux)
|
||||
integer, intent(in) :: n
|
||||
integer :: iaux(0:*)
|
||||
complex(psb_dpk_) :: x(*)
|
||||
|
||||
integer :: lswap, lp, k
|
||||
complex(psb_dpk_) :: swap
|
||||
|
||||
lp = iaux(0)
|
||||
k = 1
|
||||
do
|
||||
if ((lp==0).or.(k>n)) exit
|
||||
do
|
||||
if (lp >= k) exit
|
||||
lp = iaux(lp)
|
||||
end do
|
||||
swap = x(lp)
|
||||
x(lp) = x(k)
|
||||
x(k) = swap
|
||||
lswap = iaux(lp)
|
||||
iaux(lp) = iaux(k)
|
||||
iaux(k) = lp
|
||||
lp = lswap
|
||||
k = k + 1
|
||||
enddo
|
||||
return
|
||||
end subroutine psb_ip_reord_z1
|
||||
|
||||
|
||||
subroutine psb_ip_reord_i1i1(n,x,indx,iaux)
|
||||
integer, intent(in) :: n
|
||||
integer :: iaux(0:*)
|
||||
integer :: x(*)
|
||||
integer :: indx(*)
|
||||
|
||||
integer :: lswap, lp, k, ixswap
|
||||
integer :: swap
|
||||
|
||||
lp = iaux(0)
|
||||
k = 1
|
||||
do
|
||||
if ((lp==0).or.(k>n)) exit
|
||||
do
|
||||
if (lp >= k) exit
|
||||
lp = iaux(lp)
|
||||
end do
|
||||
swap = x(lp)
|
||||
x(lp) = x(k)
|
||||
x(k) = swap
|
||||
ixswap = indx(lp)
|
||||
indx(lp) = indx(k)
|
||||
indx(k) = ixswap
|
||||
lswap = iaux(lp)
|
||||
iaux(lp) = iaux(k)
|
||||
iaux(k) = lp
|
||||
lp = lswap
|
||||
k = k + 1
|
||||
enddo
|
||||
return
|
||||
end subroutine psb_ip_reord_i1i1
|
||||
|
||||
|
||||
subroutine psb_ip_reord_s1i1(n,x,indx,iaux)
|
||||
integer, intent(in) :: n
|
||||
integer :: iaux(0:*)
|
||||
real(psb_spk_) :: x(*)
|
||||
integer :: indx(*)
|
||||
|
||||
|
||||
integer :: lswap, lp, k, ixswap
|
||||
real(psb_spk_) :: swap
|
||||
|
||||
lp = iaux(0)
|
||||
k = 1
|
||||
do
|
||||
if ((lp==0).or.(k>n)) exit
|
||||
do
|
||||
if (lp >= k) exit
|
||||
lp = iaux(lp)
|
||||
end do
|
||||
swap = x(lp)
|
||||
x(lp) = x(k)
|
||||
x(k) = swap
|
||||
ixswap = indx(lp)
|
||||
indx(lp) = indx(k)
|
||||
indx(k) = ixswap
|
||||
lswap = iaux(lp)
|
||||
iaux(lp) = iaux(k)
|
||||
iaux(k) = lp
|
||||
lp = lswap
|
||||
k = k + 1
|
||||
enddo
|
||||
return
|
||||
end subroutine psb_ip_reord_s1i1
|
||||
|
||||
subroutine psb_ip_reord_d1i1(n,x,indx,iaux)
|
||||
integer, intent(in) :: n
|
||||
integer :: iaux(0:*)
|
||||
real(psb_dpk_) :: x(*)
|
||||
integer :: indx(*)
|
||||
|
||||
integer :: lswap, lp, k, ixswap
|
||||
real(psb_dpk_) :: swap
|
||||
|
||||
lp = iaux(0)
|
||||
k = 1
|
||||
do
|
||||
if ((lp==0).or.(k>n)) exit
|
||||
do
|
||||
if (lp >= k) exit
|
||||
lp = iaux(lp)
|
||||
end do
|
||||
swap = x(lp)
|
||||
x(lp) = x(k)
|
||||
x(k) = swap
|
||||
ixswap = indx(lp)
|
||||
indx(lp) = indx(k)
|
||||
indx(k) = ixswap
|
||||
lswap = iaux(lp)
|
||||
iaux(lp) = iaux(k)
|
||||
iaux(k) = lp
|
||||
lp = lswap
|
||||
k = k + 1
|
||||
enddo
|
||||
return
|
||||
end subroutine psb_ip_reord_d1i1
|
||||
|
||||
|
||||
|
||||
subroutine psb_ip_reord_c1i1(n,x,indx,iaux)
|
||||
integer, intent(in) :: n
|
||||
integer :: iaux(0:*)
|
||||
complex(psb_spk_) :: x(*)
|
||||
integer :: indx(*)
|
||||
|
||||
integer :: lswap, lp, k, ixswap
|
||||
complex(psb_spk_) :: swap
|
||||
|
||||
lp = iaux(0)
|
||||
k = 1
|
||||
do
|
||||
if ((lp==0).or.(k>n)) exit
|
||||
do
|
||||
if (lp >= k) exit
|
||||
lp = iaux(lp)
|
||||
end do
|
||||
swap = x(lp)
|
||||
x(lp) = x(k)
|
||||
x(k) = swap
|
||||
ixswap = indx(lp)
|
||||
indx(lp) = indx(k)
|
||||
indx(k) = ixswap
|
||||
lswap = iaux(lp)
|
||||
iaux(lp) = iaux(k)
|
||||
iaux(k) = lp
|
||||
lp = lswap
|
||||
k = k + 1
|
||||
enddo
|
||||
return
|
||||
end subroutine psb_ip_reord_c1i1
|
||||
|
||||
subroutine psb_ip_reord_z1i1(n,x,indx,iaux)
|
||||
integer, intent(in) :: n
|
||||
integer :: iaux(0:*)
|
||||
complex(psb_dpk_) :: x(*)
|
||||
integer :: indx(*)
|
||||
|
||||
integer :: lswap, lp, k, ixswap
|
||||
complex(psb_dpk_) :: swap
|
||||
|
||||
lp = iaux(0)
|
||||
k = 1
|
||||
do
|
||||
if ((lp==0).or.(k>n)) exit
|
||||
do
|
||||
if (lp >= k) exit
|
||||
lp = iaux(lp)
|
||||
end do
|
||||
swap = x(lp)
|
||||
x(lp) = x(k)
|
||||
x(k) = swap
|
||||
ixswap = indx(lp)
|
||||
indx(lp) = indx(k)
|
||||
indx(k) = ixswap
|
||||
lswap = iaux(lp)
|
||||
iaux(lp) = iaux(k)
|
||||
iaux(k) = lp
|
||||
lp = lswap
|
||||
k = k + 1
|
||||
enddo
|
||||
return
|
||||
end subroutine psb_ip_reord_z1i1
|
||||
|
||||
|
||||
subroutine psb_ip_reord_s1i2(n,x,i1,i2,iaux)
|
||||
integer, intent(in) :: n
|
||||
integer :: iaux(0:*)
|
||||
real(psb_spk_) :: x(*)
|
||||
integer :: i1(*), i2(*)
|
||||
|
||||
|
||||
integer :: lswap, lp, k, isw1, isw2
|
||||
real(psb_spk_) :: swap
|
||||
|
||||
lp = iaux(0)
|
||||
k = 1
|
||||
do
|
||||
if ((lp==0).or.(k>n)) exit
|
||||
do
|
||||
if (lp >= k) exit
|
||||
lp = iaux(lp)
|
||||
end do
|
||||
swap = x(lp)
|
||||
x(lp) = x(k)
|
||||
x(k) = swap
|
||||
isw1 = i1(lp)
|
||||
i1(lp) = i1(k)
|
||||
i1(k) = isw1
|
||||
isw2 = i2(lp)
|
||||
i2(lp) = i2(k)
|
||||
i2(k) = isw2
|
||||
lswap = iaux(lp)
|
||||
iaux(lp) = iaux(k)
|
||||
iaux(k) = lp
|
||||
lp = lswap
|
||||
k = k + 1
|
||||
enddo
|
||||
return
|
||||
end subroutine psb_ip_reord_s1i2
|
||||
|
||||
subroutine psb_ip_reord_d1i2(n,x,i1,i2,iaux)
|
||||
integer, intent(in) :: n
|
||||
integer :: iaux(0:*)
|
||||
real(psb_dpk_) :: x(*)
|
||||
integer :: i1(*), i2(*)
|
||||
|
||||
|
||||
integer :: lswap, lp, k, isw1, isw2
|
||||
real(psb_dpk_) :: swap
|
||||
|
||||
lp = iaux(0)
|
||||
k = 1
|
||||
do
|
||||
if ((lp==0).or.(k>n)) exit
|
||||
do
|
||||
if (lp >= k) exit
|
||||
lp = iaux(lp)
|
||||
end do
|
||||
swap = x(lp)
|
||||
x(lp) = x(k)
|
||||
x(k) = swap
|
||||
isw1 = i1(lp)
|
||||
i1(lp) = i1(k)
|
||||
i1(k) = isw1
|
||||
isw2 = i2(lp)
|
||||
i2(lp) = i2(k)
|
||||
i2(k) = isw2
|
||||
lswap = iaux(lp)
|
||||
iaux(lp) = iaux(k)
|
||||
iaux(k) = lp
|
||||
lp = lswap
|
||||
k = k + 1
|
||||
enddo
|
||||
return
|
||||
end subroutine psb_ip_reord_d1i2
|
||||
|
||||
subroutine psb_ip_reord_c1i2(n,x,i1,i2,iaux)
|
||||
integer, intent(in) :: n
|
||||
integer :: iaux(0:*)
|
||||
complex(psb_spk_) :: x(*)
|
||||
integer :: i1(*), i2(*)
|
||||
|
||||
|
||||
integer :: lswap, lp, k, isw1, isw2
|
||||
complex(psb_spk_) :: swap
|
||||
|
||||
lp = iaux(0)
|
||||
k = 1
|
||||
do
|
||||
if ((lp==0).or.(k>n)) exit
|
||||
do
|
||||
if (lp >= k) exit
|
||||
lp = iaux(lp)
|
||||
end do
|
||||
swap = x(lp)
|
||||
x(lp) = x(k)
|
||||
x(k) = swap
|
||||
isw1 = i1(lp)
|
||||
i1(lp) = i1(k)
|
||||
i1(k) = isw1
|
||||
isw2 = i2(lp)
|
||||
i2(lp) = i2(k)
|
||||
i2(k) = isw2
|
||||
lswap = iaux(lp)
|
||||
iaux(lp) = iaux(k)
|
||||
iaux(k) = lp
|
||||
lp = lswap
|
||||
k = k + 1
|
||||
enddo
|
||||
return
|
||||
end subroutine psb_ip_reord_c1i2
|
||||
|
||||
subroutine psb_ip_reord_z1i2(n,x,i1,i2,iaux)
|
||||
integer, intent(in) :: n
|
||||
integer :: iaux(0:*)
|
||||
complex(psb_dpk_) :: x(*)
|
||||
integer :: i1(*), i2(*)
|
||||
|
||||
|
||||
integer :: lswap, lp, k, isw1, isw2
|
||||
complex(psb_dpk_) :: swap
|
||||
|
||||
lp = iaux(0)
|
||||
k = 1
|
||||
do
|
||||
if ((lp==0).or.(k>n)) exit
|
||||
do
|
||||
if (lp >= k) exit
|
||||
lp = iaux(lp)
|
||||
end do
|
||||
swap = x(lp)
|
||||
x(lp) = x(k)
|
||||
x(k) = swap
|
||||
isw1 = i1(lp)
|
||||
i1(lp) = i1(k)
|
||||
i1(k) = isw1
|
||||
isw2 = i2(lp)
|
||||
i2(lp) = i2(k)
|
||||
i2(k) = isw2
|
||||
lswap = iaux(lp)
|
||||
iaux(lp) = iaux(k)
|
||||
iaux(k) = lp
|
||||
lp = lswap
|
||||
k = k + 1
|
||||
enddo
|
||||
return
|
||||
end subroutine psb_ip_reord_z1i2
|
||||
|
||||
|
||||
subroutine psb_ip_reord_s1i3(n,x,i1,i2,i3,iaux)
|
||||
integer, intent(in) :: n
|
||||
integer :: iaux(0:*)
|
||||
real(psb_spk_) :: x(*)
|
||||
integer :: i1(*), i2(*), i3(*)
|
||||
|
||||
|
||||
integer :: lswap, lp, k, isw1, isw2, isw3
|
||||
real(psb_spk_) :: swap
|
||||
|
||||
lp = iaux(0)
|
||||
k = 1
|
||||
do
|
||||
if ((lp==0).or.(k>n)) exit
|
||||
do
|
||||
if (lp >= k) exit
|
||||
lp = iaux(lp)
|
||||
end do
|
||||
swap = x(lp)
|
||||
x(lp) = x(k)
|
||||
x(k) = swap
|
||||
isw1 = i1(lp)
|
||||
i1(lp) = i1(k)
|
||||
i1(k) = isw1
|
||||
isw2 = i2(lp)
|
||||
i2(lp) = i2(k)
|
||||
i2(k) = isw2
|
||||
isw3 = i3(lp)
|
||||
i3(lp) = i3(k)
|
||||
i3(k) = isw3
|
||||
lswap = iaux(lp)
|
||||
iaux(lp) = iaux(k)
|
||||
iaux(k) = lp
|
||||
lp = lswap
|
||||
k = k + 1
|
||||
enddo
|
||||
return
|
||||
end subroutine psb_ip_reord_s1i3
|
||||
|
||||
subroutine psb_ip_reord_d1i3(n,x,i1,i2,i3,iaux)
|
||||
integer, intent(in) :: n
|
||||
integer :: iaux(0:*)
|
||||
real(psb_dpk_) :: x(*)
|
||||
integer :: i1(*), i2(*),i3(*)
|
||||
|
||||
|
||||
integer :: lswap, lp, k, isw1, isw2,isw3
|
||||
real(psb_dpk_) :: swap
|
||||
|
||||
lp = iaux(0)
|
||||
k = 1
|
||||
do
|
||||
if ((lp==0).or.(k>n)) exit
|
||||
do
|
||||
if (lp >= k) exit
|
||||
lp = iaux(lp)
|
||||
end do
|
||||
swap = x(lp)
|
||||
x(lp) = x(k)
|
||||
x(k) = swap
|
||||
isw1 = i1(lp)
|
||||
i1(lp) = i1(k)
|
||||
i1(k) = isw1
|
||||
isw2 = i2(lp)
|
||||
i2(lp) = i2(k)
|
||||
i2(k) = isw2
|
||||
isw3 = i3(lp)
|
||||
i3(lp) = i3(k)
|
||||
i3(k) = isw3
|
||||
lswap = iaux(lp)
|
||||
iaux(lp) = iaux(k)
|
||||
iaux(k) = lp
|
||||
lp = lswap
|
||||
k = k + 1
|
||||
enddo
|
||||
return
|
||||
end subroutine psb_ip_reord_d1i3
|
||||
|
||||
subroutine psb_ip_reord_c1i3(n,x,i1,i2,i3,iaux)
|
||||
integer, intent(in) :: n
|
||||
integer :: iaux(0:*)
|
||||
complex(psb_spk_) :: x(*)
|
||||
integer :: i1(*), i2(*), i3(*)
|
||||
|
||||
|
||||
integer :: lswap, lp, k, isw1, isw2, isw3
|
||||
complex(psb_spk_) :: swap
|
||||
|
||||
lp = iaux(0)
|
||||
k = 1
|
||||
do
|
||||
if ((lp==0).or.(k>n)) exit
|
||||
do
|
||||
if (lp >= k) exit
|
||||
lp = iaux(lp)
|
||||
end do
|
||||
swap = x(lp)
|
||||
x(lp) = x(k)
|
||||
x(k) = swap
|
||||
isw1 = i1(lp)
|
||||
i1(lp) = i1(k)
|
||||
i1(k) = isw1
|
||||
isw2 = i2(lp)
|
||||
i2(lp) = i2(k)
|
||||
i2(k) = isw2
|
||||
isw3 = i3(lp)
|
||||
i3(lp) = i3(k)
|
||||
i3(k) = isw3
|
||||
lswap = iaux(lp)
|
||||
iaux(lp) = iaux(k)
|
||||
iaux(k) = lp
|
||||
lp = lswap
|
||||
k = k + 1
|
||||
enddo
|
||||
return
|
||||
end subroutine psb_ip_reord_c1i3
|
||||
|
||||
subroutine psb_ip_reord_z1i3(n,x,i1,i2,i3,iaux)
|
||||
integer, intent(in) :: n
|
||||
integer :: iaux(0:*)
|
||||
complex(psb_dpk_) :: x(*)
|
||||
integer :: i1(*), i2(*), i3(*)
|
||||
|
||||
|
||||
integer :: lswap, lp, k, isw1, isw2, isw3
|
||||
complex(psb_dpk_) :: swap
|
||||
|
||||
lp = iaux(0)
|
||||
k = 1
|
||||
do
|
||||
if ((lp==0).or.(k>n)) exit
|
||||
do
|
||||
if (lp >= k) exit
|
||||
lp = iaux(lp)
|
||||
end do
|
||||
swap = x(lp)
|
||||
x(lp) = x(k)
|
||||
x(k) = swap
|
||||
isw1 = i1(lp)
|
||||
i1(lp) = i1(k)
|
||||
i1(k) = isw1
|
||||
isw2 = i2(lp)
|
||||
i2(lp) = i2(k)
|
||||
i2(k) = isw2
|
||||
isw3 = i3(lp)
|
||||
i3(lp) = i3(k)
|
||||
i3(k) = isw3
|
||||
lswap = iaux(lp)
|
||||
iaux(lp) = iaux(k)
|
||||
iaux(k) = lp
|
||||
lp = lswap
|
||||
k = k + 1
|
||||
enddo
|
||||
return
|
||||
end subroutine psb_ip_reord_z1i3
|
||||
|
||||
|
||||
end module psb_ip_reord_mod
|
Loading…
Reference in New Issue