C Interfaces for new vector operators

merge-paraggr-newops
Cirdans-Home 5 years ago
parent b8ab997bc1
commit 17e24bdcf0

@ -3,38 +3,38 @@ module psb_c_psblas_cbind_mod
use psb_base_mod
use psb_objhandle_mod
use psb_base_string_cbind_mod
contains
function psb_c_cgeaxpby(alpha,xh,beta,yh,cdh) bind(c) result(res)
implicit none
implicit none
integer(psb_c_ipk_) :: res
type(psb_c_cvector) :: xh,yh
type(psb_c_descriptor) :: cdh
complex(c_float_complex), value :: alpha,beta
type(psb_desc_type), pointer :: descp
type(psb_c_vect_type), pointer :: xp,yp
integer(psb_c_ipk_) :: info
res = -1
if (c_associated(cdh%item)) then
if (c_associated(cdh%item)) then
call c_f_pointer(cdh%item,descp)
else
return
return
end if
if (c_associated(xh%item)) then
if (c_associated(xh%item)) then
call c_f_pointer(xh%item,xp)
else
return
return
end if
if (c_associated(yh%item)) then
if (c_associated(yh%item)) then
call c_f_pointer(yh%item,yp)
else
return
return
end if
call psb_geaxpby(alpha,xp,beta,yp,descp,info)
@ -43,8 +43,261 @@ contains
end function psb_c_cgeaxpby
function psb_c_cgemlt(xh,yh,cdh) bind(c) result(res)
implicit none
integer(psb_c_ipk_) :: res
type(psb_c_cvector) :: xh,yh
type(psb_c_descriptor) :: cdh
type(psb_desc_type), pointer :: descp
type(psb_c_vect_type), pointer :: xp,yp
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(xh%item)) then
call c_f_pointer(xh%item,xp)
else
return
end if
if (c_associated(yh%item)) then
call c_f_pointer(yh%item,yp)
else
return
end if
call psb_gemlt(xp,yp,descp,info)
res = info
end function psb_c_cgemlt
function psb_c_cgediv(xh,yh,cdh) bind(c) result(res)
implicit none
integer(psb_c_ipk_) :: res
type(psb_c_cvector) :: xh,yh
type(psb_c_descriptor) :: cdh
type(psb_desc_type), pointer :: descp
type(psb_c_vect_type), pointer :: xp,yp
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(xh%item)) then
call c_f_pointer(xh%item,xp)
else
return
end if
if (c_associated(yh%item)) then
call c_f_pointer(yh%item,yp)
else
return
end if
call psb_gediv(xp,yp,descp,info)
res = info
end function psb_c_cgediv
function psb_c_cgediv_check(xh,yh,cdh, flag) bind(c) result(res)
implicit none
integer(psb_c_ipk_) :: res
type(psb_c_cvector) :: xh,yh
type(psb_c_descriptor) :: cdh
logical(c_bool), value :: flag
type(psb_desc_type), pointer :: descp
type(psb_c_vect_type), pointer :: xp,yp
integer(psb_c_ipk_) :: info
logical :: fflag
res = -1
if (c_associated(cdh%item)) then
call c_f_pointer(cdh%item,descp)
else
return
end if
if (c_associated(xh%item)) then
call c_f_pointer(xh%item,xp)
else
return
end if
if (c_associated(yh%item)) then
call c_f_pointer(yh%item,yp)
else
return
end if
fflag = flag
call psb_gediv(xp,yp,descp,info,fflag)
res = info
end function psb_c_cgediv_check
function psb_c_cgeinv(xh,yh,cdh) bind(c) result(res)
implicit none
integer(psb_c_ipk_) :: res
type(psb_c_cvector) :: xh,yh
type(psb_c_descriptor) :: cdh
type(psb_desc_type), pointer :: descp
type(psb_c_vect_type), pointer :: xp,yp
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(xh%item)) then
call c_f_pointer(xh%item,xp)
else
return
end if
if (c_associated(yh%item)) then
call c_f_pointer(yh%item,yp)
else
return
end if
call psb_geinv(xp,yp,descp,info)
res = info
end function psb_c_cgeinv
function psb_c_cgeinv_check(xh,yh,cdh, flag) bind(c) result(res)
implicit none
integer(psb_c_ipk_) :: res
type(psb_c_cvector) :: xh,yh
type(psb_c_descriptor) :: cdh
logical(c_bool), value :: flag
type(psb_desc_type), pointer :: descp
type(psb_c_vect_type), pointer :: xp,yp
integer(psb_c_ipk_) :: info
logical :: fflag
res = -1
if (c_associated(cdh%item)) then
call c_f_pointer(cdh%item,descp)
else
return
end if
if (c_associated(xh%item)) then
call c_f_pointer(xh%item,xp)
else
return
end if
if (c_associated(yh%item)) then
call c_f_pointer(yh%item,yp)
else
return
end if
fflag = flag
call psb_geinv(xp,yp,descp,info,fflag)
res = info
end function psb_c_cgeinv_check
function psb_c_cgeabs(xh,yh,cdh) bind(c) result(res)
implicit none
integer(psb_c_ipk_) :: res
type(psb_c_cvector) :: xh,yh
type(psb_c_descriptor) :: cdh
type(psb_desc_type), pointer :: descp
type(psb_c_vect_type), pointer :: xp,yp
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(xh%item)) then
call c_f_pointer(xh%item,xp)
else
return
end if
if (c_associated(yh%item)) then
call c_f_pointer(yh%item,yp)
else
return
end if
call psb_geabs(xp,yp,descp,info)
res = info
end function psb_c_cgeabs
function psb_c_cgecmp(xh,ch,zh,cdh) bind(c) result(res)
implicit none
integer(psb_c_ipk_) :: res
type(psb_c_cvector) :: xh,zh
type(psb_c_descriptor) :: cdh
type(psb_desc_type), pointer :: descp
type(psb_c_vect_type), pointer :: xp,zp
integer(psb_c_ipk_) :: info
real(c_float_complex) :: ch
res = -1
if (c_associated(cdh%item)) then
call c_f_pointer(cdh%item,descp)
else
return
end if
if (c_associated(xh%item)) then
call c_f_pointer(xh%item,xp)
else
return
end if
if (c_associated(zh%item)) then
call c_f_pointer(zh%item,zp)
else
return
end if
call psb_gecmp(xp,ch,zp,descp,info)
res = info
end function psb_c_cgecmp
function psb_c_cgenrm2(xh,cdh) bind(c) result(res)
implicit none
implicit none
real(c_float_complex) :: res
type(psb_c_cvector) :: xh
@ -55,23 +308,92 @@ contains
res = -1.0
if (c_associated(cdh%item)) then
if (c_associated(cdh%item)) then
call c_f_pointer(cdh%item,descp)
else
return
return
end if
if (c_associated(xh%item)) then
if (c_associated(xh%item)) then
call c_f_pointer(xh%item,xp)
else
return
return
end if
res = psb_genrm2(xp,descp,info)
end function psb_c_cgenrm2
function psb_c_cgenrm2_weight(xh,wh,cdh) bind(c) result(res)
implicit none
real(c_float_complex) :: res
type(psb_c_cvector) :: xh, wh
type(psb_c_descriptor) :: cdh
type(psb_desc_type), pointer :: descp
type(psb_c_vect_type), pointer :: xp, wp
integer(psb_c_ipk_) :: info
res = -1.0
if (c_associated(cdh%item)) then
call c_f_pointer(cdh%item,descp)
else
return
end if
if (c_associated(xh%item)) then
call c_f_pointer(xh%item,xp)
else
return
end if
if (c_associated(wh%item)) then
call c_f_pointer(wh%item,wp)
else
return
end if
res = psb_genrm2(xp,wp,descp,info)
end function psb_c_cgenrm2_weight
function psb_c_cgenrm2_weightmask(xh,wh,idvh,cdh) bind(c) result(res)
implicit none
real(c_float_complex) :: res
type(psb_c_cvector) :: xh, wh, idvh
type(psb_c_descriptor) :: cdh
type(psb_desc_type), pointer :: descp
type(psb_c_vect_type), pointer :: xp, wp, idvp
integer(psb_c_ipk_) :: info
res = -1.0
if (c_associated(cdh%item)) then
call c_f_pointer(cdh%item,descp)
else
return
end if
if (c_associated(xh%item)) then
call c_f_pointer(xh%item,xp)
else
return
end if
if (c_associated(wh%item)) then
call c_f_pointer(wh%item,wp)
else
return
end if
if (c_associated(idvh%item)) then
call c_f_pointer(idvh%item,idvp)
else
return
end if
res = psb_genrm2(xp,wp,idvp,descp,info)
end function psb_c_cgenrm2_weightmask
function psb_c_cgeamax(xh,cdh) bind(c) result(res)
implicit none
implicit none
real(c_float_complex) :: res
type(psb_c_cvector) :: xh
@ -81,23 +403,23 @@ contains
integer(psb_c_ipk_) :: info
res = -1.0
if (c_associated(cdh%item)) then
if (c_associated(cdh%item)) then
call c_f_pointer(cdh%item,descp)
else
return
return
end if
if (c_associated(xh%item)) then
if (c_associated(xh%item)) then
call c_f_pointer(xh%item,xp)
else
return
return
end if
res = psb_geamax(xp,descp,info)
end function psb_c_cgeamax
function psb_c_cgeasum(xh,cdh) bind(c) result(res)
implicit none
implicit none
real(c_float_complex) :: res
type(psb_c_cvector) :: xh
@ -108,24 +430,24 @@ contains
res = -1.0
if (c_associated(cdh%item)) then
if (c_associated(cdh%item)) then
call c_f_pointer(cdh%item,descp)
else
return
return
end if
if (c_associated(xh%item)) then
if (c_associated(xh%item)) then
call c_f_pointer(xh%item,xp)
else
return
return
end if
res = psb_geasum(xp,descp,info)
end function psb_c_cgeasum
function psb_c_cspnrmi(ah,cdh) bind(c) result(res)
implicit none
implicit none
real(c_float_complex) :: res
type(psb_c_cspmat) :: ah
@ -135,15 +457,15 @@ contains
integer(psb_c_ipk_) :: info
res = -1.0
if (c_associated(cdh%item)) then
if (c_associated(cdh%item)) then
call c_f_pointer(cdh%item,descp)
else
return
return
end if
if (c_associated(ah%item)) then
if (c_associated(ah%item)) then
call c_f_pointer(ah%item,ap)
else
return
return
end if
res = psb_spnrmi(ap,descp,info)
@ -151,7 +473,7 @@ contains
end function psb_c_cspnrmi
function psb_c_cgedot(xh,yh,cdh) bind(c) result(res)
implicit none
implicit none
complex(c_float_complex) :: res
type(psb_c_cvector) :: xh,yh
@ -161,20 +483,20 @@ contains
integer(psb_c_ipk_) :: info
res = -1.0
if (c_associated(cdh%item)) then
if (c_associated(cdh%item)) then
call c_f_pointer(cdh%item,descp)
else
return
return
end if
if (c_associated(xh%item)) then
if (c_associated(xh%item)) then
call c_f_pointer(xh%item,xp)
else
return
return
end if
if (c_associated(yh%item)) then
if (c_associated(yh%item)) then
call c_f_pointer(yh%item,yp)
else
return
return
end if
res = psb_gedot(xp,yp,descp,info)
@ -182,7 +504,7 @@ contains
function psb_c_cspmm(alpha,ah,xh,beta,yh,cdh) bind(c) result(res)
implicit none
implicit none
integer(psb_c_ipk_) :: res
type(psb_c_cspmat) :: ah
@ -195,25 +517,25 @@ contains
integer(psb_c_ipk_) :: info
res = -1
if (c_associated(cdh%item)) then
if (c_associated(cdh%item)) then
call c_f_pointer(cdh%item,descp)
else
return
return
end if
if (c_associated(xh%item)) then
if (c_associated(xh%item)) then
call c_f_pointer(xh%item,xp)
else
return
return
end if
if (c_associated(yh%item)) then
if (c_associated(yh%item)) then
call c_f_pointer(yh%item,yp)
else
return
return
end if
if (c_associated(ah%item)) then
if (c_associated(ah%item)) then
call c_f_pointer(ah%item,ap)
else
return
return
end if
call psb_spmm(alpha,ap,xp,beta,yp,descp,info)
@ -224,7 +546,7 @@ contains
function psb_c_cspmm_opt(alpha,ah,xh,beta,yh,cdh,trans,doswap) bind(c) result(res)
implicit none
implicit none
integer(psb_c_ipk_) :: res
type(psb_c_cspmat) :: ah
@ -242,25 +564,25 @@ contains
integer(psb_c_ipk_) :: info
res = -1
if (c_associated(cdh%item)) then
if (c_associated(cdh%item)) then
call c_f_pointer(cdh%item,descp)
else
return
return
end if
if (c_associated(xh%item)) then
if (c_associated(xh%item)) then
call c_f_pointer(xh%item,xp)
else
return
return
end if
if (c_associated(yh%item)) then
if (c_associated(yh%item)) then
call c_f_pointer(yh%item,yp)
else
return
return
end if
if (c_associated(ah%item)) then
if (c_associated(ah%item)) then
call c_f_pointer(ah%item,ap)
else
return
return
end if
fdoswap = doswap
@ -270,10 +592,10 @@ contains
res = info
end function psb_c_cspmm_opt
function psb_c_cspsm(alpha,ah,xh,beta,yh,cdh) bind(c) result(res)
implicit none
implicit none
integer(psb_c_ipk_) :: res
type(psb_c_cspmat) :: ah
@ -286,25 +608,25 @@ contains
integer(psb_c_ipk_) :: info
res = -1
if (c_associated(cdh%item)) then
if (c_associated(cdh%item)) then
call c_f_pointer(cdh%item,descp)
else
return
return
end if
if (c_associated(xh%item)) then
if (c_associated(xh%item)) then
call c_f_pointer(xh%item,xp)
else
return
return
end if
if (c_associated(yh%item)) then
if (c_associated(yh%item)) then
call c_f_pointer(yh%item,yp)
else
return
return
end if
if (c_associated(ah%item)) then
if (c_associated(ah%item)) then
call c_f_pointer(ah%item,ap)
else
return
return
end if
call psb_spsm(alpha,ap,xp,beta,yp,descp,info)
@ -312,6 +634,6 @@ contains
res = info
end function psb_c_cspsm
end module psb_c_psblas_cbind_mod

