Avoid division by zero in size estimate

new-parstruct
Salvatore Filippone 6 years ago
parent ed7d3aaafd
commit 715191bb77

@ -3386,8 +3386,7 @@ subroutine psb_ccsrspspmm(a,b,c,info)
nza = a%get_nzeros() nza = a%get_nzeros()
nzb = b%get_nzeros() nzb = b%get_nzeros()
nzc = 2*(nza+nzb) nzc = 2*(nza+nzb)
nze = ma*(((nza+ma-1)/ma)*((nzb+mb-1)/mb) )
nzeb = (((nza+na-1)/na)*((nzb+nb-1)/nb))*nb
! Estimate number of nonzeros on output. ! Estimate number of nonzeros on output.
! Turns out this is often a large overestimate. ! Turns out this is often a large overestimate.
call c%allocate(ma,nb,nzc) call c%allocate(ma,nb,nzc)

@ -3386,8 +3386,7 @@ subroutine psb_dcsrspspmm(a,b,c,info)
nza = a%get_nzeros() nza = a%get_nzeros()
nzb = b%get_nzeros() nzb = b%get_nzeros()
nzc = 2*(nza+nzb) nzc = 2*(nza+nzb)
nze = ma*(((nza+ma-1)/ma)*((nzb+mb-1)/mb) )
nzeb = (((nza+na-1)/na)*((nzb+nb-1)/nb))*nb
! Estimate number of nonzeros on output. ! Estimate number of nonzeros on output.
! Turns out this is often a large overestimate. ! Turns out this is often a large overestimate.
call c%allocate(ma,nb,nzc) call c%allocate(ma,nb,nzc)

@ -3386,8 +3386,7 @@ subroutine psb_scsrspspmm(a,b,c,info)
nza = a%get_nzeros() nza = a%get_nzeros()
nzb = b%get_nzeros() nzb = b%get_nzeros()
nzc = 2*(nza+nzb) nzc = 2*(nza+nzb)
nze = ma*(((nza+ma-1)/ma)*((nzb+mb-1)/mb) )
nzeb = (((nza+na-1)/na)*((nzb+nb-1)/nb))*nb
! Estimate number of nonzeros on output. ! Estimate number of nonzeros on output.
! Turns out this is often a large overestimate. ! Turns out this is often a large overestimate.
call c%allocate(ma,nb,nzc) call c%allocate(ma,nb,nzc)

@ -3386,8 +3386,7 @@ subroutine psb_zcsrspspmm(a,b,c,info)
nza = a%get_nzeros() nza = a%get_nzeros()
nzb = b%get_nzeros() nzb = b%get_nzeros()
nzc = 2*(nza+nzb) nzc = 2*(nza+nzb)
nze = ma*(((nza+ma-1)/ma)*((nzb+mb-1)/mb) )
nzeb = (((nza+na-1)/na)*((nzb+nb-1)/nb))*nb
! Estimate number of nonzeros on output. ! Estimate number of nonzeros on output.
! Turns out this is often a large overestimate. ! Turns out this is often a large overestimate.
call c%allocate(ma,nb,nzc) call c%allocate(ma,nb,nzc)

Loading…
Cancel
Save