diff --git a/cbind/base/psb_c_cbase.h b/cbind/base/psb_c_cbase.h index eb3cfe92..8fbd7f6b 100644 --- a/cbind/base/psb_c_cbase.h +++ b/cbind/base/psb_c_cbase.h @@ -58,8 +58,10 @@ psb_i_t psb_c_ccopy_mat(psb_c_cspmat *ah,psb_c_cspmat *bh,psb_c_descriptor *cd /* const char *afmt, psb_i_t upd, psb_i_t dupl); */ psb_i_t psb_c_csprn(psb_c_cspmat *mh, psb_c_descriptor *cdh, _Bool clear); psb_i_t psb_c_cmat_name_print(psb_c_cspmat *mh, char *name); -psb_i_t psb_c_cvect_set_scal(psb_c_cvector *xh, psb_c_t val); -psb_i_t psb_c_cvect_set_vect(psb_c_cvector *xh, psb_c_t *val, psb_i_t n); +psb_i_t psb_c_cvect_set_scal(psb_c_cvector *xh, psb_c_t val); +psb_i_t psb_c_cvect_set_scal_bound(psb_c_cvector *xh, psb_c_t val, + psb_i_t ifirst, psb_i_t ilast); +psb_i_t psb_c_cvect_set_vect(psb_c_cvector *xh, psb_c_t *val, psb_i_t n); psb_c_t psb_c_cvect_get_entry(psb_c_cvector *xh, psb_i_t index); psb_i_t psb_c_cvect_set_entry(psb_c_cvector *xh, psb_i_t index, psb_c_t val); diff --git a/cbind/base/psb_c_dbase.h b/cbind/base/psb_c_dbase.h index c407dcc8..125139a4 100644 --- a/cbind/base/psb_c_dbase.h +++ b/cbind/base/psb_c_dbase.h @@ -59,6 +59,8 @@ psb_i_t psb_c_dcopy_mat(psb_c_dspmat *ah,psb_c_dspmat *bh,psb_c_descriptor *cd psb_i_t psb_c_dsprn(psb_c_dspmat *mh, psb_c_descriptor *cdh, _Bool clear); psb_i_t psb_c_dmat_name_print(psb_c_dspmat *mh, char *name); psb_i_t psb_c_dvect_set_scal(psb_c_dvector *xh, psb_d_t val); +psb_i_t psb_c_dvect_set_scal_bound(psb_c_dvector *xh, psb_d_t val, + psb_i_t ifirst, psb_i_t ilast); psb_i_t psb_c_dvect_set_vect(psb_c_dvector *xh, psb_d_t *val, psb_i_t n); psb_d_t psb_c_dvect_get_entry(psb_c_dvector *xh, psb_i_t index); psb_i_t psb_c_dvect_set_entry(psb_c_dvector *xh, psb_i_t index, psb_d_t val); diff --git a/cbind/base/psb_c_sbase.h b/cbind/base/psb_c_sbase.h index 53d95fc7..c006d227 100644 --- a/cbind/base/psb_c_sbase.h +++ b/cbind/base/psb_c_sbase.h @@ -59,6 +59,8 @@ psb_i_t psb_c_scopy_mat(psb_c_sspmat *ah,psb_c_sspmat *bh,psb_c_descriptor *cd psb_i_t psb_c_ssprn(psb_c_sspmat *mh, psb_c_descriptor *cdh, _Bool clear); psb_i_t psb_c_smat_name_print(psb_c_sspmat *mh, char *name); psb_i_t psb_c_svect_set_scal(psb_c_svector *xh, psb_s_t val); +psb_i_t psb_c_svect_set_scal_bound(psb_c_svector *xh, psb_s_t val, + psb_i_t ifirst, psb_i_t ilast); psb_i_t psb_c_svect_set_vect(psb_c_svector *xh, psb_s_t *val, psb_i_t n); psb_s_t psb_c_svect_get_entry(psb_c_svector *xh, psb_i_t index); psb_i_t psb_c_svect_set_entry(psb_c_svector *xh, psb_i_t index, psb_s_t val); diff --git a/cbind/base/psb_c_serial_cbind_mod.F90 b/cbind/base/psb_c_serial_cbind_mod.F90 index 77d04525..ab8ad7e1 100644 --- a/cbind/base/psb_c_serial_cbind_mod.F90 +++ b/cbind/base/psb_c_serial_cbind_mod.F90 @@ -180,6 +180,30 @@ contains end function psb_c_cvect_set_scal + function psb_c_cvect_set_scal_bound(x,val,ifirst,ilast) bind(c) result(info) + use psb_base_mod + implicit none + + type(psb_c_cvector) :: x + type(psb_c_vect_type), pointer :: xp + integer(psb_c_ipk_) :: info + integer(psb_c_ipk_), value :: ifirst, ilast + complex(c_float_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_cvect_set_scal_bound + function psb_c_cvect_set_vect(x,val,n) bind(c) result(info) use psb_base_mod implicit none @@ -204,7 +228,6 @@ contains end function psb_c_cvect_set_vect - function psb_c_cvect_set_entry(x,index,val) bind(c) result(info) use psb_base_mod implicit none diff --git a/cbind/base/psb_c_zbase.h b/cbind/base/psb_c_zbase.h index bce1a928..afbb7cb3 100644 --- a/cbind/base/psb_c_zbase.h +++ b/cbind/base/psb_c_zbase.h @@ -60,6 +60,8 @@ psb_i_t psb_c_zcopy_mat(psb_c_zspmat *ah,psb_c_zspmat *bh,psb_c_descriptor *cd psb_i_t psb_c_zsprn(psb_c_zspmat *mh, psb_c_descriptor *cdh, _Bool clear); psb_i_t psb_c_zmat_name_print(psb_c_zspmat *mh, char *name); psb_i_t psb_c_zvect_set_scal(psb_c_zvector *xh, psb_z_t val); +psb_i_t psb_c_zvect_set_scal_bound(psb_c_zvector *xh, psb_z_t val, + psb_i_t ifirst, psb_i_t ilast); psb_i_t psb_c_zvect_set_vect(psb_c_zvector *xh, psb_z_t *val, psb_i_t n); psb_z_t psb_c_zvect_get_entry(psb_c_zvector *xh, psb_i_t index); psb_i_t psb_c_zvect_set_entry(psb_c_zvector *xh, psb_i_t index, psb_z_t val); diff --git a/cbind/base/psb_d_serial_cbind_mod.F90 b/cbind/base/psb_d_serial_cbind_mod.F90 index 8d8a8bbe..dc559c64 100644 --- a/cbind/base/psb_d_serial_cbind_mod.F90 +++ b/cbind/base/psb_d_serial_cbind_mod.F90 @@ -180,6 +180,30 @@ contains end function psb_c_dvect_set_scal + function psb_c_dvect_set_scal_bound(x,val,ifirst,ilast) bind(c) result(info) + use psb_base_mod + implicit none + + type(psb_c_dvector) :: x + type(psb_d_vect_type), pointer :: xp + integer(psb_c_ipk_) :: info + integer(psb_c_ipk_), value :: ifirst, ilast + real(c_double) :: 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_dvect_set_scal_bound + function psb_c_dvect_set_vect(x,val,n) bind(c) result(info) use psb_base_mod implicit none @@ -204,7 +228,6 @@ contains end function psb_c_dvect_set_vect - function psb_c_dvect_set_entry(x,index,val) bind(c) result(info) use psb_base_mod implicit none diff --git a/cbind/base/psb_s_serial_cbind_mod.F90 b/cbind/base/psb_s_serial_cbind_mod.F90 index fafd854f..93fc7f8d 100644 --- a/cbind/base/psb_s_serial_cbind_mod.F90 +++ b/cbind/base/psb_s_serial_cbind_mod.F90 @@ -180,6 +180,30 @@ contains end function psb_c_svect_set_scal + function psb_c_svect_set_scal_bound(x,val,ifirst,ilast) bind(c) result(info) + use psb_base_mod + implicit none + + type(psb_c_svector) :: x + type(psb_s_vect_type), pointer :: xp + integer(psb_c_ipk_) :: info + integer(psb_c_ipk_), value :: ifirst, ilast + real(c_float) :: 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_svect_set_scal_bound + function psb_c_svect_set_vect(x,val,n) bind(c) result(info) use psb_base_mod implicit none @@ -204,7 +228,6 @@ contains end function psb_c_svect_set_vect - function psb_c_svect_set_entry(x,index,val) bind(c) result(info) use psb_base_mod implicit none diff --git a/cbind/base/psb_z_serial_cbind_mod.F90 b/cbind/base/psb_z_serial_cbind_mod.F90 index 5986e221..15a46bb5 100644 --- a/cbind/base/psb_z_serial_cbind_mod.F90 +++ b/cbind/base/psb_z_serial_cbind_mod.F90 @@ -180,6 +180,30 @@ contains 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) use psb_base_mod implicit none @@ -204,7 +228,6 @@ contains end function psb_c_zvect_set_vect - function psb_c_zvect_set_entry(x,index,val) bind(c) result(info) use psb_base_mod implicit none