@ -304,6 +304,123 @@ subroutine psb_dins_vect(m, irw, val, x, desc_a, info, dupl,local)
end subroutine psb_dins_vect
subroutine psb_dins_vect_v ( m , irw , val , x , desc_a , info , dupl , local )
use psb_base_mod , psb_protect_name = > psb_dins_vect_v
use psi_mod
implicit none
! m rows number of submatrix belonging to val to be inserted
! ix x global - row corresponding to position at which val submatrix
! must be inserted
! . . . . parameters . . .
integer ( psb_ipk_ ) , intent ( in ) :: m
type ( psb_i_vect_type ) , intent ( inout ) :: irw
type ( psb_d_vect_type ) , intent ( inout ) :: val
type ( psb_d_vect_type ) , intent ( inout ) :: x
type ( psb_desc_type ) , intent ( in ) :: desc_a
integer ( psb_ipk_ ) , intent ( out ) :: info
integer ( psb_ipk_ ) , optional , intent ( in ) :: dupl
logical , intent ( in ) , optional :: local
! locals . . . . .
integer ( psb_ipk_ ) :: ictxt , i , &
& loc_rows , loc_cols , mglob , err_act , int_err ( 5 )
integer ( psb_ipk_ ) :: np , me , dupl_
integer ( psb_ipk_ ) , allocatable :: irl ( : )
real ( psb_dpk_ ) , allocatable :: lval ( : )
logical :: local_
character ( len = 20 ) :: name
if ( psb_errstatus_fatal ( ) ) return
info = psb_success_
call psb_erractionsave ( err_act )
name = 'psb_dinsvi'
if ( . not . desc_a % is_ok ( ) ) then
info = psb_err_invalid_cd_state_
call psb_errpush ( info , name )
go to 9999
end if
ictxt = desc_a % get_context ( )
call psb_info ( ictxt , me , np )
if ( np == - 1 ) then
info = psb_err_context_error_
call psb_errpush ( info , name )
go to 9999
endif
! . . . check parameters . . . .
if ( m < 0 ) then
info = psb_err_iarg_neg_
int_err ( 1 ) = 1
int_err ( 2 ) = m
call psb_errpush ( info , name , int_err )
go to 9999
else if ( x % get_nrows ( ) < desc_a % get_local_rows ( ) ) then
info = 310
int_err ( 1 ) = 5
int_err ( 2 ) = 4
call psb_errpush ( info , name , int_err )
go to 9999
endif
if ( m == 0 ) return
loc_rows = desc_a % get_local_rows ( )
loc_cols = desc_a % get_local_cols ( )
mglob = desc_a % get_global_rows ( )
if ( . not . allocated ( x % v ) ) then
info = psb_err_invalid_vect_state_
call psb_errpush ( info , name )
go to 9999
endif
if ( present ( dupl ) ) then
dupl_ = dupl
else
dupl_ = psb_dupl_ovwrt_
endif
if ( present ( local ) ) then
local_ = local
else
local_ = . false .
endif
if ( local_ ) then
call x % ins ( m , irw , val , dupl_ , info )
else
irl = irw % get_vect ( )
lval = val % get_vect ( )
call desc_a % indxmap % g2lip ( irl ( 1 : m ) , info , owned = . true . )
call x % ins ( m , irl , lval , dupl_ , info )
end if
if ( info / = 0 ) then
call psb_errpush ( info , name )
go to 9999
end if
deallocate ( irl )
call psb_erractionrestore ( err_act )
return
9999 continue
call psb_erractionrestore ( err_act )
if ( err_act == psb_act_ret_ ) then
return
else
call psb_error ( ictxt )
end if
return
end subroutine psb_dins_vect_v
subroutine psb_dins_vect_r2 ( m , irw , val , x , desc_a , info , dupl , local )
use psb_base_mod , psb_protect_name = > psb_dins_vect_r2
use psi_mod