|
|
@ -1485,48 +1485,48 @@ subroutine psb_c_csc_scals(d,a,info)
|
|
|
|
|
|
|
|
|
|
|
|
end subroutine psb_c_csc_scals
|
|
|
|
end subroutine psb_c_csc_scals
|
|
|
|
|
|
|
|
|
|
|
|
subroutine psb_c_csc_scalplusidentity(d,a,info)
|
|
|
|
! subroutine psb_c_csc_scalplusidentity(d,a,info)
|
|
|
|
use psb_error_mod
|
|
|
|
! use psb_error_mod
|
|
|
|
use psb_const_mod
|
|
|
|
! use psb_const_mod
|
|
|
|
use psb_c_csc_mat_mod, psb_protect_name => psb_c_csc_scalplusidentity
|
|
|
|
! use psb_c_csc_mat_mod, psb_protect_name => psb_c_csc_scalplusidentity
|
|
|
|
implicit none
|
|
|
|
! implicit none
|
|
|
|
class(psb_c_csc_sparse_mat), intent(inout) :: a
|
|
|
|
! class(psb_c_csc_sparse_mat), intent(inout) :: a
|
|
|
|
complex(psb_spk_), intent(in) :: d
|
|
|
|
! complex(psb_spk_), intent(in) :: d
|
|
|
|
integer(psb_ipk_), intent(out) :: info
|
|
|
|
! integer(psb_ipk_), intent(out) :: info
|
|
|
|
|
|
|
|
!
|
|
|
|
integer(psb_ipk_) :: err_act,mnm, i, j, k, m
|
|
|
|
! integer(psb_ipk_) :: err_act,mnm, i, j, k, m
|
|
|
|
integer(psb_ipk_) :: ierr(5)
|
|
|
|
! integer(psb_ipk_) :: ierr(5)
|
|
|
|
character(len=20) :: name='scalplusidentity'
|
|
|
|
! character(len=20) :: name='scalplusidentity'
|
|
|
|
logical, parameter :: debug=.false.
|
|
|
|
! logical, parameter :: debug=.false.
|
|
|
|
|
|
|
|
!
|
|
|
|
info = psb_success_
|
|
|
|
! info = psb_success_
|
|
|
|
call psb_erractionsave(err_act)
|
|
|
|
! call psb_erractionsave(err_act)
|
|
|
|
if (a%is_dev()) call a%sync()
|
|
|
|
! if (a%is_dev()) call a%sync()
|
|
|
|
|
|
|
|
!
|
|
|
|
if (a%is_unit()) then
|
|
|
|
! if (a%is_unit()) then
|
|
|
|
call a%make_nonunit()
|
|
|
|
! call a%make_nonunit()
|
|
|
|
end if
|
|
|
|
! end if
|
|
|
|
|
|
|
|
!
|
|
|
|
mnm = min(a%get_nrows(),a%get_ncols())
|
|
|
|
! mnm = min(a%get_nrows(),a%get_ncols())
|
|
|
|
do i=1,a%get_nzeros()
|
|
|
|
! do i=1,a%get_nzeros()
|
|
|
|
a%val(i) = a%val(i) * d
|
|
|
|
! a%val(i) = a%val(i) * d
|
|
|
|
do k=a%icp(i),a%icp(i+1)-1
|
|
|
|
! do k=a%icp(i),a%icp(i+1)-1
|
|
|
|
j=a%ia(k)
|
|
|
|
! j=a%ia(k)
|
|
|
|
if ((j == i) .and.(j <= mnm )) then
|
|
|
|
! if ((j == i) .and.(j <= mnm )) then
|
|
|
|
a%val(k) = a%val(k) + cone
|
|
|
|
! a%val(k) = a%val(k) + cone
|
|
|
|
endif
|
|
|
|
! endif
|
|
|
|
enddo
|
|
|
|
! enddo
|
|
|
|
enddo
|
|
|
|
! enddo
|
|
|
|
call a%set_host()
|
|
|
|
! call a%set_host()
|
|
|
|
|
|
|
|
!
|
|
|
|
call psb_erractionrestore(err_act)
|
|
|
|
! call psb_erractionrestore(err_act)
|
|
|
|
return
|
|
|
|
! return
|
|
|
|
|
|
|
|
!
|
|
|
|
9999 call psb_error_handler(err_act)
|
|
|
|
! 9999 call psb_error_handler(err_act)
|
|
|
|
|
|
|
|
!
|
|
|
|
return
|
|
|
|
! return
|
|
|
|
|
|
|
|
!
|
|
|
|
end subroutine psb_c_csc_scalplusidentity
|
|
|
|
! end subroutine psb_c_csc_scalplusidentity
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
! == ===================================
|
|
|
|
! == ===================================
|
|
|
@ -3107,48 +3107,48 @@ subroutine psb_lc_csc_scals(d,a,info)
|
|
|
|
|
|
|
|
|
|
|
|
end subroutine psb_lc_csc_scals
|
|
|
|
end subroutine psb_lc_csc_scals
|
|
|
|
|
|
|
|
|
|
|
|
subroutine psb_lc_csc_scalplusidentity(d,a,info)
|
|
|
|
! subroutine psb_lc_csc_scalplusidentity(d,a,info)
|
|
|
|
use psb_error_mod
|
|
|
|
! use psb_error_mod
|
|
|
|
use psb_const_mod
|
|
|
|
! use psb_const_mod
|
|
|
|
use psb_c_csc_mat_mod, psb_protect_name => psb_lc_csc_scalplusidentity
|
|
|
|
! use psb_c_csc_mat_mod, psb_protect_name => psb_lc_csc_scalplusidentity
|
|
|
|
implicit none
|
|
|
|
! implicit none
|
|
|
|
class(psb_lc_csc_sparse_mat), intent(inout) :: a
|
|
|
|
! class(psb_lc_csc_sparse_mat), intent(inout) :: a
|
|
|
|
complex(psb_spk_), intent(in) :: d
|
|
|
|
! complex(psb_spk_), intent(in) :: d
|
|
|
|
integer(psb_ipk_), intent(out) :: info
|
|
|
|
! integer(psb_ipk_), intent(out) :: info
|
|
|
|
|
|
|
|
!
|
|
|
|
integer(psb_lpk_) :: mnm, i, j, k, m
|
|
|
|
! integer(psb_lpk_) :: mnm, i, j, k, m
|
|
|
|
integer(psb_ipk_) :: err_act, ierr(5)
|
|
|
|
! integer(psb_ipk_) :: err_act, ierr(5)
|
|
|
|
character(len=20) :: name='scalplusidentity'
|
|
|
|
! character(len=20) :: name='scalplusidentity'
|
|
|
|
logical, parameter :: debug=.false.
|
|
|
|
! logical, parameter :: debug=.false.
|
|
|
|
|
|
|
|
!
|
|
|
|
info = psb_success_
|
|
|
|
! info = psb_success_
|
|
|
|
call psb_erractionsave(err_act)
|
|
|
|
! call psb_erractionsave(err_act)
|
|
|
|
if (a%is_dev()) call a%sync()
|
|
|
|
! if (a%is_dev()) call a%sync()
|
|
|
|
|
|
|
|
!
|
|
|
|
if (a%is_unit()) then
|
|
|
|
! if (a%is_unit()) then
|
|
|
|
call a%make_nonunit()
|
|
|
|
! call a%make_nonunit()
|
|
|
|
end if
|
|
|
|
! end if
|
|
|
|
|
|
|
|
!
|
|
|
|
mnm = min(a%get_nrows(),a%get_ncols())
|
|
|
|
! mnm = min(a%get_nrows(),a%get_ncols())
|
|
|
|
do i=1,a%get_nzeros()
|
|
|
|
! do i=1,a%get_nzeros()
|
|
|
|
a%val(i) = a%val(i) * d
|
|
|
|
! a%val(i) = a%val(i) * d
|
|
|
|
do k=a%icp(i),a%icp(i+1)-1
|
|
|
|
! do k=a%icp(i),a%icp(i+1)-1
|
|
|
|
j=a%ia(k)
|
|
|
|
! j=a%ia(k)
|
|
|
|
if ((j == i) .and.(j <= mnm )) then
|
|
|
|
! if ((j == i) .and.(j <= mnm )) then
|
|
|
|
a%val(k) = a%val(k) + cone
|
|
|
|
! a%val(k) = a%val(k) + cone
|
|
|
|
endif
|
|
|
|
! endif
|
|
|
|
enddo
|
|
|
|
! enddo
|
|
|
|
enddo
|
|
|
|
! enddo
|
|
|
|
call a%set_host()
|
|
|
|
! call a%set_host()
|
|
|
|
|
|
|
|
!
|
|
|
|
call psb_erractionrestore(err_act)
|
|
|
|
! call psb_erractionrestore(err_act)
|
|
|
|
return
|
|
|
|
! return
|
|
|
|
|
|
|
|
!
|
|
|
|
9999 call psb_error_handler(err_act)
|
|
|
|
! 9999 call psb_error_handler(err_act)
|
|
|
|
|
|
|
|
!
|
|
|
|
return
|
|
|
|
! return
|
|
|
|
|
|
|
|
!
|
|
|
|
end subroutine psb_lc_csc_scalplusidentity
|
|
|
|
! end subroutine psb_lc_csc_scalplusidentity
|
|
|
|
|
|
|
|
|
|
|
|
function psb_lc_csc_maxval(a) result(res)
|
|
|
|
function psb_lc_csc_maxval(a) result(res)
|
|
|
|
use psb_error_mod
|
|
|
|
use psb_error_mod
|
|
|
|