Define coo%ensure_size method

pizdaint-runs
Salvatore Filippone 5 years ago
parent ae051a2ea1
commit 487fa54f06

@ -162,6 +162,7 @@ module psb_c_base_mat_mod
procedure, pass(a) :: sizeof => c_coo_sizeof
procedure, pass(a) :: reallocate_nz => psb_c_coo_reallocate_nz
procedure, pass(a) :: allocate_mnnz => psb_c_coo_allocate_mnnz
procedure, pass(a) :: ensure_size => psb_c_coo_ensure_size
procedure, pass(a) :: cp_to_coo => psb_c_cp_coo_to_coo
procedure, pass(a) :: cp_from_coo => psb_c_cp_coo_from_coo
procedure, pass(a) :: cp_to_fmt => psb_c_cp_coo_to_fmt
@ -348,6 +349,7 @@ module psb_c_base_mat_mod
procedure, pass(a) :: sizeof => lc_coo_sizeof
procedure, pass(a) :: reallocate_nz => psb_lc_coo_reallocate_nz
procedure, pass(a) :: allocate_mnnz => psb_lc_coo_allocate_mnnz
procedure, pass(a) :: ensure_size => psb_lc_coo_ensure_size
procedure, pass(a) :: cp_to_coo => psb_lc_cp_coo_to_coo
procedure, pass(a) :: cp_from_coo => psb_lc_cp_coo_from_coo
procedure, pass(a) :: cp_to_fmt => psb_lc_cp_coo_to_fmt
@ -1579,6 +1581,17 @@ module psb_c_base_mat_mod
class(psb_c_coo_sparse_mat), intent(inout) :: a
end subroutine psb_c_coo_reallocate_nz
end interface
!
!>
!! \memberof psb_c_coo_sparse_mat
!
interface
subroutine psb_c_coo_ensure_size(nz,a)
import
integer(psb_ipk_), intent(in) :: nz
class(psb_c_coo_sparse_mat), intent(inout) :: a
end subroutine psb_c_coo_ensure_size
end interface
!
!>
@ -3083,6 +3096,17 @@ module psb_c_base_mat_mod
class(psb_lc_coo_sparse_mat), intent(inout) :: a
end subroutine psb_lc_coo_reallocate_nz
end interface
!
!>
!! \memberof psb_lc_coo_sparse_mat
!
interface
subroutine psb_lc_coo_ensure_size(nz,a)
import
integer(psb_lpk_), intent(in) :: nz
class(psb_lc_coo_sparse_mat), intent(inout) :: a
end subroutine psb_lc_coo_ensure_size
end interface
!
!>

@ -162,6 +162,7 @@ module psb_d_base_mat_mod
procedure, pass(a) :: sizeof => d_coo_sizeof
procedure, pass(a) :: reallocate_nz => psb_d_coo_reallocate_nz
procedure, pass(a) :: allocate_mnnz => psb_d_coo_allocate_mnnz
procedure, pass(a) :: ensure_size => psb_d_coo_ensure_size
procedure, pass(a) :: cp_to_coo => psb_d_cp_coo_to_coo
procedure, pass(a) :: cp_from_coo => psb_d_cp_coo_from_coo
procedure, pass(a) :: cp_to_fmt => psb_d_cp_coo_to_fmt
@ -348,6 +349,7 @@ module psb_d_base_mat_mod
procedure, pass(a) :: sizeof => ld_coo_sizeof
procedure, pass(a) :: reallocate_nz => psb_ld_coo_reallocate_nz
procedure, pass(a) :: allocate_mnnz => psb_ld_coo_allocate_mnnz
procedure, pass(a) :: ensure_size => psb_ld_coo_ensure_size
procedure, pass(a) :: cp_to_coo => psb_ld_cp_coo_to_coo
procedure, pass(a) :: cp_from_coo => psb_ld_cp_coo_from_coo
procedure, pass(a) :: cp_to_fmt => psb_ld_cp_coo_to_fmt
@ -1579,6 +1581,17 @@ module psb_d_base_mat_mod
class(psb_d_coo_sparse_mat), intent(inout) :: a
end subroutine psb_d_coo_reallocate_nz
end interface
!
!>
!! \memberof psb_d_coo_sparse_mat
!
interface
subroutine psb_d_coo_ensure_size(nz,a)
import
integer(psb_ipk_), intent(in) :: nz
class(psb_d_coo_sparse_mat), intent(inout) :: a
end subroutine psb_d_coo_ensure_size
end interface
!
!>
@ -3083,6 +3096,17 @@ module psb_d_base_mat_mod
class(psb_ld_coo_sparse_mat), intent(inout) :: a
end subroutine psb_ld_coo_reallocate_nz
end interface
!
!>
!! \memberof psb_ld_coo_sparse_mat
!
interface
subroutine psb_ld_coo_ensure_size(nz,a)
import
integer(psb_lpk_), intent(in) :: nz
class(psb_ld_coo_sparse_mat), intent(inout) :: a
end subroutine psb_ld_coo_ensure_size
end interface
!
!>

