From 4a274e43ff6f5b4dc0b2bfd5771baf2eb74f5ecf Mon Sep 17 00:00:00 2001 From: Salvatore Filippone Date: Mon, 2 Nov 2020 21:27:34 +0100 Subject: [PATCH] cosmetic fixes --- base/serial/psi_d_serial_impl.f90 | 94 +++++++++++++++++++++++++++++-- 1 file changed, 89 insertions(+), 5 deletions(-) diff --git a/base/serial/psi_d_serial_impl.f90 b/base/serial/psi_d_serial_impl.f90 index 0d80f459..bdc7467a 100644 --- a/base/serial/psi_d_serial_impl.f90 +++ b/base/serial/psi_d_serial_impl.f90 @@ -42,7 +42,7 @@ subroutine psi_daxpby(m,n,alpha, x, beta, y, info) integer(psb_ipk_) :: err_act integer(psb_ipk_) :: lx, ly integer(psb_ipk_) :: ierr(5) - character(len=20) :: name, ch_err + character(len=20) :: name, ch_err name='psb_geaxpby' info=psb_success_ @@ -78,8 +78,9 @@ subroutine psi_daxpby(m,n,alpha, x, beta, y, info) goto 9999 end if - if ((m>0).and.(n>0)) call daxpby(m,n,alpha,x,lx,beta,y,ly,info) + if (m>0) call daxpby(m,ione,alpha,x,lx,beta,y,ly,info) + call psb_erractionrestore(err_act) return @@ -99,9 +100,9 @@ subroutine psi_daxpbyv(m,alpha, x, beta, y, info) real(psb_dpk_), intent (in) :: alpha, beta integer(psb_ipk_), intent(out) :: info integer(psb_ipk_) :: err_act - integer(psb_ipk_) :: lx, ly + integer(psb_ipk_) :: lx, ly, i integer(psb_ipk_) :: ierr(5) - character(len=20) :: name, ch_err + character(len=20) :: name, ch_err name='psb_geaxpby' info=psb_success_ @@ -131,7 +132,90 @@ subroutine psi_daxpbyv(m,alpha, x, beta, y, info) goto 9999 end if - if (m>0) call daxpby(m,ione,alpha,x,lx,beta,y,ly,info) + + if (alpha.eq.@XZERO@) then + if (beta.eq.@XZERO@) then + do i=1,m + y(i) = @XZERO@ + enddo + else if (beta.eq.@XONE@) then + ! + ! Do nothing! + ! + + else if (beta.eq.-@XONE@) then + do i=1,m + y(i) = - y(i) + enddo + else + do i=1,m + y(i) = beta*y(i) + enddo + endif + + else if (alpha.eq.@XONE@) then + + if (beta.eq.@XZERO@) then + do i=1,m + y(i) = x(i) + enddo + else if (beta.eq.@XONE@) then + do i=1,m + y(i) = x(i) + y(i) + enddo + + else if (beta.eq.-@XONE@) then + do i=1,m + y(i) = x(i) - y(i) + enddo + else + do i=1,m + y(i) = x(i) + beta*y(i) + enddo + endif + + else if (alpha.eq.-@XONE@) then + + if (beta.eq.@XZERO@) then + do i=1,m + y(i) = -x(i) + enddo + else if (beta.eq.@XONE@) then + do i=1,m + y(i) = -x(i) + y(i) + enddo + else if (beta.eq.-@XONE@) then + do i=1,m + y(i) = -x(i) - y(i) + enddo + else + do i=1,m + y(i) = -x(i) + beta*y(i) + enddo + endif + + else + + if (beta.eq.@XZERO@) then + do i=1,m + y(i) = alpha*x(i) + enddo + else if (beta.eq.@XONE@) then + do i=1,m + y(i) = alpha*x(i) + y(i) + enddo + else if (beta.eq.-@XONE@) then + do i=1,m + y(i) = alpha*x(i) - y(i) + enddo + else + do i=1,m + y(i) = alpha*x(i) + beta*y(i) + enddo + endif + + endif + call psb_erractionrestore(err_act) return