|
|
@ -197,12 +197,20 @@ module psb_d_base_vect_mod
|
|
|
|
procedure, pass(z) :: acmp_a2 => d_base_acmp_a2
|
|
|
|
procedure, pass(z) :: acmp_a2 => d_base_acmp_a2
|
|
|
|
procedure, pass(z) :: acmp_v2 => d_base_acmp_v2
|
|
|
|
procedure, pass(z) :: acmp_v2 => d_base_acmp_v2
|
|
|
|
generic, public :: acmp => acmp_a2,acmp_v2
|
|
|
|
generic, public :: acmp => acmp_a2,acmp_v2
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
! Add constant value to all entry of a vector
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
procedure, pass(z) :: addconst_a2 => d_base_addconst_a2
|
|
|
|
|
|
|
|
procedure, pass(z) :: addconst_v2 => d_base_addconst_v2
|
|
|
|
|
|
|
|
generic, public :: addconst => addconst_a2,addconst_v2
|
|
|
|
|
|
|
|
|
|
|
|
procedure, pass(x) :: minreal => d_base_min
|
|
|
|
procedure, pass(x) :: minreal => d_base_min
|
|
|
|
procedure, pass(m) :: mask_v => d_base_mask_v
|
|
|
|
procedure, pass(m) :: mask_v => d_base_mask_v
|
|
|
|
procedure, pass(m) :: mask_a => d_base_mask_a
|
|
|
|
procedure, pass(m) :: mask_a => d_base_mask_a
|
|
|
|
generic, public :: mask => mask_a, mask_v
|
|
|
|
generic, public :: mask => mask_a, mask_v
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
end type psb_d_base_vect_type
|
|
|
|
end type psb_d_base_vect_type
|
|
|
|
|
|
|
|
|
|
|
|
public :: psb_d_base_vect
|
|
|
|
public :: psb_d_base_vect
|
|
|
@ -1881,6 +1889,54 @@ contains
|
|
|
|
end subroutine d_base_mask_v
|
|
|
|
end subroutine d_base_mask_v
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
!> Function _base_addconst_a2
|
|
|
|
|
|
|
|
!! \memberof psb_d_base_vect_type
|
|
|
|
|
|
|
|
!! \brief Add the constant b to every entry of the array x
|
|
|
|
|
|
|
|
!! \param x The input array
|
|
|
|
|
|
|
|
!! \param z The vector containing the x(i) + b
|
|
|
|
|
|
|
|
!! \param b The added term
|
|
|
|
|
|
|
|
!! \param info return code
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
subroutine d_base_addconst_a2(x,b,z,info)
|
|
|
|
|
|
|
|
use psi_serial_mod
|
|
|
|
|
|
|
|
implicit none
|
|
|
|
|
|
|
|
real(psb_dpk_), intent(in) :: b
|
|
|
|
|
|
|
|
real(psb_dpk_), intent(inout) :: x(:)
|
|
|
|
|
|
|
|
class(psb_d_base_vect_type), intent(inout) :: z
|
|
|
|
|
|
|
|
integer(psb_ipk_), intent(out) :: info
|
|
|
|
|
|
|
|
integer(psb_ipk_) :: i, n
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (z%is_dev()) call z%sync()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
n = size(x)
|
|
|
|
|
|
|
|
do i = 1, n, 1
|
|
|
|
|
|
|
|
z%v(i) = x(i) + b
|
|
|
|
|
|
|
|
end do
|
|
|
|
|
|
|
|
info = 0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
end subroutine d_base_addconst_a2
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
!> Function _base_addconst_v2
|
|
|
|
|
|
|
|
!! \memberof psb_d_base_vect_type
|
|
|
|
|
|
|
|
!! \briefAdd the constant b to every entry of the vector x
|
|
|
|
|
|
|
|
!! \param x The input vector
|
|
|
|
|
|
|
|
!! \param z The vector containing the x(i) + b
|
|
|
|
|
|
|
|
!! \param b The added term
|
|
|
|
|
|
|
|
!! \param info return code
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
subroutine d_base_addconst_v2(x,b,z,info)
|
|
|
|
|
|
|
|
use psi_serial_mod
|
|
|
|
|
|
|
|
implicit none
|
|
|
|
|
|
|
|
class(psb_d_base_vect_type), intent(inout) :: x
|
|
|
|
|
|
|
|
real(psb_dpk_), intent(in) :: b
|
|
|
|
|
|
|
|
class(psb_d_base_vect_type), intent(inout) :: z
|
|
|
|
|
|
|
|
integer(psb_ipk_), intent(out) :: info
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
info = 0
|
|
|
|
|
|
|
|
if (x%is_dev()) call x%sync()
|
|
|
|
|
|
|
|
call z%addconst(x%v,b,info)
|
|
|
|
|
|
|
|
end subroutine d_base_addconst_v2
|
|
|
|
end module psb_d_base_vect_mod
|
|
|
|
end module psb_d_base_vect_mod
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|