|
|
@ -1,9 +1,9 @@
|
|
|
|
!
|
|
|
|
!
|
|
|
|
! Parallel Sparse BLAS version 3.5
|
|
|
|
! Parallel Sparse BLAS version 3.5
|
|
|
|
! (C) Copyright 2006-2018
|
|
|
|
! (C) Copyright 2006-2018
|
|
|
|
! Salvatore Filippone
|
|
|
|
! Salvatore Filippone
|
|
|
|
! Alfredo Buttari
|
|
|
|
! Alfredo Buttari
|
|
|
|
!
|
|
|
|
!
|
|
|
|
! Redistribution and use in source and binary forms, with or without
|
|
|
|
! Redistribution and use in source and binary forms, with or without
|
|
|
|
! modification, are permitted provided that the following conditions
|
|
|
|
! modification, are permitted provided that the following conditions
|
|
|
|
! are met:
|
|
|
|
! are met:
|
|
|
@ -15,7 +15,7 @@
|
|
|
|
! 3. The name of the PSBLAS group or the names of its contributors may
|
|
|
|
! 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
|
|
|
|
! not be used to endorse or promote products derived from this
|
|
|
|
! software without specific written permission.
|
|
|
|
! software without specific written permission.
|
|
|
|
!
|
|
|
|
!
|
|
|
|
! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
|
|
! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
|
|
! ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
|
|
|
! ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
|
|
|
! TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
|
|
! TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
|
@ -27,13 +27,13 @@
|
|
|
|
! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
|
|
! 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
|
|
|
|
! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
|
|
! POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
! POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
!
|
|
|
|
!
|
|
|
|
!
|
|
|
|
!
|
|
|
|
subroutine psi_caxpby(m,n,alpha, x, beta, y, info)
|
|
|
|
subroutine psi_caxpby(m,n,alpha, x, beta, y, info)
|
|
|
|
|
|
|
|
|
|
|
|
use psb_const_mod
|
|
|
|
use psb_const_mod
|
|
|
|
use psb_error_mod
|
|
|
|
use psb_error_mod
|
|
|
|
implicit none
|
|
|
|
implicit none
|
|
|
|
integer(psb_ipk_), intent(in) :: m, n
|
|
|
|
integer(psb_ipk_), intent(in) :: m, n
|
|
|
|
complex(psb_spk_), intent (in) :: x(:,:)
|
|
|
|
complex(psb_spk_), intent (in) :: x(:,:)
|
|
|
|
complex(psb_spk_), intent (inout) :: y(:,:)
|
|
|
|
complex(psb_spk_), intent (inout) :: y(:,:)
|
|
|
@ -55,27 +55,27 @@ subroutine psi_caxpby(m,n,alpha, x, beta, y, info)
|
|
|
|
info = psb_err_iarg_neg_
|
|
|
|
info = psb_err_iarg_neg_
|
|
|
|
ierr(1) = 1; ierr(2) = m
|
|
|
|
ierr(1) = 1; ierr(2) = m
|
|
|
|
call psb_errpush(info,name,i_err=ierr)
|
|
|
|
call psb_errpush(info,name,i_err=ierr)
|
|
|
|
goto 9999
|
|
|
|
goto 9999
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
if (n < 0) then
|
|
|
|
if (n < 0) then
|
|
|
|
info = psb_err_iarg_neg_
|
|
|
|
info = psb_err_iarg_neg_
|
|
|
|
ierr(1) = 2; ierr(2) = n
|
|
|
|
ierr(1) = 2; ierr(2) = n
|
|
|
|
call psb_errpush(info,name,i_err=ierr)
|
|
|
|
call psb_errpush(info,name,i_err=ierr)
|
|
|
|
goto 9999
|
|
|
|
goto 9999
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
lx = size(x,1)
|
|
|
|
lx = size(x,1)
|
|
|
|
ly = size(y,1)
|
|
|
|
ly = size(y,1)
|
|
|
|
if (lx < m) then
|
|
|
|
if (lx < m) then
|
|
|
|
info = psb_err_input_asize_small_i_
|
|
|
|
info = psb_err_input_asize_small_i_
|
|
|
|
ierr(1) = 4; ierr(2) = m
|
|
|
|
ierr(1) = 4; ierr(2) = m
|
|
|
|
call psb_errpush(info,name,i_err=ierr)
|
|
|
|
call psb_errpush(info,name,i_err=ierr)
|
|
|
|
goto 9999
|
|
|
|
goto 9999
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
if (ly < m) then
|
|
|
|
if (ly < m) then
|
|
|
|
info = psb_err_input_asize_small_i_
|
|
|
|
info = psb_err_input_asize_small_i_
|
|
|
|
ierr(1) = 6; ierr(2) = m
|
|
|
|
ierr(1) = 6; ierr(2) = m
|
|
|
|
call psb_errpush(info,name,i_err=ierr)
|
|
|
|
call psb_errpush(info,name,i_err=ierr)
|
|
|
|
goto 9999
|
|
|
|
goto 9999
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
|
|
if ((m>0).and.(n>0)) call caxpby(m,n,alpha,x,lx,beta,y,ly,info)
|
|
|
|
if ((m>0).and.(n>0)) call caxpby(m,n,alpha,x,lx,beta,y,ly,info)
|
|
|
@ -89,10 +89,10 @@ subroutine psi_caxpby(m,n,alpha, x, beta, y, info)
|
|
|
|
end subroutine psi_caxpby
|
|
|
|
end subroutine psi_caxpby
|
|
|
|
|
|
|
|
|
|
|
|
subroutine psi_caxpbyv(m,alpha, x, beta, y, info)
|
|
|
|
subroutine psi_caxpbyv(m,alpha, x, beta, y, info)
|
|
|
|
|
|
|
|
|
|
|
|
use psb_const_mod
|
|
|
|
use psb_const_mod
|
|
|
|
use psb_error_mod
|
|
|
|
use psb_error_mod
|
|
|
|
implicit none
|
|
|
|
implicit none
|
|
|
|
integer(psb_ipk_), intent(in) :: m
|
|
|
|
integer(psb_ipk_), intent(in) :: m
|
|
|
|
complex(psb_spk_), intent (in) :: x(:)
|
|
|
|
complex(psb_spk_), intent (in) :: x(:)
|
|
|
|
complex(psb_spk_), intent (inout) :: y(:)
|
|
|
|
complex(psb_spk_), intent (inout) :: y(:)
|
|
|
@ -114,21 +114,21 @@ subroutine psi_caxpbyv(m,alpha, x, beta, y, info)
|
|
|
|
info = psb_err_iarg_neg_
|
|
|
|
info = psb_err_iarg_neg_
|
|
|
|
ierr(1) = 1; ierr(2) = m
|
|
|
|
ierr(1) = 1; ierr(2) = m
|
|
|
|
call psb_errpush(info,name,i_err=ierr)
|
|
|
|
call psb_errpush(info,name,i_err=ierr)
|
|
|
|
goto 9999
|
|
|
|
goto 9999
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
lx = size(x,1)
|
|
|
|
lx = size(x,1)
|
|
|
|
ly = size(y,1)
|
|
|
|
ly = size(y,1)
|
|
|
|
if (lx < m) then
|
|
|
|
if (lx < m) then
|
|
|
|
info = psb_err_input_asize_small_i_
|
|
|
|
info = psb_err_input_asize_small_i_
|
|
|
|
ierr(1) = 3; ierr(2) = m
|
|
|
|
ierr(1) = 3; ierr(2) = m
|
|
|
|
call psb_errpush(info,name,i_err=ierr)
|
|
|
|
call psb_errpush(info,name,i_err=ierr)
|
|
|
|
goto 9999
|
|
|
|
goto 9999
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
if (ly < m) then
|
|
|
|
if (ly < m) then
|
|
|
|
info = psb_err_input_asize_small_i_
|
|
|
|
info = psb_err_input_asize_small_i_
|
|
|
|
ierr(1) = 5; ierr(2) = m
|
|
|
|
ierr(1) = 5; ierr(2) = m
|
|
|
|
call psb_errpush(info,name,i_err=ierr)
|
|
|
|
call psb_errpush(info,name,i_err=ierr)
|
|
|
|
goto 9999
|
|
|
|
goto 9999
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
|
|
if (m>0) call caxpby(m,ione,alpha,x,lx,beta,y,ly,info)
|
|
|
|
if (m>0) call caxpby(m,ione,alpha,x,lx,beta,y,ly,info)
|
|
|
@ -142,6 +142,67 @@ subroutine psi_caxpbyv(m,alpha, x, beta, y, info)
|
|
|
|
|
|
|
|
|
|
|
|
end subroutine psi_caxpbyv
|
|
|
|
end subroutine psi_caxpbyv
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
subroutine psi_caxpbyv2(m,alpha, x, beta, y, z, info)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
use psb_const_mod
|
|
|
|
|
|
|
|
use psb_error_mod
|
|
|
|
|
|
|
|
implicit none
|
|
|
|
|
|
|
|
integer(psb_ipk_), intent(in) :: m
|
|
|
|
|
|
|
|
complex(psb_spk_), intent (in) :: x(:)
|
|
|
|
|
|
|
|
complex(psb_spk_), intent (in) :: y(:)
|
|
|
|
|
|
|
|
complex(psb_spk_), intent (inout) :: z(:)
|
|
|
|
|
|
|
|
complex(psb_spk_), intent (in) :: alpha, beta
|
|
|
|
|
|
|
|
integer(psb_ipk_), intent(out) :: info
|
|
|
|
|
|
|
|
integer(psb_ipk_) :: err_act
|
|
|
|
|
|
|
|
integer(psb_ipk_) :: lx, ly, lz
|
|
|
|
|
|
|
|
integer(psb_ipk_) :: ierr(5)
|
|
|
|
|
|
|
|
character(len=20) :: name, ch_err
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
name='psb_geaxpby'
|
|
|
|
|
|
|
|
info=psb_success_
|
|
|
|
|
|
|
|
call psb_erractionsave(err_act)
|
|
|
|
|
|
|
|
if (psb_errstatus_fatal()) then
|
|
|
|
|
|
|
|
info = psb_err_internal_error_ ; goto 9999
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (m < 0) then
|
|
|
|
|
|
|
|
info = psb_err_iarg_neg_
|
|
|
|
|
|
|
|
ierr(1) = 1; ierr(2) = m
|
|
|
|
|
|
|
|
call psb_errpush(info,name,i_err=ierr)
|
|
|
|
|
|
|
|
goto 9999
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
lx = size(x,1)
|
|
|
|
|
|
|
|
ly = size(y,1)
|
|
|
|
|
|
|
|
lz = size(z,1)
|
|
|
|
|
|
|
|
if (lx < m) then
|
|
|
|
|
|
|
|
info = psb_err_input_asize_small_i_
|
|
|
|
|
|
|
|
ierr(1) = 3; ierr(2) = m
|
|
|
|
|
|
|
|
call psb_errpush(info,name,i_err=ierr)
|
|
|
|
|
|
|
|
goto 9999
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
if (ly < m) then
|
|
|
|
|
|
|
|
info = psb_err_input_asize_small_i_
|
|
|
|
|
|
|
|
ierr(1) = 5; ierr(2) = m
|
|
|
|
|
|
|
|
call psb_errpush(info,name,i_err=ierr)
|
|
|
|
|
|
|
|
goto 9999
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
if (lz < m) then
|
|
|
|
|
|
|
|
info = psb_err_input_asize_small_i_
|
|
|
|
|
|
|
|
ierr(1) = 5; ierr(2) = m
|
|
|
|
|
|
|
|
call psb_errpush(info,name,i_err=ierr)
|
|
|
|
|
|
|
|
goto 9999
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (m>0) call caxpbyv2(m,ione,alpha,x,lx,beta,y,ly,z,lz,info)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
call psb_erractionrestore(err_act)
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9999 call psb_error_handler(err_act)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
end subroutine psi_caxpbyv2
|
|
|
|
|
|
|
|
|
|
|
|
subroutine psi_cgthmv(n,k,idx,alpha,x,beta,y)
|
|
|
|
subroutine psi_cgthmv(n,k,idx,alpha,x,beta,y)
|
|
|
|
|
|
|
|
|
|
|
@ -154,8 +215,8 @@ subroutine psi_cgthmv(n,k,idx,alpha,x,beta,y)
|
|
|
|
! Locals
|
|
|
|
! Locals
|
|
|
|
integer(psb_ipk_) :: i, j, pt
|
|
|
|
integer(psb_ipk_) :: i, j, pt
|
|
|
|
|
|
|
|
|
|
|
|
if (beta == czero) then
|
|
|
|
if (beta == czero) then
|
|
|
|
if (alpha == czero) then
|
|
|
|
if (alpha == czero) then
|
|
|
|
pt=0
|
|
|
|
pt=0
|
|
|
|
do j=1,k
|
|
|
|
do j=1,k
|
|
|
|
do i=1,n
|
|
|
|
do i=1,n
|
|
|
@ -171,11 +232,11 @@ subroutine psi_cgthmv(n,k,idx,alpha,x,beta,y)
|
|
|
|
y(pt) = x(idx(i),j)
|
|
|
|
y(pt) = x(idx(i),j)
|
|
|
|
end do
|
|
|
|
end do
|
|
|
|
end do
|
|
|
|
end do
|
|
|
|
else if (alpha == -cone) then
|
|
|
|
else if (alpha == -cone) then
|
|
|
|
pt=0
|
|
|
|
pt=0
|
|
|
|
do j=1,k
|
|
|
|
do j=1,k
|
|
|
|
do i=1,n
|
|
|
|
do i=1,n
|
|
|
|
pt=pt+1
|
|
|
|
pt=pt+1
|
|
|
|
y(pt) = -x(idx(i),j)
|
|
|
|
y(pt) = -x(idx(i),j)
|
|
|
|
end do
|
|
|
|
end do
|
|
|
|
end do
|
|
|
|
end do
|
|
|
@ -188,18 +249,18 @@ subroutine psi_cgthmv(n,k,idx,alpha,x,beta,y)
|
|
|
|
end do
|
|
|
|
end do
|
|
|
|
end do
|
|
|
|
end do
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
else
|
|
|
|
else
|
|
|
|
if (beta == cone) then
|
|
|
|
if (beta == cone) then
|
|
|
|
! Do nothing
|
|
|
|
! Do nothing
|
|
|
|
else if (beta == -cone) then
|
|
|
|
else if (beta == -cone) then
|
|
|
|
y(1:n*k) = -y(1:n*k)
|
|
|
|
y(1:n*k) = -y(1:n*k)
|
|
|
|
else
|
|
|
|
else
|
|
|
|
y(1:n*k) = beta*y(1:n*k)
|
|
|
|
y(1:n*k) = beta*y(1:n*k)
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
|
|
if (alpha == czero) then
|
|
|
|
if (alpha == czero) then
|
|
|
|
! do nothing
|
|
|
|
! do nothing
|
|
|
|
else if (alpha == cone) then
|
|
|
|
else if (alpha == cone) then
|
|
|
|
pt=0
|
|
|
|
pt=0
|
|
|
|
do j=1,k
|
|
|
|
do j=1,k
|
|
|
|
do i=1,n
|
|
|
|
do i=1,n
|
|
|
@ -215,7 +276,7 @@ subroutine psi_cgthmv(n,k,idx,alpha,x,beta,y)
|
|
|
|
y(pt) = y(pt) - x(idx(i),j)
|
|
|
|
y(pt) = y(pt) - x(idx(i),j)
|
|
|
|
end do
|
|
|
|
end do
|
|
|
|
end do
|
|
|
|
end do
|
|
|
|
else
|
|
|
|
else
|
|
|
|
pt=0
|
|
|
|
pt=0
|
|
|
|
do j=1,k
|
|
|
|
do j=1,k
|
|
|
|
do i=1,n
|
|
|
|
do i=1,n
|
|
|
@ -238,44 +299,44 @@ subroutine psi_cgthv(n,idx,alpha,x,beta,y)
|
|
|
|
|
|
|
|
|
|
|
|
! Locals
|
|
|
|
! Locals
|
|
|
|
integer(psb_ipk_) :: i
|
|
|
|
integer(psb_ipk_) :: i
|
|
|
|
if (beta == czero) then
|
|
|
|
if (beta == czero) then
|
|
|
|
if (alpha == czero) then
|
|
|
|
if (alpha == czero) then
|
|
|
|
do i=1,n
|
|
|
|
do i=1,n
|
|
|
|
y(i) = czero
|
|
|
|
y(i) = czero
|
|
|
|
end do
|
|
|
|
end do
|
|
|
|
else if (alpha == cone) then
|
|
|
|
else if (alpha == cone) then
|
|
|
|
do i=1,n
|
|
|
|
do i=1,n
|
|
|
|
y(i) = x(idx(i))
|
|
|
|
y(i) = x(idx(i))
|
|
|
|
end do
|
|
|
|
end do
|
|
|
|
else if (alpha == -cone) then
|
|
|
|
else if (alpha == -cone) then
|
|
|
|
do i=1,n
|
|
|
|
do i=1,n
|
|
|
|
y(i) = -x(idx(i))
|
|
|
|
y(i) = -x(idx(i))
|
|
|
|
end do
|
|
|
|
end do
|
|
|
|
else
|
|
|
|
else
|
|
|
|
do i=1,n
|
|
|
|
do i=1,n
|
|
|
|
y(i) = alpha*x(idx(i))
|
|
|
|
y(i) = alpha*x(idx(i))
|
|
|
|
end do
|
|
|
|
end do
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
else
|
|
|
|
else
|
|
|
|
if (beta == cone) then
|
|
|
|
if (beta == cone) then
|
|
|
|
! Do nothing
|
|
|
|
! Do nothing
|
|
|
|
else if (beta == -cone) then
|
|
|
|
else if (beta == -cone) then
|
|
|
|
y(1:n) = -y(1:n)
|
|
|
|
y(1:n) = -y(1:n)
|
|
|
|
else
|
|
|
|
else
|
|
|
|
y(1:n) = beta*y(1:n)
|
|
|
|
y(1:n) = beta*y(1:n)
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
|
|
if (alpha == czero) then
|
|
|
|
if (alpha == czero) then
|
|
|
|
! do nothing
|
|
|
|
! do nothing
|
|
|
|
else if (alpha == cone) then
|
|
|
|
else if (alpha == cone) then
|
|
|
|
do i=1,n
|
|
|
|
do i=1,n
|
|
|
|
y(i) = y(i) + x(idx(i))
|
|
|
|
y(i) = y(i) + x(idx(i))
|
|
|
|
end do
|
|
|
|
end do
|
|
|
|
else if (alpha == -cone) then
|
|
|
|
else if (alpha == -cone) then
|
|
|
|
do i=1,n
|
|
|
|
do i=1,n
|
|
|
|
y(i) = y(i) - x(idx(i))
|
|
|
|
y(i) = y(i) - x(idx(i))
|
|
|
|
end do
|
|
|
|
end do
|
|
|
|
else
|
|
|
|
else
|
|
|
|
do i=1,n
|
|
|
|
do i=1,n
|
|
|
|
y(i) = y(i) + alpha*x(idx(i))
|
|
|
|
y(i) = y(i) + alpha*x(idx(i))
|
|
|
|
end do
|
|
|
|
end do
|
|
|
@ -295,7 +356,7 @@ subroutine psi_cgthzmm(n,k,idx,x,y)
|
|
|
|
! Locals
|
|
|
|
! Locals
|
|
|
|
integer(psb_ipk_) :: i
|
|
|
|
integer(psb_ipk_) :: i
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
do i=1,n
|
|
|
|
do i=1,n
|
|
|
|
y(i,1:k)=x(idx(i),1:k)
|
|
|
|
y(i,1:k)=x(idx(i),1:k)
|
|
|
|
end do
|
|
|
|
end do
|
|
|
@ -341,7 +402,7 @@ subroutine psi_cgthzv(n,idx,x,y)
|
|
|
|
end subroutine psi_cgthzv
|
|
|
|
end subroutine psi_cgthzv
|
|
|
|
|
|
|
|
|
|
|
|
subroutine psi_csctmm(n,k,idx,x,beta,y)
|
|
|
|
subroutine psi_csctmm(n,k,idx,x,beta,y)
|
|
|
|
|
|
|
|
|
|
|
|
use psb_const_mod
|
|
|
|
use psb_const_mod
|
|
|
|
implicit none
|
|
|
|
implicit none
|
|
|
|
|
|
|
|
|
|
|
@ -367,7 +428,7 @@ subroutine psi_csctmm(n,k,idx,x,beta,y)
|
|
|
|
end subroutine psi_csctmm
|
|
|
|
end subroutine psi_csctmm
|
|
|
|
|
|
|
|
|
|
|
|
subroutine psi_csctmv(n,k,idx,x,beta,y)
|
|
|
|
subroutine psi_csctmv(n,k,idx,x,beta,y)
|
|
|
|
|
|
|
|
|
|
|
|
use psb_const_mod
|
|
|
|
use psb_const_mod
|
|
|
|
implicit none
|
|
|
|
implicit none
|
|
|
|
|
|
|
|
|
|
|
@ -433,7 +494,7 @@ end subroutine psi_csctv
|
|
|
|
subroutine caxpby(m, n, alpha, X, lldx, beta, Y, lldy, info)
|
|
|
|
subroutine caxpby(m, n, alpha, X, lldx, beta, Y, lldy, info)
|
|
|
|
use psb_const_mod
|
|
|
|
use psb_const_mod
|
|
|
|
use psb_error_mod
|
|
|
|
use psb_error_mod
|
|
|
|
implicit none
|
|
|
|
implicit none
|
|
|
|
integer(psb_ipk_) :: n, m, lldx, lldy, info
|
|
|
|
integer(psb_ipk_) :: n, m, lldx, lldy, info
|
|
|
|
complex(psb_spk_) X(lldx,*), Y(lldy,*)
|
|
|
|
complex(psb_spk_) X(lldx,*), Y(lldy,*)
|
|
|
|
complex(psb_spk_) alpha, beta
|
|
|
|
complex(psb_spk_) alpha, beta
|
|
|
@ -447,19 +508,19 @@ subroutine caxpby(m, n, alpha, X, lldx, beta, Y, lldy, info)
|
|
|
|
! Error handling
|
|
|
|
! Error handling
|
|
|
|
!
|
|
|
|
!
|
|
|
|
info = psb_success_
|
|
|
|
info = psb_success_
|
|
|
|
if (m.lt.0) then
|
|
|
|
if (m.lt.0) then
|
|
|
|
info=psb_err_iarg_neg_
|
|
|
|
info=psb_err_iarg_neg_
|
|
|
|
int_err(1)=1
|
|
|
|
int_err(1)=1
|
|
|
|
int_err(2)=m
|
|
|
|
int_err(2)=m
|
|
|
|
call fcpsb_errpush(info,name,int_err)
|
|
|
|
call fcpsb_errpush(info,name,int_err)
|
|
|
|
goto 9999
|
|
|
|
goto 9999
|
|
|
|
else if (n.lt.0) then
|
|
|
|
else if (n.lt.0) then
|
|
|
|
info=psb_err_iarg_neg_
|
|
|
|
info=psb_err_iarg_neg_
|
|
|
|
int_err(1)=1
|
|
|
|
int_err(1)=1
|
|
|
|
int_err(2)=n
|
|
|
|
int_err(2)=n
|
|
|
|
call fcpsb_errpush(info,name,int_err)
|
|
|
|
call fcpsb_errpush(info,name,int_err)
|
|
|
|
goto 9999
|
|
|
|
goto 9999
|
|
|
|
else if (lldx.lt.max(1,m)) then
|
|
|
|
else if (lldx.lt.max(1,m)) then
|
|
|
|
info=psb_err_iarg_not_gtia_ii_
|
|
|
|
info=psb_err_iarg_not_gtia_ii_
|
|
|
|
int_err(1)=5
|
|
|
|
int_err(1)=5
|
|
|
|
int_err(2)=1
|
|
|
|
int_err(2)=1
|
|
|
@ -467,7 +528,7 @@ subroutine caxpby(m, n, alpha, X, lldx, beta, Y, lldy, info)
|
|
|
|
int_err(4)=m
|
|
|
|
int_err(4)=m
|
|
|
|
call fcpsb_errpush(info,name,int_err)
|
|
|
|
call fcpsb_errpush(info,name,int_err)
|
|
|
|
goto 9999
|
|
|
|
goto 9999
|
|
|
|
else if (lldy.lt.max(1,m)) then
|
|
|
|
else if (lldy.lt.max(1,m)) then
|
|
|
|
info=psb_err_iarg_not_gtia_ii_
|
|
|
|
info=psb_err_iarg_not_gtia_ii_
|
|
|
|
int_err(1)=8
|
|
|
|
int_err(1)=8
|
|
|
|
int_err(2)=1
|
|
|
|
int_err(2)=1
|
|
|
@ -477,27 +538,27 @@ subroutine caxpby(m, n, alpha, X, lldx, beta, Y, lldy, info)
|
|
|
|
goto 9999
|
|
|
|
goto 9999
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
|
if (alpha.eq.czero) then
|
|
|
|
if (alpha.eq.czero) then
|
|
|
|
if (beta.eq.czero) then
|
|
|
|
if (beta.eq.czero) then
|
|
|
|
do j=1, n
|
|
|
|
do j=1, n
|
|
|
|
do i=1,m
|
|
|
|
do i=1,m
|
|
|
|
y(i,j) = czero
|
|
|
|
y(i,j) = czero
|
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
else if (beta.eq.cone) then
|
|
|
|
else if (beta.eq.cone) then
|
|
|
|
!
|
|
|
|
!
|
|
|
|
! Do nothing!
|
|
|
|
! Do nothing!
|
|
|
|
!
|
|
|
|
!
|
|
|
|
|
|
|
|
|
|
|
|
else if (beta.eq.-cone) then
|
|
|
|
else if (beta.eq.-cone) then
|
|
|
|
do j=1,n
|
|
|
|
do j=1,n
|
|
|
|
do i=1,m
|
|
|
|
do i=1,m
|
|
|
|
y(i,j) = - y(i,j)
|
|
|
|
y(i,j) = - y(i,j)
|
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
else
|
|
|
|
else
|
|
|
|
do j=1,n
|
|
|
|
do j=1,n
|
|
|
|
do i=1,m
|
|
|
|
do i=1,m
|
|
|
|
y(i,j) = beta*y(i,j)
|
|
|
|
y(i,j) = beta*y(i,j)
|
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
enddo
|
|
|
@ -505,86 +566,86 @@ subroutine caxpby(m, n, alpha, X, lldx, beta, Y, lldy, info)
|
|
|
|
|
|
|
|
|
|
|
|
else if (alpha.eq.cone) then
|
|
|
|
else if (alpha.eq.cone) then
|
|
|
|
|
|
|
|
|
|
|
|
if (beta.eq.czero) then
|
|
|
|
if (beta.eq.czero) then
|
|
|
|
do j=1,n
|
|
|
|
do j=1,n
|
|
|
|
do i=1,m
|
|
|
|
do i=1,m
|
|
|
|
y(i,j) = x(i,j)
|
|
|
|
y(i,j) = x(i,j)
|
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
else if (beta.eq.cone) then
|
|
|
|
else if (beta.eq.cone) then
|
|
|
|
do j=1,n
|
|
|
|
do j=1,n
|
|
|
|
do i=1,m
|
|
|
|
do i=1,m
|
|
|
|
y(i,j) = x(i,j) + y(i,j)
|
|
|
|
y(i,j) = x(i,j) + y(i,j)
|
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
|
|
|
|
|
|
|
|
else if (beta.eq.-cone) then
|
|
|
|
else if (beta.eq.-cone) then
|
|
|
|
do j=1,n
|
|
|
|
do j=1,n
|
|
|
|
do i=1,m
|
|
|
|
do i=1,m
|
|
|
|
y(i,j) = x(i,j) - y(i,j)
|
|
|
|
y(i,j) = x(i,j) - y(i,j)
|
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
else
|
|
|
|
else
|
|
|
|
do j=1,n
|
|
|
|
do j=1,n
|
|
|
|
do i=1,m
|
|
|
|
do i=1,m
|
|
|
|
y(i,j) = x(i,j) + beta*y(i,j)
|
|
|
|
y(i,j) = x(i,j) + beta*y(i,j)
|
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
|
else if (alpha.eq.-cone) then
|
|
|
|
else if (alpha.eq.-cone) then
|
|
|
|
|
|
|
|
|
|
|
|
if (beta.eq.czero) then
|
|
|
|
if (beta.eq.czero) then
|
|
|
|
do j=1,n
|
|
|
|
do j=1,n
|
|
|
|
do i=1,m
|
|
|
|
do i=1,m
|
|
|
|
y(i,j) = -x(i,j)
|
|
|
|
y(i,j) = -x(i,j)
|
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
else if (beta.eq.cone) then
|
|
|
|
else if (beta.eq.cone) then
|
|
|
|
do j=1,n
|
|
|
|
do j=1,n
|
|
|
|
do i=1,m
|
|
|
|
do i=1,m
|
|
|
|
y(i,j) = -x(i,j) + y(i,j)
|
|
|
|
y(i,j) = -x(i,j) + y(i,j)
|
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
|
|
|
|
|
|
|
|
else if (beta.eq.-cone) then
|
|
|
|
else if (beta.eq.-cone) then
|
|
|
|
do j=1,n
|
|
|
|
do j=1,n
|
|
|
|
do i=1,m
|
|
|
|
do i=1,m
|
|
|
|
y(i,j) = -x(i,j) - y(i,j)
|
|
|
|
y(i,j) = -x(i,j) - y(i,j)
|
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
else
|
|
|
|
else
|
|
|
|
do j=1,n
|
|
|
|
do j=1,n
|
|
|
|
do i=1,m
|
|
|
|
do i=1,m
|
|
|
|
y(i,j) = -x(i,j) + beta*y(i,j)
|
|
|
|
y(i,j) = -x(i,j) + beta*y(i,j)
|
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
|
else
|
|
|
|
else
|
|
|
|
|
|
|
|
|
|
|
|
if (beta.eq.czero) then
|
|
|
|
if (beta.eq.czero) then
|
|
|
|
do j=1,n
|
|
|
|
do j=1,n
|
|
|
|
do i=1,m
|
|
|
|
do i=1,m
|
|
|
|
y(i,j) = alpha*x(i,j)
|
|
|
|
y(i,j) = alpha*x(i,j)
|
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
else if (beta.eq.cone) then
|
|
|
|
else if (beta.eq.cone) then
|
|
|
|
do j=1,n
|
|
|
|
do j=1,n
|
|
|
|
do i=1,m
|
|
|
|
do i=1,m
|
|
|
|
y(i,j) = alpha*x(i,j) + y(i,j)
|
|
|
|
y(i,j) = alpha*x(i,j) + y(i,j)
|
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
|
|
|
|
|
|
|
|
else if (beta.eq.-cone) then
|
|
|
|
else if (beta.eq.-cone) then
|
|
|
|
do j=1,n
|
|
|
|
do j=1,n
|
|
|
|
do i=1,m
|
|
|
|
do i=1,m
|
|
|
|
y(i,j) = alpha*x(i,j) - y(i,j)
|
|
|
|
y(i,j) = alpha*x(i,j) - y(i,j)
|
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
else
|
|
|
|
else
|
|
|
|
do j=1,n
|
|
|
|
do j=1,n
|
|
|
|
do i=1,m
|
|
|
|
do i=1,m
|
|
|
|
y(i,j) = alpha*x(i,j) + beta*y(i,j)
|
|
|
|
y(i,j) = alpha*x(i,j) + beta*y(i,j)
|
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
enddo
|
|
|
@ -599,3 +660,181 @@ subroutine caxpby(m, n, alpha, X, lldx, beta, Y, lldy, info)
|
|
|
|
return
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
|
|
end subroutine caxpby
|
|
|
|
end subroutine caxpby
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
subroutine caxpbyv2(m, n, alpha, X, lldx, beta, Y, lldy, Z, lldz, info)
|
|
|
|
|
|
|
|
use psb_const_mod
|
|
|
|
|
|
|
|
use psb_error_mod
|
|
|
|
|
|
|
|
implicit none
|
|
|
|
|
|
|
|
integer(psb_ipk_) :: n, m, lldx, lldy, lldz, info
|
|
|
|
|
|
|
|
complex(psb_spk_) X(lldx,*), Y(lldy,*), Z(lldy,*)
|
|
|
|
|
|
|
|
complex(psb_spk_) alpha, beta
|
|
|
|
|
|
|
|
integer(psb_ipk_) :: i, j
|
|
|
|
|
|
|
|
integer(psb_ipk_) :: int_err(5)
|
|
|
|
|
|
|
|
character name*20
|
|
|
|
|
|
|
|
name='caxpby'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
! Error handling
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
info = psb_success_
|
|
|
|
|
|
|
|
if (m.lt.0) then
|
|
|
|
|
|
|
|
info=psb_err_iarg_neg_
|
|
|
|
|
|
|
|
int_err(1)=1
|
|
|
|
|
|
|
|
int_err(2)=m
|
|
|
|
|
|
|
|
call fcpsb_errpush(info,name,int_err)
|
|
|
|
|
|
|
|
goto 9999
|
|
|
|
|
|
|
|
else if (n.lt.0) then
|
|
|
|
|
|
|
|
info=psb_err_iarg_neg_
|
|
|
|
|
|
|
|
int_err(1)=1
|
|
|
|
|
|
|
|
int_err(2)=n
|
|
|
|
|
|
|
|
call fcpsb_errpush(info,name,int_err)
|
|
|
|
|
|
|
|
goto 9999
|
|
|
|
|
|
|
|
else if (lldx.lt.max(1,m)) then
|
|
|
|
|
|
|
|
info=psb_err_iarg_not_gtia_ii_
|
|
|
|
|
|
|
|
int_err(1)=5
|
|
|
|
|
|
|
|
int_err(2)=1
|
|
|
|
|
|
|
|
int_err(3)=lldx
|
|
|
|
|
|
|
|
int_err(4)=m
|
|
|
|
|
|
|
|
call fcpsb_errpush(info,name,int_err)
|
|
|
|
|
|
|
|
goto 9999
|
|
|
|
|
|
|
|
else if (lldy.lt.max(1,m)) then
|
|
|
|
|
|
|
|
info=psb_err_iarg_not_gtia_ii_
|
|
|
|
|
|
|
|
int_err(1)=8
|
|
|
|
|
|
|
|
int_err(2)=1
|
|
|
|
|
|
|
|
int_err(3)=lldy
|
|
|
|
|
|
|
|
int_err(4)=m
|
|
|
|
|
|
|
|
call fcpsb_errpush(info,name,int_err)
|
|
|
|
|
|
|
|
goto 9999
|
|
|
|
|
|
|
|
else if (lldz.lt.max(1,m)) then
|
|
|
|
|
|
|
|
info=psb_err_iarg_not_gtia_ii_
|
|
|
|
|
|
|
|
int_err(1)=8
|
|
|
|
|
|
|
|
int_err(2)=1
|
|
|
|
|
|
|
|
int_err(3)=lldz
|
|
|
|
|
|
|
|
int_err(4)=m
|
|
|
|
|
|
|
|
call fcpsb_errpush(info,name,int_err)
|
|
|
|
|
|
|
|
goto 9999
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (alpha.eq.czero) then
|
|
|
|
|
|
|
|
if (beta.eq.czero) then
|
|
|
|
|
|
|
|
do j=1, n
|
|
|
|
|
|
|
|
do i=1,m
|
|
|
|
|
|
|
|
Z(i,j) = czero
|
|
|
|
|
|
|
|
enddo
|
|
|
|
|
|
|
|
enddo
|
|
|
|
|
|
|
|
else if (beta.eq.cone) then
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
! Do nothing!
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
else if (beta.eq.-cone) then
|
|
|
|
|
|
|
|
do j=1,n
|
|
|
|
|
|
|
|
do i=1,m
|
|
|
|
|
|
|
|
Z(i,j) = - y(i,j)
|
|
|
|
|
|
|
|
enddo
|
|
|
|
|
|
|
|
enddo
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
do j=1,n
|
|
|
|
|
|
|
|
do i=1,m
|
|
|
|
|
|
|
|
Z(i,j) = beta*y(i,j)
|
|
|
|
|
|
|
|
enddo
|
|
|
|
|
|
|
|
enddo
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
else if (alpha.eq.cone) then
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (beta.eq.czero) then
|
|
|
|
|
|
|
|
do j=1,n
|
|
|
|
|
|
|
|
do i=1,m
|
|
|
|
|
|
|
|
Z(i,j) = x(i,j)
|
|
|
|
|
|
|
|
enddo
|
|
|
|
|
|
|
|
enddo
|
|
|
|
|
|
|
|
else if (beta.eq.cone) then
|
|
|
|
|
|
|
|
do j=1,n
|
|
|
|
|
|
|
|
do i=1,m
|
|
|
|
|
|
|
|
Z(i,j) = x(i,j) + y(i,j)
|
|
|
|
|
|
|
|
enddo
|
|
|
|
|
|
|
|
enddo
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
else if (beta.eq.-cone) then
|
|
|
|
|
|
|
|
do j=1,n
|
|
|
|
|
|
|
|
do i=1,m
|
|
|
|
|
|
|
|
Z(i,j) = x(i,j) - y(i,j)
|
|
|
|
|
|
|
|
enddo
|
|
|
|
|
|
|
|
enddo
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
do j=1,n
|
|
|
|
|
|
|
|
do i=1,m
|
|
|
|
|
|
|
|
Z(i,j) = x(i,j) + beta*y(i,j)
|
|
|
|
|
|
|
|
enddo
|
|
|
|
|
|
|
|
enddo
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
else if (alpha.eq.-cone) then
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (beta.eq.czero) then
|
|
|
|
|
|
|
|
do j=1,n
|
|
|
|
|
|
|
|
do i=1,m
|
|
|
|
|
|
|
|
Z(i,j) = -x(i,j)
|
|
|
|
|
|
|
|
enddo
|
|
|
|
|
|
|
|
enddo
|
|
|
|
|
|
|
|
else if (beta.eq.cone) then
|
|
|
|
|
|
|
|
do j=1,n
|
|
|
|
|
|
|
|
do i=1,m
|
|
|
|
|
|
|
|
Z(i,j) = -x(i,j) + y(i,j)
|
|
|
|
|
|
|
|
enddo
|
|
|
|
|
|
|
|
enddo
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
else if (beta.eq.-cone) then
|
|
|
|
|
|
|
|
do j=1,n
|
|
|
|
|
|
|
|
do i=1,m
|
|
|
|
|
|
|
|
Z(i,j) = -x(i,j) - y(i,j)
|
|
|
|
|
|
|
|
enddo
|
|
|
|
|
|
|
|
enddo
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
do j=1,n
|
|
|
|
|
|
|
|
do i=1,m
|
|
|
|
|
|
|
|
Z(i,j) = -x(i,j) + beta*y(i,j)
|
|
|
|
|
|
|
|
enddo
|
|
|
|
|
|
|
|
enddo
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (beta.eq.czero) then
|
|
|
|
|
|
|
|
do j=1,n
|
|
|
|
|
|
|
|
do i=1,m
|
|
|
|
|
|
|
|
Z(i,j) = alpha*x(i,j)
|
|
|
|
|
|
|
|
enddo
|
|
|
|
|
|
|
|
enddo
|
|
|
|
|
|
|
|
else if (beta.eq.cone) then
|
|
|
|
|
|
|
|
do j=1,n
|
|
|
|
|
|
|
|
do i=1,m
|
|
|
|
|
|
|
|
Z(i,j) = alpha*x(i,j) + y(i,j)
|
|
|
|
|
|
|
|
enddo
|
|
|
|
|
|
|
|
enddo
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
else if (beta.eq.-cone) then
|
|
|
|
|
|
|
|
do j=1,n
|
|
|
|
|
|
|
|
do i=1,m
|
|
|
|
|
|
|
|
Z(i,j) = alpha*x(i,j) - y(i,j)
|
|
|
|
|
|
|
|
enddo
|
|
|
|
|
|
|
|
enddo
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
do j=1,n
|
|
|
|
|
|
|
|
do i=1,m
|
|
|
|
|
|
|
|
Z(i,j) = alpha*x(i,j) + beta*y(i,j)
|
|
|
|
|
|
|
|
enddo
|
|
|
|
|
|
|
|
enddo
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9999 continue
|
|
|
|
|
|
|
|
call fcpsb_serror()
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
end subroutine caxpbyv2
|
|
|
|