@ -3,38 +3,38 @@ module psb_d_psblas_cbind_mod
use psb_base_mod
use psb_objhandle_mod
use psb_base_string_cbind_mod
contains
function psb_c_dgeaxpby(alpha,xh,beta,yh,cdh) bind(c) result(res)
implicit none
implicit none
integer(psb_c_ipk_) :: res
type(psb_c_dvector) :: xh,yh
type(psb_c_descriptor) :: cdh
real(c_double), value :: alpha,beta
type(psb_desc_type), pointer :: descp
type(psb_d_vect_type), pointer :: xp,yp
integer(psb_c_ipk_) :: info
res = -1
if (c_associated(cdh%item)) then
if (c_associated(cdh%item)) then
call c_f_pointer(cdh%item,descp)
else
return
return
end if
if (c_associated(xh%item)) then
if (c_associated(xh%item)) then
call c_f_pointer(xh%item,xp)
else
return
return
end if
if (c_associated(yh%item)) then
if (c_associated(yh%item)) then
call c_f_pointer(yh%item,yp)
else
return
return
end if
call psb_geaxpby(alpha,xp,beta,yp,descp,info)
@ -43,8 +43,304 @@ contains
end function psb_c_dgeaxpby
function psb_c_dgemlt(xh,yh,cdh) bind(c) result(res)
implicit none
integer(psb_c_ipk_) :: res
type(psb_c_dvector) :: xh,yh
type(psb_c_descriptor) :: cdh
type(psb_desc_type), pointer :: descp
type(psb_d_vect_type), pointer :: xp,yp
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(xh%item)) then
call c_f_pointer(xh%item,xp)
else
return
end if
if (c_associated(yh%item)) then
call c_f_pointer(yh%item,yp)
else
return
end if
call psb_gemlt(xp,yp,descp,info)
res = info
end function psb_c_dgemlt
function psb_c_dgediv(xh,yh,cdh) bind(c) result(res)
implicit none
integer(psb_c_ipk_) :: res
type(psb_c_dvector) :: xh,yh
type(psb_c_descriptor) :: cdh
type(psb_desc_type), pointer :: descp
type(psb_d_vect_type), pointer :: xp,yp
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(xh%item)) then
call c_f_pointer(xh%item,xp)
else
return
end if
if (c_associated(yh%item)) then
call c_f_pointer(yh%item,yp)
else
return
end if
call psb_gediv(xp,yp,descp,info)
res = info
end function psb_c_dgediv
function psb_c_dgediv_check(xh,yh,cdh, flag) bind(c) result(res)
implicit none
integer(psb_c_ipk_) :: res
type(psb_c_dvector) :: xh,yh
type(psb_c_descriptor) :: cdh
logical(c_bool), value :: flag
type(psb_desc_type), pointer :: descp
type(psb_d_vect_type), pointer :: xp,yp
integer(psb_c_ipk_) :: info
logical :: fflag
res = -1
if (c_associated(cdh%item)) then
call c_f_pointer(cdh%item,descp)
else
return
end if
if (c_associated(xh%item)) then
call c_f_pointer(xh%item,xp)
else
return
end if
if (c_associated(yh%item)) then
call c_f_pointer(yh%item,yp)
else
return
end if
fflag = flag
call psb_gediv(xp,yp,descp,info,fflag)
res = info
end function psb_c_dgediv_check
function psb_c_dgeinv(xh,yh,cdh) bind(c) result(res)
implicit none
integer(psb_c_ipk_) :: res
type(psb_c_dvector) :: xh,yh
type(psb_c_descriptor) :: cdh
type(psb_desc_type), pointer :: descp
type(psb_d_vect_type), pointer :: xp,yp
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(xh%item)) then
call c_f_pointer(xh%item,xp)
else
return
end if
if (c_associated(yh%item)) then
call c_f_pointer(yh%item,yp)
else
return
end if
call psb_geinv(xp,yp,descp,info)
res = info
end function psb_c_dgeinv
function psb_c_dgeinv_check(xh,yh,cdh, flag) bind(c) result(res)
implicit none
integer(psb_c_ipk_) :: res
type(psb_c_dvector) :: xh,yh
type(psb_c_descriptor) :: cdh
logical(c_bool), value :: flag
type(psb_desc_type), pointer :: descp
type(psb_d_vect_type), pointer :: xp,yp
integer(psb_c_ipk_) :: info
logical :: fflag
res = -1
if (c_associated(cdh%item)) then
call c_f_pointer(cdh%item,descp)
else
return
end if
if (c_associated(xh%item)) then
call c_f_pointer(xh%item,xp)
else
return
end if
if (c_associated(yh%item)) then
call c_f_pointer(yh%item,yp)
else
return
end if
fflag = flag
call psb_geinv(xp,yp,descp,info,fflag)
res = info
end function psb_c_dgeinv_check
function psb_c_dgeabs(xh,yh,cdh) bind(c) result(res)
implicit none
integer(psb_c_ipk_) :: res
type(psb_c_dvector) :: xh,yh
type(psb_c_descriptor) :: cdh
type(psb_desc_type), pointer :: descp
type(psb_d_vect_type), pointer :: xp,yp
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(xh%item)) then
call c_f_pointer(xh%item,xp)
else
return
end if
if (c_associated(yh%item)) then
call c_f_pointer(yh%item,yp)
else
return
end if
call psb_geabs(xp,yp,descp,info)
res = info
end function psb_c_dgeabs
function psb_c_dgecmp(xh,ch,zh,cdh) bind(c) result(res)
implicit none
integer(psb_c_ipk_) :: res
type(psb_c_dvector) :: xh,zh
type(psb_c_descriptor) :: cdh
type(psb_desc_type), pointer :: descp
type(psb_d_vect_type), pointer :: xp,zp
integer(psb_c_ipk_) :: info
real(c_double) :: ch
res = -1
if (c_associated(cdh%item)) then
call c_f_pointer(cdh%item,descp)
else
return
end if
if (c_associated(xh%item)) then
call c_f_pointer(xh%item,xp)
else
return
end if
if (c_associated(zh%item)) then
call c_f_pointer(zh%item,zp)
else
return
end if
call psb_gecmp(xp,ch,zp,descp,info)
res = info
end function psb_c_dgecmp
function psb_c_dmask(ch,xh,mh,t,cdh) bind(c) result(res)
implicit none
integer(psb_c_ipk_) :: res
type(psb_c_dvector) :: ch,xh,mh
type(psb_c_descriptor) :: cdh
logical(c_bool), value :: t
type(psb_desc_type), pointer :: descp
type(psb_d_vect_type), pointer :: cp,xp,mp
integer(psb_c_ipk_) :: info
logical :: ft
res = -1
if (c_associated(cdh%item)) then
call c_f_pointer(cdh%item,descp)
else
return
end if
if (c_associated(ch%item)) then
call c_f_pointer(ch%item,cp)
else
return
end if
if (c_associated(xh%item)) then
call c_f_pointer(xh%item,xp)
else
return
end if
if (c_associated(mh%item)) then
call c_f_pointer(mh%item,mp)
else
return
end if
ft = t
call psb_mask(cp,xp,mp,ft,descp,info)
t = ft
res = info
end function psb_c_dmask
function psb_c_dgenrm2(xh,cdh) bind(c) result(res)
implicit none
implicit none
real(c_double) :: res
type(psb_c_dvector) :: xh
@ -55,23 +351,92 @@ contains
res = -1.0
if (c_associated(cdh%item)) then
if (c_associated(cdh%item)) then
call c_f_pointer(cdh%item,descp)
else
return
return
end if
if (c_associated(xh%item)) then
if (c_associated(xh%item)) then
call c_f_pointer(xh%item,xp)
else
return
return
end if
res = psb_genrm2(xp,descp,info)
end function psb_c_dgenrm2
function psb_c_dgenrm2_weight(xh,wh,cdh) bind(c) result(res)
implicit none
real(c_double) :: res
type(psb_c_dvector) :: xh, wh
type(psb_c_descriptor) :: cdh
type(psb_desc_type), pointer :: descp
type(psb_d_vect_type), pointer :: xp, wp
integer(psb_c_ipk_) :: info
res = -1.0
if (c_associated(cdh%item)) then
call c_f_pointer(cdh%item,descp)
else
return
end if
if (c_associated(xh%item)) then
call c_f_pointer(xh%item,xp)
else
return
end if
if (c_associated(wh%item)) then
call c_f_pointer(wh%item,wp)
else
return
end if
res = psb_genrm2(xp,wp,descp,info)
end function psb_c_dgenrm2_weight
function psb_c_dgenrm2_weightmask(xh,wh,idvh,cdh) bind(c) result(res)
implicit none
real(c_double) :: res
type(psb_c_dvector) :: xh, wh, idvh
type(psb_c_descriptor) :: cdh
type(psb_desc_type), pointer :: descp
type(psb_d_vect_type), pointer :: xp, wp, idvp
integer(psb_c_ipk_) :: info
res = -1.0
if (c_associated(cdh%item)) then
call c_f_pointer(cdh%item,descp)
else
return
end if
if (c_associated(xh%item)) then
call c_f_pointer(xh%item,xp)
else
return
end if
if (c_associated(wh%item)) then
call c_f_pointer(wh%item,wp)
else
return
end if
if (c_associated(idvh%item)) then
call c_f_pointer(idvh%item,idvp)
else
return
end if
res = psb_genrm2(xp,wp,idvp,descp,info)
end function psb_c_dgenrm2_weightmask
function psb_c_dgeamax(xh,cdh) bind(c) result(res)
implicit none
implicit none
real(c_double) :: res
type(psb_c_dvector) :: xh
@ -81,23 +446,23 @@ contains
integer(psb_c_ipk_) :: info
res = -1.0
if (c_associated(cdh%item)) then
if (c_associated(cdh%item)) then
call c_f_pointer(cdh%item,descp)
else
return
return
end if
if (c_associated(xh%item)) then
if (c_associated(xh%item)) then
call c_f_pointer(xh%item,xp)
else
return
return
end if
res = psb_geamax(xp,descp,info)
end function psb_c_dgeamax
function psb_c_dgeasum(xh,cdh) bind(c) result(res)
implicit none
implicit none
real(c_double) :: res
type(psb_c_dvector) :: xh
@ -108,24 +473,24 @@ contains
res = -1.0
if (c_associated(cdh%item)) then
if (c_associated(cdh%item)) then
call c_f_pointer(cdh%item,descp)
else
return
return
end if
if (c_associated(xh%item)) then
if (c_associated(xh%item)) then
call c_f_pointer(xh%item,xp)
else
return
return
end if
res = psb_geasum(xp,descp,info)
end function psb_c_dgeasum
function psb_c_dspnrmi(ah,cdh) bind(c) result(res)
implicit none
implicit none
real(c_double) :: res
type(psb_c_dspmat) :: ah
@ -135,15 +500,15 @@ contains
integer(psb_c_ipk_) :: info
res = -1.0
if (c_associated(cdh%item)) then
if (c_associated(cdh%item)) then
call c_f_pointer(cdh%item,descp)
else
return
return
end if
if (c_associated(ah%item)) then
if (c_associated(ah%item)) then
call c_f_pointer(ah%item,ap)
else
return
return
end if
res = psb_spnrmi(ap,descp,info)
@ -151,7 +516,7 @@ contains
end function psb_c_dspnrmi
function psb_c_dgedot(xh,yh,cdh) bind(c) result(res)
implicit none
implicit none
real(c_double) :: res
type(psb_c_dvector) :: xh,yh
@ -161,20 +526,20 @@ contains
integer(psb_c_ipk_) :: info
res = -1.0
if (c_associated(cdh%item)) then
if (c_associated(cdh%item)) then
call c_f_pointer(cdh%item,descp)
else
return
return
end if
if (c_associated(xh%item)) then
if (c_associated(xh%item)) then
call c_f_pointer(xh%item,xp)
else
return
return
end if
if (c_associated(yh%item)) then
if (c_associated(yh%item)) then
call c_f_pointer(yh%item,yp)
else
return
return
end if
res = psb_gedot(xp,yp,descp,info)
@ -182,7 +547,7 @@ contains
function psb_c_dspmm(alpha,ah,xh,beta,yh,cdh) bind(c) result(res)
implicit none
implicit none
integer(psb_c_ipk_) :: res
type(psb_c_dspmat) :: ah
@ -195,25 +560,25 @@ contains
integer(psb_c_ipk_) :: info
res = -1
if (c_associated(cdh%item)) then
if (c_associated(cdh%item)) then
call c_f_pointer(cdh%item,descp)
else
return
return
end if
if (c_associated(xh%item)) then
if (c_associated(xh%item)) then
call c_f_pointer(xh%item,xp)
else
return
return
end if
if (c_associated(yh%item)) then
if (c_associated(yh%item)) then
call c_f_pointer(yh%item,yp)
else
return
return
end if
if (c_associated(ah%item)) then
if (c_associated(ah%item)) then
call c_f_pointer(ah%item,ap)
else
return
return
end if
call psb_spmm(alpha,ap,xp,beta,yp,descp,info)
@ -224,7 +589,7 @@ contains
function psb_c_dspmm_opt(alpha,ah,xh,beta,yh,cdh,trans,doswap) bind(c) result(res)
implicit none
implicit none
integer(psb_c_ipk_) :: res
type(psb_c_dspmat) :: ah
@ -242,25 +607,25 @@ contains
integer(psb_c_ipk_) :: info
res = -1
if (c_associated(cdh%item)) then
if (c_associated(cdh%item)) then
call c_f_pointer(cdh%item,descp)
else
return
return
end if
if (c_associated(xh%item)) then
if (c_associated(xh%item)) then
call c_f_pointer(xh%item,xp)
else
return
return
end if
if (c_associated(yh%item)) then
if (c_associated(yh%item)) then
call c_f_pointer(yh%item,yp)
else
return
return
end if
if (c_associated(ah%item)) then
if (c_associated(ah%item)) then
call c_f_pointer(ah%item,ap)
else
return
return
end if
fdoswap = doswap
@ -270,10 +635,10 @@ contains
res = info
end function psb_c_dspmm_opt
function psb_c_dspsm(alpha,ah,xh,beta,yh,cdh) bind(c) result(res)
implicit none
implicit none
integer(psb_c_ipk_) :: res
type(psb_c_dspmat) :: ah
@ -286,25 +651,25 @@ contains
integer(psb_c_ipk_) :: info
res = -1
if (c_associated(cdh%item)) then
if (c_associated(cdh%item)) then
call c_f_pointer(cdh%item,descp)
else
return
return
end if
if (c_associated(xh%item)) then
if (c_associated(xh%item)) then
call c_f_pointer(xh%item,xp)
else
return
return
end if
if (c_associated(yh%item)) then
if (c_associated(yh%item)) then
call c_f_pointer(yh%item,yp)
else
return
return
end if
if (c_associated(ah%item)) then
if (c_associated(ah%item)) then
call c_f_pointer(ah%item,ap)
else
return
return
end if
call psb_spsm(alpha,ap,xp,beta,yp,descp,info)
@ -312,6 +677,6 @@ contains
res = info
end function psb_c_dspsm
end module psb_d_psblas_cbind_mod