@ -162,6 +162,7 @@ module psb_s_base_mat_mod
procedure, pass(a) :: sizeof => s_coo_sizeof
procedure, pass(a) :: reallocate_nz => psb_s_coo_reallocate_nz
procedure, pass(a) :: allocate_mnnz => psb_s_coo_allocate_mnnz
procedure, pass(a) :: ensure_size => psb_s_coo_ensure_size
procedure, pass(a) :: cp_to_coo => psb_s_cp_coo_to_coo
procedure, pass(a) :: cp_from_coo => psb_s_cp_coo_from_coo
procedure, pass(a) :: cp_to_fmt => psb_s_cp_coo_to_fmt
@ -348,6 +349,7 @@ module psb_s_base_mat_mod
procedure, pass(a) :: sizeof => ls_coo_sizeof
procedure, pass(a) :: reallocate_nz => psb_ls_coo_reallocate_nz
procedure, pass(a) :: allocate_mnnz => psb_ls_coo_allocate_mnnz
procedure, pass(a) :: ensure_size => psb_ls_coo_ensure_size
procedure, pass(a) :: cp_to_coo => psb_ls_cp_coo_to_coo
procedure, pass(a) :: cp_from_coo => psb_ls_cp_coo_from_coo
procedure, pass(a) :: cp_to_fmt => psb_ls_cp_coo_to_fmt
@ -1579,6 +1581,17 @@ module psb_s_base_mat_mod
class(psb_s_coo_sparse_mat), intent(inout) :: a
end subroutine psb_s_coo_reallocate_nz
end interface
!
!>
!! \memberof psb_s_coo_sparse_mat
!
interface
subroutine psb_s_coo_ensure_size(nz,a)
import
integer(psb_ipk_), intent(in) :: nz
class(psb_s_coo_sparse_mat), intent(inout) :: a
end subroutine psb_s_coo_ensure_size
end interface
!
!>
@ -3083,6 +3096,17 @@ module psb_s_base_mat_mod
class(psb_ls_coo_sparse_mat), intent(inout) :: a
end subroutine psb_ls_coo_reallocate_nz
end interface
!
!>
!! \memberof psb_ls_coo_sparse_mat
!
interface
subroutine psb_ls_coo_ensure_size(nz,a)
import
integer(psb_lpk_), intent(in) :: nz
class(psb_ls_coo_sparse_mat), intent(inout) :: a
end subroutine psb_ls_coo_ensure_size
end interface
!
!>

