base/modules/psb_c_base_mat_mod.f90
 base/modules/psb_c_comm_mod.f90
 base/modules/psb_c_mat_mod.f90
 base/modules/psb_d_base_mat_mod.f90
 base/modules/psb_d_comm_mod.f90
 base/modules/psb_d_mat_mod.f90
 base/modules/psb_s_base_mat_mod.f90
 base/modules/psb_s_comm_mod.f90
 base/modules/psb_s_mat_mod.f90
 base/modules/psb_z_base_mat_mod.f90
 base/modules/psb_z_comm_mod.f90
 base/modules/psb_z_mat_mod.f90
 base/serial/impl/psb_c_base_mat_impl.F90
 base/serial/impl/psb_c_coo_impl.f90
 base/serial/impl/psb_d_base_mat_impl.F90
 base/serial/impl/psb_d_coo_impl.f90
 base/serial/impl/psb_s_base_mat_impl.F90
 base/serial/impl/psb_s_coo_impl.f90
 base/serial/impl/psb_z_base_mat_impl.F90
 base/serial/impl/psb_z_coo_impl.f90

Add clean_zeros method.
This commit is contained in:
Salvatore Filippone
2015-12-17 16:52:17 +00:00
parent 337ee6b4c5
commit faafed5455
16 changed files with 308 additions and 4 deletions
+25
View File
@@ -329,6 +329,31 @@ subroutine psb_c_coo_trim(a)
end subroutine psb_c_coo_trim
subroutine psb_c_coo_clean_zeros(a, info)
use psb_error_mod
use psb_c_base_mat_mod, psb_protect_name => psb_c_coo_clean_zeros
implicit none
class(psb_c_coo_sparse_mat), intent(inout) :: a
integer(psb_ipk_) :: info
!
integer(psb_ipk_) :: i,j,k, nzin
info = 0
nzin = a%get_nzeros()
j = 0
do i=1, nzin
if (a%val(i) /= czero) then
j = j + 1
a%val(j) = a%val(i)
a%ia(j) = a%ia(i)
a%ja(j) = a%ja(i)
end if
end do
call a%set_nzeros(j)
call a%trim()
end subroutine psb_c_coo_clean_zeros
subroutine psb_c_coo_allocate_mnnz(m,n,a,nz)
use psb_c_base_mat_mod, psb_protect_name => psb_c_coo_allocate_mnnz