@ -3,38 +3,38 @@ module psb_s_psblas_cbind_mod
use psb_base_mod
use psb_objhandle_mod
use psb_base_string_cbind_mod
contains
function psb_c_sgeaxpby(alpha,xh,beta,yh,cdh) bind(c) result(res)
implicit none
implicit none
integer(psb_c_ipk_) :: res
type(psb_c_svector) :: xh,yh
type(psb_c_descriptor) :: cdh
real(c_float), value :: alpha,beta
type(psb_desc_type), pointer :: descp
type(psb_s_vect_type), pointer :: xp,yp
integer(psb_c_ipk_) :: info
res = -1
if (c_associated(cdh%item)) then
if (c_associated(cdh%item)) then
call c_f_pointer(cdh%item,descp)
else
return
return
end if
if (c_associated(xh%item)) then
if (c_associated(xh%item)) then
call c_f_pointer(xh%item,xp)
else
return
return
end if
if (c_associated(yh%item)) then
if (c_associated(yh%item)) then
call c_f_pointer(yh%item,yp)
else
return
return
end if
call psb_geaxpby(alpha,xp,beta,yp,descp,info)
@ -43,8 +43,304 @@ contains
end function psb_c_sgeaxpby
function psb_c_sgemlt(xh,yh,cdh) bind(c) result(res)
implicit none
integer(psb_c_ipk_) :: res
type(psb_c_svector) :: xh,yh
type(psb_c_descriptor) :: cdh
type(psb_desc_type), pointer :: descp
type(psb_s_vect_type), pointer :: xp,yp
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(xh%item)) then
call c_f_pointer(xh%item,xp)
else
return
end if
if (c_associated(yh%item)) then
call c_f_pointer(yh%item,yp)
else
return
end if
call psb_gemlt(xp,yp,descp,info)
res = info
end function psb_c_sgemlt
function psb_c_sgediv(xh,yh,cdh) bind(c) result(res)
implicit none
integer(psb_c_ipk_) :: res
type(psb_c_svector) :: xh,yh
type(psb_c_descriptor) :: cdh
type(psb_desc_type), pointer :: descp
type(psb_s_vect_type), pointer :: xp,yp
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(xh%item)) then
call c_f_pointer(xh%item,xp)
else
return
end if
if (c_associated(yh%item)) then
call c_f_pointer(yh%item,yp)
else
return
end if
call psb_gediv(xp,yp,descp,info)
res = info
end function psb_c_sgediv
function psb_c_sgediv_check(xh,yh,cdh, flag) bind(c) result(res)
implicit none
integer(psb_c_ipk_) :: res
type(psb_c_svector) :: xh,yh
type(psb_c_descriptor) :: cdh
logical(c_bool), value :: flag
type(psb_desc_type), pointer :: descp
type(psb_s_vect_type), pointer :: xp,yp
integer(psb_c_ipk_) :: info
logical :: fflag
res = -1
if (c_associated(cdh%item)) then
call c_f_pointer(cdh%item,descp)
else
return
end if
if (c_associated(xh%item)) then
call c_f_pointer(xh%item,xp)
else
return
end if
if (c_associated(yh%item)) then
call c_f_pointer(yh%item,yp)
else
return
end if
fflag = flag
call psb_gediv(xp,yp,descp,info,fflag)
res = info
end function psb_c_sgediv_check
function psb_c_sgeinv(xh,yh,cdh) bind(c) result(res)
implicit none
integer(psb_c_ipk_) :: res
type(psb_c_svector) :: xh,yh
type(psb_c_descriptor) :: cdh
type(psb_desc_type), pointer :: descp
type(psb_s_vect_type), pointer :: xp,yp
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(xh%item)) then
call c_f_pointer(xh%item,xp)
else
return
end if
if (c_associated(yh%item)) then
call c_f_pointer(yh%item,yp)
else
return
end if
call psb_geinv(xp,yp,descp,info)
res = info
end function psb_c_sgeinv
function psb_c_sgeinv_check(xh,yh,cdh, flag) bind(c) result(res)
implicit none
integer(psb_c_ipk_) :: res
type(psb_c_svector) :: xh,yh
type(psb_c_descriptor) :: cdh
logical(c_bool), value :: flag
type(psb_desc_type), pointer :: descp
type(psb_s_vect_type), pointer :: xp,yp
integer(psb_c_ipk_) :: info
logical :: fflag
res = -1
if (c_associated(cdh%item)) then
call c_f_pointer(cdh%item,descp)
else
return
end if
if (c_associated(xh%item)) then
call c_f_pointer(xh%item,xp)
else
return
end if
if (c_associated(yh%item)) then
call c_f_pointer(yh%item,yp)
else
return
end if
fflag = flag
call psb_geinv(xp,yp,descp,info,fflag)
res = info
end function psb_c_sgeinv_check
function psb_c_sgeabs(xh,yh,cdh) bind(c) result(res)
implicit none
integer(psb_c_ipk_) :: res
type(psb_c_svector) :: xh,yh
type(psb_c_descriptor) :: cdh
type(psb_desc_type), pointer :: descp
type(psb_s_vect_type), pointer :: xp,yp
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(xh%item)) then
call c_f_pointer(xh%item,xp)
else
return
end if
if (c_associated(yh%item)) then
call c_f_pointer(yh%item,yp)
else
return
end if
call psb_geabs(xp,yp,descp,info)
res = info
end function psb_c_sgeabs
function psb_c_sgecmp(xh,ch,zh,cdh) bind(c) result(res)
implicit none
integer(psb_c_ipk_) :: res
type(psb_c_svector) :: xh,zh
type(psb_c_descriptor) :: cdh
type(psb_desc_type), pointer :: descp
type(psb_s_vect_type), pointer :: xp,zp
integer(psb_c_ipk_) :: info
real(c_float) :: ch
res = -1
if (c_associated(cdh%item)) then
call c_f_pointer(cdh%item,descp)
else
return
end if
if (c_associated(xh%item)) then
call c_f_pointer(xh%item,xp)
else
return
end if
if (c_associated(zh%item)) then
call c_f_pointer(zh%item,zp)
else
return
end if
call psb_gecmp(xp,ch,zp,descp,info)
res = info
end function psb_c_sgecmp
function psb_c_smask(ch,xh,mh,t,cdh) bind(c) result(res)
implicit none
integer(psb_c_ipk_) :: res
type(psb_c_svector) :: ch,xh,mh
type(psb_c_descriptor) :: cdh
logical(c_bool), value :: t
type(psb_desc_type), pointer :: descp
type(psb_s_vect_type), pointer :: cp,xp,mp
integer(psb_c_ipk_) :: info
logical :: ft
res = -1
if (c_associated(cdh%item)) then
call c_f_pointer(cdh%item,descp)
else
return
end if
if (c_associated(ch%item)) then
call c_f_pointer(ch%item,cp)
else
return
end if
if (c_associated(xh%item)) then
call c_f_pointer(xh%item,xp)
else
return
end if
if (c_associated(mh%item)) then
call c_f_pointer(mh%item,mp)
else
return
end if
ft = t
call psb_mask(cp,xp,mp,ft,descp,info)
t = ft
res = info
end function psb_c_smask
function psb_c_sgenrm2(xh,cdh) bind(c) result(res)
implicit none
implicit none
real(c_float) :: res
type(psb_c_svector) :: xh
@ -55,23 +351,92 @@ contains
res = -1.0
if (c_associated(cdh%item)) then
if (c_associated(cdh%item)) then
call c_f_pointer(cdh%item,descp)
else
return
return
end if
if (c_associated(xh%item)) then
if (c_associated(xh%item)) then
call c_f_pointer(xh%item,xp)
else
return
return
end if
res = psb_genrm2(xp,descp,info)
end function psb_c_sgenrm2
function psb_c_sgenrm2_weight(xh,wh,cdh) bind(c) result(res)
implicit none
real(c_float) :: res
type(psb_c_svector) :: xh, wh
type(psb_c_descriptor) :: cdh
type(psb_desc_type), pointer :: descp
type(psb_s_vect_type), pointer :: xp, wp
integer(psb_c_ipk_) :: info
res = -1.0
if (c_associated(cdh%item)) then
call c_f_pointer(cdh%item,descp)
else
return
end if
if (c_associated(xh%item)) then
call c_f_pointer(xh%item,xp)
else
return
end if
if (c_associated(wh%item)) then
call c_f_pointer(wh%item,wp)
else
return
end if
res = psb_genrm2(xp,wp,descp,info)
end function psb_c_sgenrm2_weight
function psb_c_sgenrm2_weightmask(xh,wh,idvh,cdh) bind(c) result(res)
implicit none
real(c_float) :: res
type(psb_c_svector) :: xh, wh, idvh
type(psb_c_descriptor) :: cdh
type(psb_desc_type), pointer :: descp
type(psb_s_vect_type), pointer :: xp, wp, idvp
integer(psb_c_ipk_) :: info
res = -1.0
if (c_associated(cdh%item)) then
call c_f_pointer(cdh%item,descp)
else
return
end if
if (c_associated(xh%item)) then
call c_f_pointer(xh%item,xp)
else
return
end if
if (c_associated(wh%item)) then
call c_f_pointer(wh%item,wp)
else
return
end if
if (c_associated(idvh%item)) then
call c_f_pointer(idvh%item,idvp)
else
return
end if
res = psb_genrm2(xp,wp,idvp,descp,info)
end function psb_c_sgenrm2_weightmask
function psb_c_sgeamax(xh,cdh) bind(c) result(res)
implicit none
implicit none
real(c_float) :: res
type(psb_c_svector) :: xh
@ -81,23 +446,23 @@ contains
integer(psb_c_ipk_) :: info
res = -1.0
if (c_associated(cdh%item)) then
if (c_associated(cdh%item)) then
call c_f_pointer(cdh%item,descp)
else
return
return
end if
if (c_associated(xh%item)) then
if (c_associated(xh%item)) then
call c_f_pointer(xh%item,xp)
else
return
return
end if
res = psb_geamax(xp,descp,info)
end function psb_c_sgeamax
function psb_c_sgeasum(xh,cdh) bind(c) result(res)
implicit none
implicit none
real(c_float) :: res
type(psb_c_svector) :: xh
@ -108,24 +473,24 @@ contains
res = -1.0
if (c_associated(cdh%item)) then
if (c_associated(cdh%item)) then
call c_f_pointer(cdh%item,descp)
else
return
return
end if
if (c_associated(xh%item)) then
if (c_associated(xh%item)) then
call c_f_pointer(xh%item,xp)
else
return
return
end if
res = psb_geasum(xp,descp,info)
end function psb_c_sgeasum
function psb_c_sspnrmi(ah,cdh) bind(c) result(res)
implicit none
implicit none
real(c_float) :: res
type(psb_c_sspmat) :: ah
@ -135,15 +500,15 @@ contains
integer(psb_c_ipk_) :: info
res = -1.0
if (c_associated(cdh%item)) then
if (c_associated(cdh%item)) then
call c_f_pointer(cdh%item,descp)
else
return
return
end if
if (c_associated(ah%item)) then
if (c_associated(ah%item)) then
call c_f_pointer(ah%item,ap)
else
return
return
end if
res = psb_spnrmi(ap,descp,info)
@ -151,7 +516,7 @@ contains
end function psb_c_sspnrmi
function psb_c_sgedot(xh,yh,cdh) bind(c) result(res)
implicit none
implicit none
real(c_float) :: res
type(psb_c_svector) :: xh,yh
@ -161,20 +526,20 @@ contains
integer(psb_c_ipk_) :: info
res = -1.0
if (c_associated(cdh%item)) then
if (c_associated(cdh%item)) then
call c_f_pointer(cdh%item,descp)
else
return
return
end if
if (c_associated(xh%item)) then
if (c_associated(xh%item)) then
call c_f_pointer(xh%item,xp)
else
return
return
end if
if (c_associated(yh%item)) then
if (c_associated(yh%item)) then
call c_f_pointer(yh%item,yp)
else
return
return
end if
res = psb_gedot(xp,yp,descp,info)
@ -182,7 +547,7 @@ contains
function psb_c_sspmm(alpha,ah,xh,beta,yh,cdh) bind(c) result(res)
implicit none
implicit none
integer(psb_c_ipk_) :: res
type(psb_c_sspmat) :: ah
@ -195,25 +560,25 @@ contains
integer(psb_c_ipk_) :: info
res = -1
if (c_associated(cdh%item)) then
if (c_associated(cdh%item)) then
call c_f_pointer(cdh%item,descp)
else
return
return
end if
if (c_associated(xh%item)) then
if (c_associated(xh%item)) then
call c_f_pointer(xh%item,xp)
else
return
return
end if
if (c_associated(yh%item)) then
if (c_associated(yh%item)) then
call c_f_pointer(yh%item,yp)
else
return
return
end if
if (c_associated(ah%item)) then
if (c_associated(ah%item)) then
call c_f_pointer(ah%item,ap)
else
return
return
end if
call psb_spmm(alpha,ap,xp,beta,yp,descp,info)
@ -224,7 +589,7 @@ contains
function psb_c_sspmm_opt(alpha,ah,xh,beta,yh,cdh,trans,doswap) bind(c) result(res)
implicit none
implicit none
integer(psb_c_ipk_) :: res
type(psb_c_sspmat) :: ah
@ -242,25 +607,25 @@ contains
integer(psb_c_ipk_) :: info
res = -1
if (c_associated(cdh%item)) then
if (c_associated(cdh%item)) then
call c_f_pointer(cdh%item,descp)
else
return
return
end if
if (c_associated(xh%item)) then
if (c_associated(xh%item)) then
call c_f_pointer(xh%item,xp)
else
return
return
end if
if (c_associated(yh%item)) then
if (c_associated(yh%item)) then
call c_f_pointer(yh%item,yp)
else
return
return
end if
if (c_associated(ah%item)) then
if (c_associated(ah%item)) then
call c_f_pointer(ah%item,ap)
else
return
return
end if
fdoswap = doswap
@ -270,10 +635,10 @@ contains
res = info
end function psb_c_sspmm_opt
function psb_c_sspsm(alpha,ah,xh,beta,yh,cdh) bind(c) result(res)
implicit none
implicit none
integer(psb_c_ipk_) :: res
type(psb_c_sspmat) :: ah
@ -286,25 +651,25 @@ contains
integer(psb_c_ipk_) :: info
res = -1
if (c_associated(cdh%item)) then
if (c_associated(cdh%item)) then
call c_f_pointer(cdh%item,descp)
else
return
return
end if
if (c_associated(xh%item)) then
if (c_associated(xh%item)) then
call c_f_pointer(xh%item,xp)
else
return
return
end if
if (c_associated(yh%item)) then
if (c_associated(yh%item)) then
call c_f_pointer(yh%item,yp)
else
return
return
end if
if (c_associated(ah%item)) then
if (c_associated(ah%item)) then
call c_f_pointer(ah%item,ap)
else
return
return
end if
call psb_spsm(alpha,ap,xp,beta,yp,descp,info)
@ -312,6 +677,6 @@ contains
res = info
end function psb_c_sspsm
end module psb_s_psblas_cbind_mod