@ -162,6 +162,7 @@ module psb_z_base_mat_mod
procedure, pass(a) :: sizeof => z_coo_sizeof
procedure, pass(a) :: reallocate_nz => psb_z_coo_reallocate_nz
procedure, pass(a) :: allocate_mnnz => psb_z_coo_allocate_mnnz
procedure, pass(a) :: ensure_size => psb_z_coo_ensure_size
procedure, pass(a) :: cp_to_coo => psb_z_cp_coo_to_coo
procedure, pass(a) :: cp_from_coo => psb_z_cp_coo_from_coo
procedure, pass(a) :: cp_to_fmt => psb_z_cp_coo_to_fmt
@ -348,6 +349,7 @@ module psb_z_base_mat_mod
procedure, pass(a) :: sizeof => lz_coo_sizeof
procedure, pass(a) :: reallocate_nz => psb_lz_coo_reallocate_nz
procedure, pass(a) :: allocate_mnnz => psb_lz_coo_allocate_mnnz
procedure, pass(a) :: ensure_size => psb_lz_coo_ensure_size
procedure, pass(a) :: cp_to_coo => psb_lz_cp_coo_to_coo
procedure, pass(a) :: cp_from_coo => psb_lz_cp_coo_from_coo
procedure, pass(a) :: cp_to_fmt => psb_lz_cp_coo_to_fmt
@ -1579,6 +1581,17 @@ module psb_z_base_mat_mod
class(psb_z_coo_sparse_mat), intent(inout) :: a
end subroutine psb_z_coo_reallocate_nz
end interface
!
!>
!! \memberof psb_z_coo_sparse_mat
!
interface
subroutine psb_z_coo_ensure_size(nz,a)
import
integer(psb_ipk_), intent(in) :: nz
class(psb_z_coo_sparse_mat), intent(inout) :: a
end subroutine psb_z_coo_ensure_size
end interface
!
!>
@ -3083,6 +3096,17 @@ module psb_z_base_mat_mod
class(psb_lz_coo_sparse_mat), intent(inout) :: a
end subroutine psb_lz_coo_reallocate_nz
end interface
!
!>
!! \memberof psb_lz_coo_sparse_mat
!
interface
subroutine psb_lz_coo_ensure_size(nz,a)
import
integer(psb_lpk_), intent(in) :: nz
class(psb_lz_coo_sparse_mat), intent(inout) :: a
end subroutine psb_lz_coo_ensure_size
end interface
!
!>

@ -211,6 +211,38 @@ subroutine psb_c_coo_reallocate_nz(nz,a)
end subroutine psb_c_coo_reallocate_nz
subroutine psb_c_coo_ensure_size(nz,a)
use psb_c_base_mat_mod, psb_protect_name => psb_c_coo_ensure_size
use psb_error_mod
use psb_realloc_mod
implicit none
integer(psb_ipk_), intent(in) :: nz
class(psb_c_coo_sparse_mat), intent(inout) :: a
integer(psb_ipk_) :: err_act, info, nz_
character(len=20) :: name='c_coo_ensure_size'
logical, parameter :: debug=.false.
call psb_erractionsave(err_act)
nz_ = max(nz,ione)
call psb_ensure_size(nz_,a%ia,info)
if (info == psb_success_) call psb_ensure_size(nz_,a%ja,info)
if (info == psb_success_) call psb_ensure_size(nz_,a%val,info)
if (info /= psb_success_) then
call psb_errpush(psb_err_alloc_dealloc_,name)
goto 9999
end if
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine psb_c_coo_ensure_size
subroutine psb_c_coo_mold(a,b,info)
use psb_c_base_mat_mod, psb_protect_name => psb_c_coo_mold
use psb_error_mod
@ -1618,7 +1650,7 @@ subroutine psb_c_coo_csmm(alpha,a,x,beta,y,info,trans)
end if !.....end testing on alpha
else if (ctra) then
else if (ctra) then !
if (alpha == cone) then
i = 1
@ -4555,6 +4587,38 @@ subroutine psb_lc_coo_reallocate_nz(nz,a)
end subroutine psb_lc_coo_reallocate_nz
subroutine psb_lc_coo_ensure_size(nz,a)
use psb_c_base_mat_mod, psb_protect_name => psb_lc_coo_ensure_size
use psb_error_mod
use psb_realloc_mod
implicit none
integer(psb_lpk_), intent(in) :: nz
class(psb_lc_coo_sparse_mat), intent(inout) :: a
integer(psb_ipk_) :: err_act, info, nz_
character(len=20) :: name='lc_coo_ensure_size'
logical, parameter :: debug=.false.
call psb_erractionsave(err_act)
nz_ = max(nz,ione)
call psb_ensure_size(nz_,a%ia,info)
if (info == psb_success_) call psb_ensure_size(nz_,a%ja,info)
if (info == psb_success_) call psb_ensure_size(nz_,a%val,info)
if (info /= psb_success_) then
call psb_errpush(psb_err_alloc_dealloc_,name)
goto 9999
end if
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine psb_lc_coo_ensure_size
subroutine psb_lc_coo_mold(a,b,info)
use psb_c_base_mat_mod, psb_protect_name => psb_lc_coo_mold
use psb_error_mod

