mirror of
https://github.com/sfilippone/psblas3.git
synced 2026-10-06 22:55:08 +00:00
Added implementation of A = alpha A + beta B for sparse matrices
This commit is contained in:
@@ -1151,4 +1151,40 @@ contains
|
||||
|
||||
end function psb_c_cspscalpid
|
||||
|
||||
function psb_c_cspaxpby(alpha,ah,beta,bh,cdh) bind(c) result(res)
|
||||
implicit none
|
||||
integer(psb_c_ipk_) :: res
|
||||
|
||||
complex(c_float_complex), value :: alpha
|
||||
type(psb_c_cspmat) :: ah
|
||||
complex(c_float_complex), value :: beta
|
||||
type(psb_c_cspmat) :: bh
|
||||
type(psb_c_descriptor) :: cdh
|
||||
|
||||
type(psb_desc_type), pointer :: descp
|
||||
type(psb_cspmat_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%spaxpby(alpha,beta,bp,info)
|
||||
|
||||
res = info
|
||||
end function psb_c_cspaxpby
|
||||
|
||||
end module psb_c_psblas_cbind_mod
|
||||
|
||||
@@ -1252,4 +1252,40 @@ contains
|
||||
|
||||
end function psb_c_dspscalpid
|
||||
|
||||
function psb_c_dspaxpby(alpha,ah,beta,bh,cdh) bind(c) result(res)
|
||||
implicit none
|
||||
integer(psb_c_ipk_) :: res
|
||||
|
||||
real(c_double), value :: alpha
|
||||
type(psb_c_dspmat) :: ah
|
||||
real(c_double), value :: beta
|
||||
type(psb_c_dspmat) :: bh
|
||||
type(psb_c_descriptor) :: cdh
|
||||
|
||||
type(psb_desc_type), pointer :: descp
|
||||
type(psb_dspmat_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%spaxpby(alpha,beta,bp,info)
|
||||
|
||||
res = info
|
||||
end function psb_c_dspaxpby
|
||||
|
||||
end module psb_d_psblas_cbind_mod
|
||||
|
||||
@@ -1252,4 +1252,40 @@ contains
|
||||
|
||||
end function psb_c_sspscalpid
|
||||
|
||||
function psb_c_sspaxpby(alpha,ah,beta,bh,cdh) bind(c) result(res)
|
||||
implicit none
|
||||
integer(psb_c_ipk_) :: res
|
||||
|
||||
real(c_float), value :: alpha
|
||||
type(psb_c_sspmat) :: ah
|
||||
real(c_float), value :: beta
|
||||
type(psb_c_sspmat) :: bh
|
||||
type(psb_c_descriptor) :: cdh
|
||||
|
||||
type(psb_desc_type), pointer :: descp
|
||||
type(psb_sspmat_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%spaxpby(alpha,beta,bp,info)
|
||||
|
||||
res = info
|
||||
end function psb_c_sspaxpby
|
||||
|
||||
end module psb_s_psblas_cbind_mod
|
||||
|
||||
@@ -1151,4 +1151,40 @@ contains
|
||||
|
||||
end function psb_c_zspscalpid
|
||||
|
||||
function psb_c_zspaxpby(alpha,ah,beta,bh,cdh) bind(c) result(res)
|
||||
implicit none
|
||||
integer(psb_c_ipk_) :: res
|
||||
|
||||
complex(c_double_complex), value :: alpha
|
||||
type(psb_c_zspmat) :: ah
|
||||
complex(c_double_complex), value :: beta
|
||||
type(psb_c_zspmat) :: 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%spaxpby(alpha,beta,bp,info)
|
||||
|
||||
res = info
|
||||
end function psb_c_zspaxpby
|
||||
|
||||
end module psb_z_psblas_cbind_mod
|
||||
|
||||
Reference in New Issue
Block a user