diff --git a/cbind/base/psb_c_cbase.h b/cbind/base/psb_c_cbase.h index b977a3fb..35f744a7 100644 --- a/cbind/base/psb_c_cbase.h +++ b/cbind/base/psb_c_cbase.h @@ -51,7 +51,7 @@ psb_c_t psb_c_cgedot(psb_c_cvector *xh, psb_c_cvector *yh, psb_c_descriptor *cdh psb_s_t psb_c_cgenrm2(psb_c_cvector *xh, psb_c_descriptor *cdh); psb_s_t psb_c_cgeamax(psb_c_cvector *xh, psb_c_descriptor *cdh); psb_s_t psb_c_cgeasum(psb_c_cvector *xh, psb_c_descriptor *cdh); -psb_s_t psb_c_cspnrmi(psb_c_cspmat *ah, psb_c_descriptor *cdh); +psb_s_t psb_c_cgenrmi(psb_c_cspmat *ah, psb_c_descriptor *cdh); psb_i_t psb_c_cgeaxpby(psb_c_t alpha, psb_c_cvector *xh, psb_c_t beta, psb_c_cvector *yh, psb_c_descriptor *cdh); psb_i_t psb_c_cgeaxpbyz(psb_c_t alpha, psb_c_cvector *xh, diff --git a/cbind/base/psb_c_dbase.h b/cbind/base/psb_c_dbase.h index 4a1ee601..b5b38158 100644 --- a/cbind/base/psb_c_dbase.h +++ b/cbind/base/psb_c_dbase.h @@ -51,7 +51,7 @@ psb_d_t psb_c_dgedot(psb_c_dvector *xh, psb_c_dvector *yh, psb_c_descriptor *cdh psb_d_t psb_c_dgenrm2(psb_c_dvector *xh, psb_c_descriptor *cdh); psb_d_t psb_c_dgeamax(psb_c_dvector *xh, psb_c_descriptor *cdh); psb_d_t psb_c_dgeasum(psb_c_dvector *xh, psb_c_descriptor *cdh); -psb_d_t psb_c_dspnrmi(psb_c_dvector *xh, psb_c_descriptor *cdh); +psb_d_t psb_c_dgenrmi(psb_c_dvector *xh, psb_c_descriptor *cdh); psb_i_t psb_c_dgeaxpby(psb_d_t alpha, psb_c_dvector *xh, psb_d_t beta, psb_c_dvector *yh, psb_c_descriptor *cdh); psb_i_t psb_c_dgeaxpbyz(psb_d_t alpha, psb_c_dvector *xh, diff --git a/cbind/base/psb_c_psblas_cbind_mod.f90 b/cbind/base/psb_c_psblas_cbind_mod.f90 index 6bbee920..00f80280 100644 --- a/cbind/base/psb_c_psblas_cbind_mod.f90 +++ b/cbind/base/psb_c_psblas_cbind_mod.f90 @@ -563,6 +563,37 @@ contains end function psb_c_cgenrm2 + function psb_c_cgenrmi(xh,cdh) bind(c) result(res) + implicit none + real(c_float_complex) :: res + + type(psb_c_cvector) :: xh + type(psb_c_descriptor) :: cdh + type(psb_desc_type), pointer :: descp + type(psb_c_vect_type), pointer :: xp + type(psb_c_vect_type) :: yp + 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 + + call psb_geall(yp,descp,info) + call psb_geabs(xp,yp,descp,info) + res = psb_geasum(yp,descp,info) + call psb_gefree(yp,descp,info) + + end function psb_c_cgenrmi + function psb_c_cgenrm2_weight(xh,wh,cdh) bind(c) result(res) implicit none real(c_float_complex) :: res diff --git a/cbind/base/psb_c_sbase.h b/cbind/base/psb_c_sbase.h index bee92c65..7449ba51 100644 --- a/cbind/base/psb_c_sbase.h +++ b/cbind/base/psb_c_sbase.h @@ -51,7 +51,7 @@ psb_s_t psb_c_sgedot(psb_c_svector *xh, psb_c_svector *yh, psb_c_descriptor *cdh psb_s_t psb_c_sgenrm2(psb_c_svector *xh, psb_c_descriptor *cdh); psb_s_t psb_c_sgeamax(psb_c_svector *xh, psb_c_descriptor *cdh); psb_s_t psb_c_sgeasum(psb_c_svector *xh, psb_c_descriptor *cdh); -psb_s_t psb_c_sspnrmi(psb_c_sspmat *ah, psb_c_descriptor *cdh); +psb_s_t psb_c_sgenrmi(psb_c_sspmat *ah, psb_c_descriptor *cdh); psb_i_t psb_c_sgeaxpby(psb_s_t alpha, psb_c_svector *xh, psb_s_t beta, psb_c_svector *yh, psb_c_descriptor *cdh); psb_i_t psb_c_sgeaxpbyz(psb_s_t alpha, psb_c_svector *xh, diff --git a/cbind/base/psb_c_zbase.h b/cbind/base/psb_c_zbase.h index 29cb2d3f..9159b372 100644 --- a/cbind/base/psb_c_zbase.h +++ b/cbind/base/psb_c_zbase.h @@ -51,7 +51,7 @@ psb_z_t psb_c_zgedot(psb_c_zvector *xh, psb_c_zvector *yh, psb_c_descriptor *cdh psb_d_t psb_c_zgenrm2(psb_c_zvector *xh, psb_c_descriptor *cdh); psb_d_t psb_c_zgeamax(psb_c_zvector *xh, psb_c_descriptor *cdh); psb_d_t psb_c_zgeasum(psb_c_zvector *xh, psb_c_descriptor *cdh); -psb_d_t psb_c_zspnrmi(psb_c_zspmat *ah, psb_c_descriptor *cdh); +psb_d_t psb_c_zgenrmi(psb_c_zspmat *ah, psb_c_descriptor *cdh); psb_i_t psb_c_zgeaxpby(psb_z_t alpha, psb_c_zvector *xh, psb_z_t beta, psb_c_zvector *yh, psb_c_descriptor *cdh); psb_i_t psb_c_zgeaxpbyz(psb_z_t alpha, psb_c_zvector *xh, diff --git a/cbind/base/psb_d_psblas_cbind_mod.f90 b/cbind/base/psb_d_psblas_cbind_mod.f90 index fd2d670a..2260e09e 100644 --- a/cbind/base/psb_d_psblas_cbind_mod.f90 +++ b/cbind/base/psb_d_psblas_cbind_mod.f90 @@ -640,6 +640,37 @@ contains end function psb_c_dgenrm2 + function psb_c_dgenrmi(xh,cdh) bind(c) result(res) + implicit none + real(c_double) :: res + + type(psb_c_dvector) :: xh + type(psb_c_descriptor) :: cdh + type(psb_desc_type), pointer :: descp + type(psb_d_vect_type), pointer :: xp + type(psb_d_vect_type) :: yp + 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 + + call psb_geall(yp,descp,info) + call psb_geabs(xp,yp,descp,info) + res = psb_geasum(yp,descp,info) + call psb_gefree(yp,descp,info) + + end function psb_c_dgenrmi + function psb_c_dgenrm2_weight(xh,wh,cdh) bind(c) result(res) implicit none real(c_double) :: res diff --git a/cbind/base/psb_s_psblas_cbind_mod.f90 b/cbind/base/psb_s_psblas_cbind_mod.f90 index 9a7a3571..bba8e7da 100644 --- a/cbind/base/psb_s_psblas_cbind_mod.f90 +++ b/cbind/base/psb_s_psblas_cbind_mod.f90 @@ -640,6 +640,37 @@ contains end function psb_c_sgenrm2 + function psb_c_sgenrmi(xh,cdh) bind(c) result(res) + implicit none + real(c_float) :: res + + type(psb_c_svector) :: xh + type(psb_c_descriptor) :: cdh + type(psb_desc_type), pointer :: descp + type(psb_s_vect_type), pointer :: xp + type(psb_s_vect_type) :: yp + 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 + + call psb_geall(yp,descp,info) + call psb_geabs(xp,yp,descp,info) + res = psb_geasum(yp,descp,info) + call psb_gefree(yp,descp,info) + + end function psb_c_sgenrmi + function psb_c_sgenrm2_weight(xh,wh,cdh) bind(c) result(res) implicit none real(c_float) :: res diff --git a/cbind/base/psb_z_psblas_cbind_mod.f90 b/cbind/base/psb_z_psblas_cbind_mod.f90 index 1b7f83a6..0e1dd23e 100644 --- a/cbind/base/psb_z_psblas_cbind_mod.f90 +++ b/cbind/base/psb_z_psblas_cbind_mod.f90 @@ -563,6 +563,37 @@ contains end function psb_c_zgenrm2 + function psb_c_zgenrmi(xh,cdh) bind(c) result(res) + implicit none + real(c_double_complex) :: res + + type(psb_c_zvector) :: xh + type(psb_c_descriptor) :: cdh + type(psb_desc_type), pointer :: descp + type(psb_z_vect_type), pointer :: xp + type(psb_z_vect_type) :: yp + 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 + + call psb_geall(yp,descp,info) + call psb_geabs(xp,yp,descp,info) + res = psb_geasum(yp,descp,info) + call psb_gefree(yp,descp,info) + + end function psb_c_zgenrmi + function psb_c_zgenrm2_weight(xh,wh,cdh) bind(c) result(res) implicit none real(c_double_complex) :: res