@ -211,6 +211,38 @@ subroutine psb_d_coo_reallocate_nz(nz,a)
end subroutine psb_d_coo_reallocate_nz
subroutine psb_d_coo_ensure_size(nz,a)
use psb_d_base_mat_mod, psb_protect_name => psb_d_coo_ensure_size
use psb_error_mod
use psb_realloc_mod
implicit none
integer(psb_ipk_), intent(in) :: nz
class(psb_d_coo_sparse_mat), intent(inout) :: a
integer(psb_ipk_) :: err_act, info, nz_
character(len=20) :: name='d_coo_ensure_size'
logical, parameter :: debug=.false.
call psb_erractionsave(err_act)
nz_ = max(nz,ione)
call psb_ensure_size(nz_,a%ia,info)
if (info == psb_success_) call psb_ensure_size(nz_,a%ja,info)
if (info == psb_success_) call psb_ensure_size(nz_,a%val,info)
if (info /= psb_success_) then
call psb_errpush(psb_err_alloc_dealloc_,name)
goto 9999
end if
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine psb_d_coo_ensure_size
subroutine psb_d_coo_mold(a,b,info)
use psb_d_base_mat_mod, psb_protect_name => psb_d_coo_mold
use psb_error_mod
@ -1618,7 +1650,7 @@ subroutine psb_d_coo_csmm(alpha,a,x,beta,y,info,trans)
end if !.....end testing on alpha
else if (ctra) then
else if (ctra) then !
if (alpha == done) then
i = 1
@ -4555,6 +4587,38 @@ subroutine psb_ld_coo_reallocate_nz(nz,a)
end subroutine psb_ld_coo_reallocate_nz
subroutine psb_ld_coo_ensure_size(nz,a)
use psb_d_base_mat_mod, psb_protect_name => psb_ld_coo_ensure_size
use psb_error_mod
use psb_realloc_mod
implicit none
integer(psb_lpk_), intent(in) :: nz
class(psb_ld_coo_sparse_mat), intent(inout) :: a
integer(psb_ipk_) :: err_act, info, nz_
character(len=20) :: name='ld_coo_ensure_size'
logical, parameter :: debug=.false.
call psb_erractionsave(err_act)
nz_ = max(nz,ione)
call psb_ensure_size(nz_,a%ia,info)
if (info == psb_success_) call psb_ensure_size(nz_,a%ja,info)
if (info == psb_success_) call psb_ensure_size(nz_,a%val,info)
if (info /= psb_success_) then
call psb_errpush(psb_err_alloc_dealloc_,name)
goto 9999
end if
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine psb_ld_coo_ensure_size
subroutine psb_ld_coo_mold(a,b,info)
use psb_d_base_mat_mod, psb_protect_name => psb_ld_coo_mold
use psb_error_mod

