|
|
|
@ -176,6 +176,30 @@ contains
|
|
|
|
|
|
|
|
|
|
|
|
end function psb_c_zvect_set_scal
|
|
|
|
end function psb_c_zvect_set_scal
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function psb_c_zvect_set_scal_bound(x,val,ifirst,ilast) bind(c) result(info)
|
|
|
|
|
|
|
|
use psb_base_mod
|
|
|
|
|
|
|
|
implicit none
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
type(psb_c_zvector) :: x
|
|
|
|
|
|
|
|
type(psb_z_vect_type), pointer :: xp
|
|
|
|
|
|
|
|
integer(psb_c_ipk_) :: info
|
|
|
|
|
|
|
|
integer(psb_c_ipk_), value :: ifirst, ilast
|
|
|
|
|
|
|
|
complex(c_double_complex) :: val
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
info = -1;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (c_associated(x%item)) then
|
|
|
|
|
|
|
|
call c_f_pointer(x%item,xp)
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
call xp%set(val,first=ifirst,last=ilast)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
info = 0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
end function psb_c_zvect_set_scal_bound
|
|
|
|
|
|
|
|
|
|
|
|
function psb_c_zvect_set_vect(x,val,n) bind(c) result(info)
|
|
|
|
function psb_c_zvect_set_vect(x,val,n) bind(c) result(info)
|
|
|
|
use psb_base_mod
|
|
|
|
use psb_base_mod
|
|
|
|
implicit none
|
|
|
|
implicit none
|
|
|
|
@ -246,28 +270,232 @@ contains
|
|
|
|
res = xp%get_entry((index+(1-ixb)))
|
|
|
|
res = xp%get_entry((index+(1-ixb)))
|
|
|
|
end function psb_c_zvect_get_entry
|
|
|
|
end function psb_c_zvect_get_entry
|
|
|
|
|
|
|
|
|
|
|
|
function psb_c_zvect_clone(xh,yh) bind(c) result(info)
|
|
|
|
function psb_c_znnz(ah,cdh) bind(c) result(res)
|
|
|
|
implicit none
|
|
|
|
implicit none
|
|
|
|
|
|
|
|
integer(psb_c_ipk_) :: res
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
type(psb_c_zspmat) :: ah
|
|
|
|
|
|
|
|
type(psb_c_descriptor) :: cdh
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
type(psb_desc_type), pointer :: descp
|
|
|
|
|
|
|
|
type(psb_zspmat_type), pointer :: ap
|
|
|
|
|
|
|
|
integer(psb_c_ipk_) :: info
|
|
|
|
|
|
|
|
|
|
|
|
integer(psb_c_ipk_) :: info
|
|
|
|
res = 0
|
|
|
|
type(psb_c_zvector) :: xh,yh
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
type(psb_z_vect_type), pointer :: xp,yp
|
|
|
|
if (c_associated(cdh%item)) then
|
|
|
|
|
|
|
|
call c_f_pointer(cdh%item,descp)
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
if (c_associated(ah%item)) then
|
|
|
|
|
|
|
|
call c_f_pointer(ah%item,ap)
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
|
|
info = -1
|
|
|
|
res = psb_nnz(ap,descp,info)
|
|
|
|
|
|
|
|
|
|
|
|
if (c_associated(xh%item)) then
|
|
|
|
end function psb_c_znnz
|
|
|
|
call c_f_pointer(xh%item,xp)
|
|
|
|
|
|
|
|
|
|
|
|
function psb_c_zis_matupd(ah,cdh) bind(c) result(res)
|
|
|
|
|
|
|
|
implicit none
|
|
|
|
|
|
|
|
logical(c_bool) :: res
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
type(psb_c_zspmat) :: ah
|
|
|
|
|
|
|
|
type(psb_c_descriptor) :: cdh
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
type(psb_desc_type), pointer :: descp
|
|
|
|
|
|
|
|
type(psb_zspmat_type), pointer :: ap
|
|
|
|
|
|
|
|
integer(psb_c_ipk_) :: info
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
res = .false.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (c_associated(cdh%item)) then
|
|
|
|
|
|
|
|
call c_f_pointer(cdh%item,descp)
|
|
|
|
else
|
|
|
|
else
|
|
|
|
return
|
|
|
|
return
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
if (c_associated(yh%item)) then
|
|
|
|
if (c_associated(ah%item)) then
|
|
|
|
call c_f_pointer(yh%item,yp)
|
|
|
|
call c_f_pointer(ah%item,ap)
|
|
|
|
else
|
|
|
|
else
|
|
|
|
return
|
|
|
|
return
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
res = ap%is_upd()
|
|
|
|
|
|
|
|
end function
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function psb_c_zis_matasb(ah,cdh) bind(c) result(res)
|
|
|
|
|
|
|
|
implicit none
|
|
|
|
|
|
|
|
logical(c_bool) :: res
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
type(psb_c_zspmat) :: ah
|
|
|
|
|
|
|
|
type(psb_c_descriptor) :: cdh
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
type(psb_desc_type), pointer :: descp
|
|
|
|
|
|
|
|
type(psb_zspmat_type), pointer :: ap
|
|
|
|
|
|
|
|
integer(psb_c_ipk_) :: info
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
res = .false.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (c_associated(cdh%item)) then
|
|
|
|
|
|
|
|
call c_f_pointer(cdh%item,descp)
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
if (c_associated(ah%item)) then
|
|
|
|
|
|
|
|
call c_f_pointer(ah%item,ap)
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
res = ap%is_asb()
|
|
|
|
|
|
|
|
end function
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function psb_c_zis_matbld(ah,cdh) bind(c) result(res)
|
|
|
|
|
|
|
|
implicit none
|
|
|
|
|
|
|
|
logical(c_bool) :: res
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
type(psb_c_zspmat) :: ah
|
|
|
|
|
|
|
|
type(psb_c_descriptor) :: cdh
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
type(psb_desc_type), pointer :: descp
|
|
|
|
|
|
|
|
type(psb_zspmat_type), pointer :: ap
|
|
|
|
|
|
|
|
integer(psb_c_ipk_) :: info
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
res = .false.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (c_associated(cdh%item)) then
|
|
|
|
|
|
|
|
call c_f_pointer(cdh%item,descp)
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
if (c_associated(ah%item)) then
|
|
|
|
|
|
|
|
call c_f_pointer(ah%item,ap)
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
return
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
call xp%clone(yp,info)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
end function psb_c_zvect_clone
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
res = ap%is_bld()
|
|
|
|
|
|
|
|
end function
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function psb_c_zset_matupd(ah,cdh) bind(c) result(res)
|
|
|
|
|
|
|
|
implicit none
|
|
|
|
|
|
|
|
integer(psb_c_ipk_) :: res
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
type(psb_c_zspmat) :: ah
|
|
|
|
|
|
|
|
type(psb_c_descriptor) :: cdh
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
type(psb_desc_type), pointer :: descp
|
|
|
|
|
|
|
|
type(psb_zspmat_type), pointer :: ap
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
res = -1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (c_associated(cdh%item)) then
|
|
|
|
|
|
|
|
call c_f_pointer(cdh%item,descp)
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
if (c_associated(ah%item)) then
|
|
|
|
|
|
|
|
call c_f_pointer(ah%item,ap)
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
call ap%set_upd()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
res = psb_success_
|
|
|
|
|
|
|
|
end function
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function psb_c_zset_matasb(ah,cdh) bind(c) result(res)
|
|
|
|
|
|
|
|
implicit none
|
|
|
|
|
|
|
|
integer(psb_c_ipk_) :: res
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
type(psb_c_zspmat) :: ah
|
|
|
|
|
|
|
|
type(psb_c_descriptor) :: cdh
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
type(psb_desc_type), pointer :: descp
|
|
|
|
|
|
|
|
type(psb_zspmat_type), pointer :: ap
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
res = -1;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (c_associated(cdh%item)) then
|
|
|
|
|
|
|
|
call c_f_pointer(cdh%item,descp)
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
if (c_associated(ah%item)) then
|
|
|
|
|
|
|
|
call c_f_pointer(ah%item,ap)
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
call ap%set_asb()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
res = psb_success_
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
end function
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function psb_c_zset_matbld(ah,cdh) bind(c) result(res)
|
|
|
|
|
|
|
|
implicit none
|
|
|
|
|
|
|
|
integer(psb_c_ipk_) :: res
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
type(psb_c_zspmat) :: ah
|
|
|
|
|
|
|
|
type(psb_c_descriptor) :: cdh
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
type(psb_desc_type), pointer :: descp
|
|
|
|
|
|
|
|
type(psb_zspmat_type), pointer :: ap
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
res = -1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (c_associated(cdh%item)) then
|
|
|
|
|
|
|
|
call c_f_pointer(cdh%item,descp)
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
if (c_associated(ah%item)) then
|
|
|
|
|
|
|
|
call c_f_pointer(ah%item,ap)
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
call ap%set_bld()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
res = psb_success_
|
|
|
|
|
|
|
|
end function
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function psb_c_zcopy_mat(ah,bh,cdh) bind(c) result(res)
|
|
|
|
|
|
|
|
implicit none
|
|
|
|
|
|
|
|
integer(psb_c_ipk_) :: res
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
type(psb_c_zspmat) :: ah,bh
|
|
|
|
|
|
|
|
type(psb_c_descriptor) :: cdh
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
type(psb_desc_type), pointer :: descp
|
|
|
|
|
|
|
|
type(psb_zspmat_type), pointer :: ap,bp
|
|
|
|
|
|
|
|
integer(psb_c_ipk_) :: info
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
res = -1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (c_associated(cdh%item)) then
|
|
|
|
|
|
|
|
call c_f_pointer(cdh%item,descp)
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
if (c_associated(ah%item)) then
|
|
|
|
|
|
|
|
call c_f_pointer(ah%item,ap)
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
if (c_associated(bh%item)) then
|
|
|
|
|
|
|
|
call c_f_pointer(bh%item,bp)
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
call ap%clone(bp,info)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
res = info
|
|
|
|
|
|
|
|
end function
|
|
|
|
|
|
|
|
|
|
|
|
end module psb_z_serial_cbind_mod
|
|
|
|
end module psb_z_serial_cbind_mod
|
|
|
|
|