mirror of
https://github.com/sfilippone/psblas3.git
synced 2026-10-20 12:52:14 +00:00
Modify clean_zeros and have it only at base%
This commit is contained in:
@@ -2403,36 +2403,36 @@ subroutine psb_s_mv_csc_from_fmt(a,b,info)
|
||||
|
||||
end subroutine psb_s_mv_csc_from_fmt
|
||||
|
||||
subroutine psb_s_csc_clean_zeros(a, info)
|
||||
use psb_error_mod
|
||||
use psb_s_csc_mat_mod, psb_protect_name => psb_s_csc_clean_zeros
|
||||
implicit none
|
||||
class(psb_s_csc_sparse_mat), intent(inout) :: a
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
!
|
||||
integer(psb_ipk_) :: i, j, k, nc
|
||||
integer(psb_ipk_), allocatable :: ilcp(:)
|
||||
|
||||
info = 0
|
||||
call a%sync()
|
||||
nc = a%get_ncols()
|
||||
ilcp = a%icp
|
||||
a%icp(1) = 1
|
||||
j = a%icp(1)
|
||||
do i=1, nc
|
||||
do k = ilcp(i), ilcp(i+1) -1
|
||||
! Always keep the diagonal, even if numerically zero
|
||||
if ((a%val(k) /= szero).or.(i == a%ia(k))) then
|
||||
a%val(j) = a%val(k)
|
||||
a%ia(j) = a%ia(k)
|
||||
j = j + 1
|
||||
end if
|
||||
end do
|
||||
a%icp(i+1) = j
|
||||
end do
|
||||
call a%trim()
|
||||
call a%set_host()
|
||||
end subroutine psb_s_csc_clean_zeros
|
||||
!!$subroutine psb_s_csc_clean_zeros(a, info)
|
||||
!!$ use psb_error_mod
|
||||
!!$ use psb_s_csc_mat_mod, psb_protect_name => psb_s_csc_clean_zeros
|
||||
!!$ implicit none
|
||||
!!$ class(psb_s_csc_sparse_mat), intent(inout) :: a
|
||||
!!$ integer(psb_ipk_), intent(out) :: info
|
||||
!!$ !
|
||||
!!$ integer(psb_ipk_) :: i, j, k, nc
|
||||
!!$ integer(psb_ipk_), allocatable :: ilcp(:)
|
||||
!!$
|
||||
!!$ info = 0
|
||||
!!$ call a%sync()
|
||||
!!$ nc = a%get_ncols()
|
||||
!!$ ilcp = a%icp
|
||||
!!$ a%icp(1) = 1
|
||||
!!$ j = a%icp(1)
|
||||
!!$ do i=1, nc
|
||||
!!$ do k = ilcp(i), ilcp(i+1) -1
|
||||
!!$ ! Always keep the diagonal, even if numerically zero
|
||||
!!$ if ((a%val(k) /= szero).or.(i == a%ia(k))) then
|
||||
!!$ a%val(j) = a%val(k)
|
||||
!!$ a%ia(j) = a%ia(k)
|
||||
!!$ j = j + 1
|
||||
!!$ end if
|
||||
!!$ end do
|
||||
!!$ a%icp(i+1) = j
|
||||
!!$ end do
|
||||
!!$ call a%trim()
|
||||
!!$ call a%set_host()
|
||||
!!$end subroutine psb_s_csc_clean_zeros
|
||||
|
||||
subroutine psb_s_cp_csc_from_fmt(a,b,info)
|
||||
use psb_const_mod
|
||||
@@ -4305,36 +4305,36 @@ subroutine psb_ls_cp_csc_from_fmt(a,b,info)
|
||||
|
||||
end subroutine psb_ls_cp_csc_from_fmt
|
||||
|
||||
subroutine psb_ls_csc_clean_zeros(a, info)
|
||||
use psb_error_mod
|
||||
use psb_s_csc_mat_mod, psb_protect_name => psb_ls_csc_clean_zeros
|
||||
implicit none
|
||||
class(psb_ls_csc_sparse_mat), intent(inout) :: a
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
!
|
||||
integer(psb_lpk_) :: i, j, k, nc
|
||||
integer(psb_lpk_), allocatable :: ilcp(:)
|
||||
|
||||
info = 0
|
||||
call a%sync()
|
||||
nc = a%get_ncols()
|
||||
ilcp = a%icp
|
||||
a%icp(1) = 1
|
||||
j = a%icp(1)
|
||||
do i=1, nc
|
||||
do k = ilcp(i), ilcp(i+1) -1
|
||||
! Always keep the diagonal, even if numerically zero
|
||||
if ((a%val(k) /= szero).or.(i == a%ia(k))) then
|
||||
a%val(j) = a%val(k)
|
||||
a%ia(j) = a%ia(k)
|
||||
j = j + 1
|
||||
end if
|
||||
end do
|
||||
a%icp(i+1) = j
|
||||
end do
|
||||
call a%trim()
|
||||
call a%set_host()
|
||||
end subroutine psb_ls_csc_clean_zeros
|
||||
!!$subroutine psb_ls_csc_clean_zeros(a, info)
|
||||
!!$ use psb_error_mod
|
||||
!!$ use psb_s_csc_mat_mod, psb_protect_name => psb_ls_csc_clean_zeros
|
||||
!!$ implicit none
|
||||
!!$ class(psb_ls_csc_sparse_mat), intent(inout) :: a
|
||||
!!$ integer(psb_ipk_), intent(out) :: info
|
||||
!!$ !
|
||||
!!$ integer(psb_lpk_) :: i, j, k, nc
|
||||
!!$ integer(psb_lpk_), allocatable :: ilcp(:)
|
||||
!!$
|
||||
!!$ info = 0
|
||||
!!$ call a%sync()
|
||||
!!$ nc = a%get_ncols()
|
||||
!!$ ilcp = a%icp
|
||||
!!$ a%icp(1) = 1
|
||||
!!$ j = a%icp(1)
|
||||
!!$ do i=1, nc
|
||||
!!$ do k = ilcp(i), ilcp(i+1) -1
|
||||
!!$ ! Always keep the diagonal, even if numerically zero
|
||||
!!$ if ((a%val(k) /= szero).or.(i == a%ia(k))) then
|
||||
!!$ a%val(j) = a%val(k)
|
||||
!!$ a%ia(j) = a%ia(k)
|
||||
!!$ j = j + 1
|
||||
!!$ end if
|
||||
!!$ end do
|
||||
!!$ a%icp(i+1) = j
|
||||
!!$ end do
|
||||
!!$ call a%trim()
|
||||
!!$ call a%set_host()
|
||||
!!$end subroutine psb_ls_csc_clean_zeros
|
||||
|
||||
|
||||
subroutine psb_ls_csc_mold(a,b,info)
|
||||
|
||||
Reference in New Issue
Block a user