mirror of
https://github.com/sfilippone/psblas3.git
synced 2026-10-20 04:42:08 +00:00
added vect_set_vect
This commit is contained in:
@@ -54,6 +54,8 @@ 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);
|
||||
|
||||
/* psblas computational routines */
|
||||
psb_c_t psb_c_cgedot(psb_c_cvector *xh, psb_c_cvector *yh, psb_c_descriptor *cdh);
|
||||
|
||||
@@ -54,6 +54,8 @@ psb_i_t psb_c_dcopy_mat(psb_c_dspmat *ah,psb_c_dspmat *bh,psb_c_descriptor *cd
|
||||
/* const char *afmt, psb_i_t upd, psb_i_t dupl); */
|
||||
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_vect(psb_c_dvector *xh, psb_d_t *val, psb_i_t n);
|
||||
|
||||
/* psblas computational routines */
|
||||
psb_d_t psb_c_dgedot(psb_c_dvector *xh, psb_c_dvector *yh, psb_c_descriptor *cdh);
|
||||
|
||||
@@ -54,6 +54,8 @@ psb_i_t psb_c_scopy_mat(psb_c_sspmat *ah,psb_c_sspmat *bh,psb_c_descriptor *cd
|
||||
/* const char *afmt, psb_i_t upd, psb_i_t dupl); */
|
||||
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_vect(psb_c_svector *xh, psb_s_t *val, psb_i_t n);
|
||||
|
||||
/* psblas computational routines */
|
||||
psb_s_t psb_c_sgedot(psb_c_svector *xh, psb_c_svector *yh, psb_c_descriptor *cdh);
|
||||
|
||||
@@ -157,5 +157,52 @@ contains
|
||||
|
||||
end function psb_c_cmat_name_print
|
||||
|
||||
function psb_c_cvect_set_scal(x,val) 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
|
||||
complex(c_float_complex), value :: val
|
||||
|
||||
info = -1;
|
||||
|
||||
if (c_associated(x%item)) then
|
||||
call c_f_pointer(x%item,xp)
|
||||
else
|
||||
return
|
||||
end if
|
||||
|
||||
call xp%set(val)
|
||||
|
||||
info = 0
|
||||
|
||||
end function psb_c_cvect_set_scal
|
||||
|
||||
function psb_c_cvect_set_vect(x,val,n) 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 :: n
|
||||
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(1:n))
|
||||
|
||||
info = 0
|
||||
|
||||
end function psb_c_cvect_set_vect
|
||||
|
||||
|
||||
end module psb_c_serial_cbind_mod
|
||||
|
||||
@@ -55,6 +55,8 @@ psb_i_t psb_c_zcopy_mat(psb_c_zspmat *ah,psb_c_zspmat *bh,psb_c_descriptor *cd
|
||||
/* const char *afmt, psb_i_t upd, psb_i_t dupl); */
|
||||
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_vect(psb_c_zvector *xh, psb_z_t *val, psb_i_t n);
|
||||
|
||||
/* psblas computational routines */
|
||||
psb_z_t psb_c_zgedot(psb_c_zvector *xh, psb_c_zvector *yh, psb_c_descriptor *cdh);
|
||||
|
||||
@@ -157,5 +157,52 @@ contains
|
||||
|
||||
end function psb_c_dmat_name_print
|
||||
|
||||
function psb_c_dvect_set_scal(x,val) 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
|
||||
real(c_double), value :: val
|
||||
|
||||
info = -1;
|
||||
|
||||
if (c_associated(x%item)) then
|
||||
call c_f_pointer(x%item,xp)
|
||||
else
|
||||
return
|
||||
end if
|
||||
|
||||
call xp%set(val)
|
||||
|
||||
info = 0
|
||||
|
||||
end function psb_c_dvect_set_scal
|
||||
|
||||
function psb_c_dvect_set_vect(x,val,n) 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 :: n
|
||||
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(1:n))
|
||||
|
||||
info = 0
|
||||
|
||||
end function psb_c_dvect_set_vect
|
||||
|
||||
|
||||
end module psb_d_serial_cbind_mod
|
||||
|
||||
@@ -157,5 +157,52 @@ contains
|
||||
|
||||
end function psb_c_smat_name_print
|
||||
|
||||
function psb_c_svect_set_scal(x,val) 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
|
||||
real(c_float), value :: val
|
||||
|
||||
info = -1;
|
||||
|
||||
if (c_associated(x%item)) then
|
||||
call c_f_pointer(x%item,xp)
|
||||
else
|
||||
return
|
||||
end if
|
||||
|
||||
call xp%set(val)
|
||||
|
||||
info = 0
|
||||
|
||||
end function psb_c_svect_set_scal
|
||||
|
||||
function psb_c_svect_set_vect(x,val,n) 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 :: n
|
||||
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(1:n))
|
||||
|
||||
info = 0
|
||||
|
||||
end function psb_c_svect_set_vect
|
||||
|
||||
|
||||
end module psb_s_serial_cbind_mod
|
||||
|
||||
@@ -157,5 +157,52 @@ contains
|
||||
|
||||
end function psb_c_zmat_name_print
|
||||
|
||||
function psb_c_zvect_set_scal(x,val) 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
|
||||
complex(c_double_complex), value :: val
|
||||
|
||||
info = -1;
|
||||
|
||||
if (c_associated(x%item)) then
|
||||
call c_f_pointer(x%item,xp)
|
||||
else
|
||||
return
|
||||
end if
|
||||
|
||||
call xp%set(val)
|
||||
|
||||
info = 0
|
||||
|
||||
end function psb_c_zvect_set_scal
|
||||
|
||||
function psb_c_zvect_set_vect(x,val,n) 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 :: n
|
||||
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(1:n))
|
||||
|
||||
info = 0
|
||||
|
||||
end function psb_c_zvect_set_vect
|
||||
|
||||
|
||||
end module psb_z_serial_cbind_mod
|
||||
|
||||
Reference in New Issue
Block a user