@ -211,6 +211,38 @@ subroutine psb_s_coo_reallocate_nz(nz,a)
end subroutine psb_s_coo_reallocate_nz
subroutine psb_s_coo_ensure_size(nz,a)
use psb_s_base_mat_mod, psb_protect_name => psb_s_coo_ensure_size
use psb_error_mod
use psb_realloc_mod
implicit none
integer(psb_ipk_), intent(in) :: nz
class(psb_s_coo_sparse_mat), intent(inout) :: a
integer(psb_ipk_) :: err_act, info, nz_
character(len=20) :: name='s_coo_ensure_size'
logical, parameter :: debug=.false.
call psb_erractionsave(err_act)
nz_ = max(nz,ione)
call psb_ensure_size(nz_,a%ia,info)
if (info == psb_success_) call psb_ensure_size(nz_,a%ja,info)
if (info == psb_success_) call psb_ensure_size(nz_,a%val,info)
if (info /= psb_success_) then
call psb_errpush(psb_err_alloc_dealloc_,name)
goto 9999
end if
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine psb_s_coo_ensure_size
subroutine psb_s_coo_mold(a,b,info)
use psb_s_base_mat_mod, psb_protect_name => psb_s_coo_mold
use psb_error_mod
@ -1618,7 +1650,7 @@ subroutine psb_s_coo_csmm(alpha,a,x,beta,y,info,trans)
end if !.....end testing on alpha
else if (ctra) then
else if (ctra) then !
if (alpha == sone) then
i = 1
@ -4555,6 +4587,38 @@ subroutine psb_ls_coo_reallocate_nz(nz,a)
end subroutine psb_ls_coo_reallocate_nz
subroutine psb_ls_coo_ensure_size(nz,a)
use psb_s_base_mat_mod, psb_protect_name => psb_ls_coo_ensure_size
use psb_error_mod
use psb_realloc_mod
implicit none
integer(psb_lpk_), intent(in) :: nz
class(psb_ls_coo_sparse_mat), intent(inout) :: a
integer(psb_ipk_) :: err_act, info, nz_
character(len=20) :: name='ls_coo_ensure_size'
logical, parameter :: debug=.false.
call psb_erractionsave(err_act)
nz_ = max(nz,ione)
call psb_ensure_size(nz_,a%ia,info)
if (info == psb_success_) call psb_ensure_size(nz_,a%ja,info)
if (info == psb_success_) call psb_ensure_size(nz_,a%val,info)
if (info /= psb_success_) then
call psb_errpush(psb_err_alloc_dealloc_,name)
goto 9999
end if
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine psb_ls_coo_ensure_size
subroutine psb_ls_coo_mold(a,b,info)
use psb_s_base_mat_mod, psb_protect_name => psb_ls_coo_mold
use psb_error_mod

@ -211,6 +211,38 @@ subroutine psb_z_coo_reallocate_nz(nz,a)
end subroutine psb_z_coo_reallocate_nz
subroutine psb_z_coo_ensure_size(nz,a)
use psb_z_base_mat_mod, psb_protect_name => psb_z_coo_ensure_size
use psb_error_mod
use psb_realloc_mod
implicit none
integer(psb_ipk_), intent(in) :: nz
class(psb_z_coo_sparse_mat), intent(inout) :: a
integer(psb_ipk_) :: err_act, info, nz_
character(len=20) :: name='z_coo_ensure_size'
logical, parameter :: debug=.false.
call psb_erractionsave(err_act)
nz_ = max(nz,ione)
call psb_ensure_size(nz_,a%ia,info)
if (info == psb_success_) call psb_ensure_size(nz_,a%ja,info)
if (info == psb_success_) call psb_ensure_size(nz_,a%val,info)
if (info /= psb_success_) then
call psb_errpush(psb_err_alloc_dealloc_,name)
goto 9999
end if
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine psb_z_coo_ensure_size
subroutine psb_z_coo_mold(a,b,info)
use psb_z_base_mat_mod, psb_protect_name => psb_z_coo_mold
use psb_error_mod
@ -1618,7 +1650,7 @@ subroutine psb_z_coo_csmm(alpha,a,x,beta,y,info,trans)
end if !.....end testing on alpha
else if (ctra) then
else if (ctra) then !
if (alpha == zone) then
i = 1
@ -4555,6 +4587,38 @@ subroutine psb_lz_coo_reallocate_nz(nz,a)
end subroutine psb_lz_coo_reallocate_nz
subroutine psb_lz_coo_ensure_size(nz,a)
use psb_z_base_mat_mod, psb_protect_name => psb_lz_coo_ensure_size
use psb_error_mod
use psb_realloc_mod
implicit none
integer(psb_lpk_), intent(in) :: nz
class(psb_lz_coo_sparse_mat), intent(inout) :: a
integer(psb_ipk_) :: err_act, info, nz_
character(len=20) :: name='lz_coo_ensure_size'
logical, parameter :: debug=.false.
call psb_erractionsave(err_act)
nz_ = max(nz,ione)
call psb_ensure_size(nz_,a%ia,info)
if (info == psb_success_) call psb_ensure_size(nz_,a%ja,info)
if (info == psb_success_) call psb_ensure_size(nz_,a%val,info)
if (info /= psb_success_) then
call psb_errpush(psb_err_alloc_dealloc_,name)
goto 9999
end if
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine psb_lz_coo_ensure_size
subroutine psb_lz_coo_mold(a,b,info)
use psb_z_base_mat_mod, psb_protect_name => psb_lz_coo_mold
use psb_error_mod

Loading…
Cancel
Save