@ -3,38 +3,38 @@ module psb_z_psblas_cbind_mod
use psb_base_mod
use psb_objhandle_mod
use psb_base_string_cbind_mod
contains
function psb_c_zgeaxpby(alpha,xh,beta,yh,cdh) bind(c) result(res)
implicit none
implicit none
integer(psb_c_ipk_) :: res
type(psb_c_zvector) :: xh,yh
type(psb_c_descriptor) :: cdh
complex(c_double_complex), value :: alpha,beta
type(psb_desc_type), pointer :: descp
type(psb_z_vect_type), pointer :: xp,yp
integer(psb_c_ipk_) :: info
res = -1
if (c_associated(cdh%item)) then
if (c_associated(cdh%item)) then
call c_f_pointer(cdh%item,descp)
else
return
return
end if
if (c_associated(xh%item)) then
if (c_associated(xh%item)) then
call c_f_pointer(xh%item,xp)
else
return
return
end if
if (c_associated(yh%item)) then
if (c_associated(yh%item)) then
call c_f_pointer(yh%item,yp)
else
return
return
end if
call psb_geaxpby(alpha,xp,beta,yp,descp,info)
@ -43,8 +43,261 @@ contains
end function psb_c_zgeaxpby
function psb_c_zgemlt(xh,yh,cdh) bind(c) result(res)
implicit none
integer(psb_c_ipk_) :: res
type(psb_c_zvector) :: xh,yh
type(psb_c_descriptor) :: cdh
type(psb_desc_type), pointer :: descp
type(psb_z_vect_type), pointer :: xp,yp
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(xh%item)) then
call c_f_pointer(xh%item,xp)
else
return
end if
if (c_associated(yh%item)) then
call c_f_pointer(yh%item,yp)
else
return
end if
call psb_gemlt(xp,yp,descp,info)
res = info
end function psb_c_zgemlt
function psb_c_zgediv(xh,yh,cdh) bind(c) result(res)
implicit none
integer(psb_c_ipk_) :: res
type(psb_c_zvector) :: xh,yh
type(psb_c_descriptor) :: cdh
type(psb_desc_type), pointer :: descp
type(psb_z_vect_type), pointer :: xp,yp
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(xh%item)) then
call c_f_pointer(xh%item,xp)
else
return
end if
if (c_associated(yh%item)) then
call c_f_pointer(yh%item,yp)
else
return
end if
call psb_gediv(xp,yp,descp,info)
res = info
end function psb_c_zgediv
function psb_c_zgediv_check(xh,yh,cdh, flag) bind(c) result(res)
implicit none
integer(psb_c_ipk_) :: res
type(psb_c_zvector) :: xh,yh
type(psb_c_descriptor) :: cdh
logical(c_bool), value :: flag
type(psb_desc_type), pointer :: descp
type(psb_z_vect_type), pointer :: xp,yp
integer(psb_c_ipk_) :: info
logical :: fflag
res = -1
if (c_associated(cdh%item)) then
call c_f_pointer(cdh%item,descp)
else
return
end if
if (c_associated(xh%item)) then
call c_f_pointer(xh%item,xp)
else
return
end if
if (c_associated(yh%item)) then
call c_f_pointer(yh%item,yp)
else
return
end if
fflag = flag
call psb_gediv(xp,yp,descp,info,fflag)
res = info
end function psb_c_zgediv_check
function psb_c_zgeinv(xh,yh,cdh) bind(c) result(res)
implicit none
integer(psb_c_ipk_) :: res
type(psb_c_zvector) :: xh,yh
type(psb_c_descriptor) :: cdh
type(psb_desc_type), pointer :: descp
type(psb_z_vect_type), pointer :: xp,yp
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(xh%item)) then
call c_f_pointer(xh%item,xp)
else
return
end if
if (c_associated(yh%item)) then
call c_f_pointer(yh%item,yp)
else
return
end if
call psb_geinv(xp,yp,descp,info)
res = info
end function psb_c_zgeinv
function psb_c_zgeinv_check(xh,yh,cdh, flag) bind(c) result(res)
implicit none
integer(psb_c_ipk_) :: res
type(psb_c_zvector) :: xh,yh
type(psb_c_descriptor) :: cdh
logical(c_bool), value :: flag
type(psb_desc_type), pointer :: descp
type(psb_z_vect_type), pointer :: xp,yp
integer(psb_c_ipk_) :: info
logical :: fflag
res = -1
if (c_associated(cdh%item)) then
call c_f_pointer(cdh%item,descp)
else
return
end if
if (c_associated(xh%item)) then
call c_f_pointer(xh%item,xp)
else
return
end if
if (c_associated(yh%item)) then
call c_f_pointer(yh%item,yp)
else
return
end if
fflag = flag
call psb_geinv(xp,yp,descp,info,fflag)
res = info
end function psb_c_zgeinv_check
function psb_c_zgeabs(xh,yh,cdh) bind(c) result(res)
implicit none
integer(psb_c_ipk_) :: res
type(psb_c_zvector) :: xh,yh
type(psb_c_descriptor) :: cdh
type(psb_desc_type), pointer :: descp
type(psb_z_vect_type), pointer :: xp,yp
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(xh%item)) then
call c_f_pointer(xh%item,xp)
else
return
end if
if (c_associated(yh%item)) then
call c_f_pointer(yh%item,yp)
else
return
end if
call psb_geabs(xp,yp,descp,info)
res = info
end function psb_c_zgeabs
function psb_c_zgecmp(xh,ch,zh,cdh) bind(c) result(res)
implicit none
integer(psb_c_ipk_) :: res
type(psb_c_zvector) :: xh,zh
type(psb_c_descriptor) :: cdh
type(psb_desc_type), pointer :: descp
type(psb_z_vect_type), pointer :: xp,zp
integer(psb_c_ipk_) :: info
real(c_double_complex) :: ch
res = -1
if (c_associated(cdh%item)) then
call c_f_pointer(cdh%item,descp)
else
return
end if
if (c_associated(xh%item)) then
call c_f_pointer(xh%item,xp)
else
return
end if
if (c_associated(zh%item)) then
call c_f_pointer(zh%item,zp)
else
return
end if
call psb_gecmp(xp,ch,zp,descp,info)
res = info
end function psb_c_zgecmp
function psb_c_zgenrm2(xh,cdh) bind(c) result(res)
implicit none
implicit none
real(c_double_complex) :: res
type(psb_c_zvector) :: xh
@ -55,23 +308,92 @@ contains
res = -1.0
if (c_associated(cdh%item)) then
if (c_associated(cdh%item)) then
call c_f_pointer(cdh%item,descp)
else
return
return
end if
if (c_associated(xh%item)) then
if (c_associated(xh%item)) then
call c_f_pointer(xh%item,xp)
else
return
return
end if
res = psb_genrm2(xp,descp,info)
end function psb_c_zgenrm2
function psb_c_zgenrm2_weight(xh,wh,cdh) bind(c) result(res)
implicit none
real(c_double_complex) :: res
type(psb_c_zvector) :: xh, wh
type(psb_c_descriptor) :: cdh
type(psb_desc_type), pointer :: descp
type(psb_z_vect_type), pointer :: xp, wp
integer(psb_c_ipk_) :: info
res = -1.0
if (c_associated(cdh%item)) then
call c_f_pointer(cdh%item,descp)
else
return
end if
if (c_associated(xh%item)) then
call c_f_pointer(xh%item,xp)
else
return
end if
if (c_associated(wh%item)) then
call c_f_pointer(wh%item,wp)
else
return
end if
res = psb_genrm2(xp,wp,descp,info)
end function psb_c_zgenrm2_weight
function psb_c_zgenrm2_weightmask(xh,wh,idvh,cdh) bind(c) result(res)
implicit none
real(c_double_complex) :: res
type(psb_c_zvector) :: xh, wh, idvh
type(psb_c_descriptor) :: cdh
type(psb_desc_type), pointer :: descp
type(psb_z_vect_type), pointer :: xp, wp, idvp
integer(psb_c_ipk_) :: info
res = -1.0
if (c_associated(cdh%item)) then
call c_f_pointer(cdh%item,descp)
else
return
end if
if (c_associated(xh%item)) then
call c_f_pointer(xh%item,xp)
else
return
end if
if (c_associated(wh%item)) then
call c_f_pointer(wh%item,wp)
else
return
end if
if (c_associated(idvh%item)) then
call c_f_pointer(idvh%item,idvp)
else
return
end if
res = psb_genrm2(xp,wp,idvp,descp,info)
end function psb_c_zgenrm2_weightmask
function psb_c_zgeamax(xh,cdh) bind(c) result(res)
implicit none
implicit none
real(c_double_complex) :: res
type(psb_c_zvector) :: xh
@ -81,23 +403,23 @@ contains
integer(psb_c_ipk_) :: info
res = -1.0
if (c_associated(cdh%item)) then
if (c_associated(cdh%item)) then
call c_f_pointer(cdh%item,descp)
else
return
return
end if
if (c_associated(xh%item)) then
if (c_associated(xh%item)) then
call c_f_pointer(xh%item,xp)
else
return
return
end if
res = psb_geamax(xp,descp,info)
end function psb_c_zgeamax
function psb_c_zgeasum(xh,cdh) bind(c) result(res)
implicit none
implicit none
real(c_double_complex) :: res
type(psb_c_zvector) :: xh
@ -108,24 +430,24 @@ contains
res = -1.0
if (c_associated(cdh%item)) then
if (c_associated(cdh%item)) then
call c_f_pointer(cdh%item,descp)
else
return
return
end if
if (c_associated(xh%item)) then
if (c_associated(xh%item)) then
call c_f_pointer(xh%item,xp)
else
return
return
end if
res = psb_geasum(xp,descp,info)
end function psb_c_zgeasum
function psb_c_zspnrmi(ah,cdh) bind(c) result(res)
implicit none
implicit none
real(c_double_complex) :: res
type(psb_c_zspmat) :: ah
@ -135,15 +457,15 @@ contains
integer(psb_c_ipk_) :: info
res = -1.0
if (c_associated(cdh%item)) then
if (c_associated(cdh%item)) then
call c_f_pointer(cdh%item,descp)
else
return
return
end if
if (c_associated(ah%item)) then
if (c_associated(ah%item)) then
call c_f_pointer(ah%item,ap)
else
return
return
end if
res = psb_spnrmi(ap,descp,info)
@ -151,7 +473,7 @@ contains
end function psb_c_zspnrmi
function psb_c_zgedot(xh,yh,cdh) bind(c) result(res)
implicit none
implicit none
complex(c_double_complex) :: res
type(psb_c_zvector) :: xh,yh
@ -161,20 +483,20 @@ contains
integer(psb_c_ipk_) :: info
res = -1.0
if (c_associated(cdh%item)) then
if (c_associated(cdh%item)) then
call c_f_pointer(cdh%item,descp)
else
return
return
end if
if (c_associated(xh%item)) then
if (c_associated(xh%item)) then
call c_f_pointer(xh%item,xp)
else
return
return
end if
if (c_associated(yh%item)) then
if (c_associated(yh%item)) then
call c_f_pointer(yh%item,yp)
else
return
return
end if
res = psb_gedot(xp,yp,descp,info)
@ -182,7 +504,7 @@ contains
function psb_c_zspmm(alpha,ah,xh,beta,yh,cdh) bind(c) result(res)
implicit none
implicit none
integer(psb_c_ipk_) :: res
type(psb_c_zspmat) :: ah
@ -195,25 +517,25 @@ contains
integer(psb_c_ipk_) :: info
res = -1
if (c_associated(cdh%item)) then
if (c_associated(cdh%item)) then
call c_f_pointer(cdh%item,descp)
else
return
return
end if
if (c_associated(xh%item)) then
if (c_associated(xh%item)) then
call c_f_pointer(xh%item,xp)
else
return
return
end if
if (c_associated(yh%item)) then
if (c_associated(yh%item)) then
call c_f_pointer(yh%item,yp)
else
return
return
end if
if (c_associated(ah%item)) then
if (c_associated(ah%item)) then
call c_f_pointer(ah%item,ap)
else
return
return
end if
call psb_spmm(alpha,ap,xp,beta,yp,descp,info)
@ -224,7 +546,7 @@ contains
function psb_c_zspmm_opt(alpha,ah,xh,beta,yh,cdh,trans,doswap) bind(c) result(res)
implicit none
implicit none
integer(psb_c_ipk_) :: res
type(psb_c_zspmat) :: ah
@ -242,25 +564,25 @@ contains
integer(psb_c_ipk_) :: info
res = -1
if (c_associated(cdh%item)) then
if (c_associated(cdh%item)) then
call c_f_pointer(cdh%item,descp)
else
return
return
end if
if (c_associated(xh%item)) then
if (c_associated(xh%item)) then
call c_f_pointer(xh%item,xp)
else
return
return
end if
if (c_associated(yh%item)) then
if (c_associated(yh%item)) then
call c_f_pointer(yh%item,yp)
else
return
return
end if
if (c_associated(ah%item)) then
if (c_associated(ah%item)) then
call c_f_pointer(ah%item,ap)
else
return
return
end if
fdoswap = doswap
@ -270,10 +592,10 @@ contains
res = info
end function psb_c_zspmm_opt
function psb_c_zspsm(alpha,ah,xh,beta,yh,cdh) bind(c) result(res)
implicit none
implicit none
integer(psb_c_ipk_) :: res
type(psb_c_zspmat) :: ah
@ -286,25 +608,25 @@ contains
integer(psb_c_ipk_) :: info
res = -1
if (c_associated(cdh%item)) then
if (c_associated(cdh%item)) then
call c_f_pointer(cdh%item,descp)
else
return
return
end if
if (c_associated(xh%item)) then
if (c_associated(xh%item)) then
call c_f_pointer(xh%item,xp)
else
return
return
end if
if (c_associated(yh%item)) then
if (c_associated(yh%item)) then
call c_f_pointer(yh%item,yp)
else
return
return
end if
if (c_associated(ah%item)) then
if (c_associated(ah%item)) then
call c_f_pointer(ah%item,ap)
else
return
return
end if
call psb_spsm(alpha,ap,xp,beta,yp,descp,info)
@ -312,6 +634,6 @@ contains
res = info
end function psb_c_zspsm
end module psb_z_psblas_cbind_mod

Loading…
Cancel
Save