|
|
|
|
@ -205,13 +205,14 @@ module psb_c_base_vect_mod
|
|
|
|
|
!
|
|
|
|
|
! Vector-Vector operations
|
|
|
|
|
!
|
|
|
|
|
procedure, pass(x) :: div_v => c_base_div_v
|
|
|
|
|
procedure, pass(x) :: div_v_check => c_base_div_v_check
|
|
|
|
|
procedure, pass(y) :: div_v => c_base_div_v
|
|
|
|
|
procedure, pass(y) :: div_a => c_base_div_a
|
|
|
|
|
procedure, pass(y) :: div_v_check => c_base_div_v_check
|
|
|
|
|
procedure, pass(z) :: div_v2 => c_base_div_v2
|
|
|
|
|
procedure, pass(z) :: div_v2_check => c_base_div_v2_check
|
|
|
|
|
procedure, pass(z) :: div_a2 => c_base_div_a2
|
|
|
|
|
procedure, pass(z) :: div_a2_check => c_base_div_a2_check
|
|
|
|
|
generic, public :: div => div_v, div_v2, div_v_check, &
|
|
|
|
|
generic, public :: div => div_v, div_v2, div_v_check, div_a, &
|
|
|
|
|
div_v2_check, div_a2, div_a2_check
|
|
|
|
|
procedure, pass(y) :: inv_v => c_base_inv_v
|
|
|
|
|
procedure, pass(y) :: inv_v_check => c_base_inv_v_check
|
|
|
|
|
@ -1280,7 +1281,7 @@ contains
|
|
|
|
|
integer(psb_ipk_), intent(in) :: index
|
|
|
|
|
complex(psb_spk_) :: res
|
|
|
|
|
|
|
|
|
|
res = 0
|
|
|
|
|
res = czero
|
|
|
|
|
if (allocated(x%v)) then
|
|
|
|
|
if (x%is_dev()) call x%sync()
|
|
|
|
|
res = x%v(index)
|
|
|
|
|
@ -1293,14 +1294,12 @@ contains
|
|
|
|
|
class(psb_c_base_vect_type), intent(inout) :: x
|
|
|
|
|
integer(psb_ipk_), intent(in) :: index
|
|
|
|
|
complex(psb_spk_) :: val
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (allocated(x%v)) then
|
|
|
|
|
if (x%is_dev()) call x%sync()
|
|
|
|
|
x%v(index) =val
|
|
|
|
|
call x%set_host()
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
end subroutine c_base_set_entry
|
|
|
|
|
|
|
|
|
|
!
|
|
|
|
|
@ -1817,9 +1816,28 @@ contains
|
|
|
|
|
|
|
|
|
|
info = 0
|
|
|
|
|
if (x%is_dev()) call x%sync()
|
|
|
|
|
call x%div(x%v,y%v,info)
|
|
|
|
|
call y%div(x%v,info)
|
|
|
|
|
|
|
|
|
|
end subroutine c_base_div_v
|
|
|
|
|
|
|
|
|
|
subroutine c_base_div_a(x, y, info)
|
|
|
|
|
use psi_serial_mod
|
|
|
|
|
implicit none
|
|
|
|
|
complex(psb_spk_), intent(in) :: x(:)
|
|
|
|
|
class(psb_c_base_vect_type), intent(inout) :: y
|
|
|
|
|
integer(psb_ipk_), intent(out) :: info
|
|
|
|
|
integer(psb_ipk_) :: i, n
|
|
|
|
|
|
|
|
|
|
info = 0
|
|
|
|
|
if (y%is_dev()) call y%sync()
|
|
|
|
|
n = min(size(y%v), size(x))
|
|
|
|
|
!$omp parallel do private(i)
|
|
|
|
|
do i=1, n
|
|
|
|
|
y%v(i) = y%v(i)/x(i)
|
|
|
|
|
end do
|
|
|
|
|
call y%set_host()
|
|
|
|
|
|
|
|
|
|
end subroutine c_base_div_a
|
|
|
|
|
!
|
|
|
|
|
!> Function base_div_v2
|
|
|
|
|
!! \memberof psb_c_base_vect_type
|
|
|
|
|
@ -1837,10 +1855,10 @@ contains
|
|
|
|
|
integer(psb_ipk_) :: i, n
|
|
|
|
|
|
|
|
|
|
info = 0
|
|
|
|
|
if (z%is_dev()) call z%sync()
|
|
|
|
|
if (x%is_dev()) call x%sync()
|
|
|
|
|
if (y%is_dev()) call y%sync()
|
|
|
|
|
call z%div(x%v,y%v,info)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
call z%set_host()
|
|
|
|
|
end subroutine c_base_div_v2
|
|
|
|
|
!
|
|
|
|
|
!> Function base_div_v_check
|
|
|
|
|
@ -1860,6 +1878,7 @@ contains
|
|
|
|
|
|
|
|
|
|
info = 0
|
|
|
|
|
if (x%is_dev()) call x%sync()
|
|
|
|
|
if (y%is_dev()) call y%sync()
|
|
|
|
|
call x%div(x%v,y%v,info,flag)
|
|
|
|
|
|
|
|
|
|
end subroutine c_base_div_v_check
|
|
|
|
|
|