|
|
|
@ -127,6 +127,9 @@ module psb_c_base_mat_mod
|
|
|
|
|
procedure, pass(a) :: aclsum => psb_c_base_aclsum
|
|
|
|
|
procedure, pass(a) :: scalpid => psb_c_base_scalplusidentity
|
|
|
|
|
procedure, pass(a) :: spaxpby => psb_c_base_spaxpby
|
|
|
|
|
procedure, pass(a) :: cmpval => psb_c_base_cmpval
|
|
|
|
|
procedure, pass(a) :: cmpmat => psb_c_base_cmpmat
|
|
|
|
|
generic, public :: spcmp => cmpval, cmpmat
|
|
|
|
|
end type psb_c_base_sparse_mat
|
|
|
|
|
|
|
|
|
|
private :: c_base_mat_sync, c_base_mat_is_host, c_base_mat_is_dev, &
|
|
|
|
@ -230,6 +233,8 @@ module psb_c_base_mat_mod
|
|
|
|
|
procedure, pass(a) :: aclsum => psb_c_coo_aclsum
|
|
|
|
|
procedure, pass(a) :: scalpid => psb_c_coo_scalplusidentity
|
|
|
|
|
procedure, pass(a) :: spaxpby => psb_c_coo_spaxpby
|
|
|
|
|
procedure, pass(a) :: cmpval => psb_c_coo_cmpval
|
|
|
|
|
procedure, pass(a) :: cmpmat => psb_c_coo_cmpmat
|
|
|
|
|
end type psb_c_coo_sparse_mat
|
|
|
|
|
|
|
|
|
|
private :: c_coo_get_nzeros, c_coo_set_nzeros, &
|
|
|
|
@ -295,6 +300,9 @@ module psb_c_base_mat_mod
|
|
|
|
|
procedure, pass(a) :: aclsum => psb_lc_base_aclsum
|
|
|
|
|
procedure, pass(a) :: scalpid => psb_lc_base_scalplusidentity
|
|
|
|
|
procedure, pass(a) :: spaxpby => psb_lc_base_spaxpby
|
|
|
|
|
procedure, pass(a) :: cmpval => psb_lc_base_cmpval
|
|
|
|
|
procedure, pass(a) :: cmpmat => psb_lc_base_cmpmat
|
|
|
|
|
generic, public :: spcmp => cmpval, cmpmat
|
|
|
|
|
!
|
|
|
|
|
! Convert internal indices
|
|
|
|
|
!
|
|
|
|
@ -397,6 +405,8 @@ module psb_c_base_mat_mod
|
|
|
|
|
procedure, pass(a) :: aclsum => psb_lc_coo_aclsum
|
|
|
|
|
procedure, pass(a) :: scalpid => psb_lc_coo_scalplusidentity
|
|
|
|
|
procedure, pass(a) :: spaxpby => psb_lc_coo_spaxpby
|
|
|
|
|
procedure, pass(a) :: cmpval => psb_lc_coo_cmpval
|
|
|
|
|
procedure, pass(a) :: cmpmat => psb_lc_coo_cmpmat
|
|
|
|
|
!
|
|
|
|
|
! This is COO specific
|
|
|
|
|
!
|
|
|
|
@ -1499,6 +1509,52 @@ module psb_c_base_mat_mod
|
|
|
|
|
end subroutine psb_c_base_spaxpby
|
|
|
|
|
end interface
|
|
|
|
|
|
|
|
|
|
!
|
|
|
|
|
!> Function base_cmpval:
|
|
|
|
|
!! \memberof psb_c_base_sparse_mat
|
|
|
|
|
!! \brief Compare the element of A with the value val |A(i,j) -val| < tol
|
|
|
|
|
!!
|
|
|
|
|
!! \param alpha scaling for A
|
|
|
|
|
!! \param A sparse matrix A (intent inout)
|
|
|
|
|
!! \param val comparing element for the entries of A
|
|
|
|
|
!! \param tol tolerance to which the comparison is done
|
|
|
|
|
!! \param res return logical
|
|
|
|
|
!! \param info return code
|
|
|
|
|
!
|
|
|
|
|
interface
|
|
|
|
|
function psb_c_base_cmpval(a,val,tol,info) result(res)
|
|
|
|
|
import
|
|
|
|
|
class(psb_c_base_sparse_mat), intent(inout) :: a
|
|
|
|
|
complex(psb_spk_), intent(in) :: val
|
|
|
|
|
real(psb_spk_), intent(in) :: tol
|
|
|
|
|
logical :: res
|
|
|
|
|
integer(psb_ipk_), intent(out) :: info
|
|
|
|
|
end function psb_c_base_cmpval
|
|
|
|
|
end interface
|
|
|
|
|
|
|
|
|
|
!
|
|
|
|
|
!> Function base_cmpmat:
|
|
|
|
|
!! \memberof psb_c_base_sparse_mat
|
|
|
|
|
!! \brief Compare the element of A with the ones of B |A(i,j) - B(i,j)| < tol
|
|
|
|
|
!!
|
|
|
|
|
!! \param alpha scaling for A
|
|
|
|
|
!! \param A sparse matrix A (intent inout)
|
|
|
|
|
!! \param A sparse matrix B (intent inout)
|
|
|
|
|
!! \param tol tolerance to which the comparison is done
|
|
|
|
|
!! \param res return logical
|
|
|
|
|
!! \param info return code
|
|
|
|
|
!
|
|
|
|
|
interface
|
|
|
|
|
function psb_c_base_cmpmat(a,b,tol,info) result(res)
|
|
|
|
|
import
|
|
|
|
|
class(psb_c_base_sparse_mat), intent(inout) :: a
|
|
|
|
|
class(psb_c_base_sparse_mat), intent(inout) :: b
|
|
|
|
|
real(psb_spk_), intent(in) :: tol
|
|
|
|
|
logical :: res
|
|
|
|
|
integer(psb_ipk_), intent(out) :: info
|
|
|
|
|
end function psb_c_base_cmpmat
|
|
|
|
|
end interface
|
|
|
|
|
|
|
|
|
|
!
|
|
|
|
|
!> Function base_maxval:
|
|
|
|
|
!! \memberof psb_c_base_sparse_mat
|
|
|
|
@ -2169,6 +2225,34 @@ module psb_c_base_mat_mod
|
|
|
|
|
end subroutine psb_c_coo_spaxpby
|
|
|
|
|
end interface
|
|
|
|
|
|
|
|
|
|
!
|
|
|
|
|
!! \memberof psb_c_coo_sparse_mat
|
|
|
|
|
!! \see psb_c_base_mat_mod::psb_c_base_cmpval
|
|
|
|
|
interface
|
|
|
|
|
function psb_c_coo_cmpval(a,val,tol,info) result(res)
|
|
|
|
|
import
|
|
|
|
|
class(psb_c_coo_sparse_mat), intent(inout) :: a
|
|
|
|
|
complex(psb_spk_), intent(in) :: val
|
|
|
|
|
real(psb_spk_), intent(in) :: tol
|
|
|
|
|
logical :: res
|
|
|
|
|
integer(psb_ipk_), intent(out) :: info
|
|
|
|
|
end function psb_c_coo_cmpval
|
|
|
|
|
end interface
|
|
|
|
|
|
|
|
|
|
!
|
|
|
|
|
!! \memberof psb_c_coo_sparse_mat
|
|
|
|
|
!! \see psb_c_base_mat_mod::psb_c_base_cmpmat
|
|
|
|
|
interface
|
|
|
|
|
function psb_c_coo_cmpmat(a,b,tol,info) result(res)
|
|
|
|
|
import
|
|
|
|
|
class(psb_c_coo_sparse_mat), intent(inout) :: a
|
|
|
|
|
class(psb_c_base_sparse_mat), intent(inout) :: b
|
|
|
|
|
real(psb_spk_), intent(in) :: tol
|
|
|
|
|
logical :: res
|
|
|
|
|
integer(psb_ipk_), intent(out) :: info
|
|
|
|
|
end function psb_c_coo_cmpmat
|
|
|
|
|
end interface
|
|
|
|
|
|
|
|
|
|
! == =================
|
|
|
|
|
!
|
|
|
|
|
! BASE interfaces
|
|
|
|
@ -2966,6 +3050,52 @@ module psb_c_base_mat_mod
|
|
|
|
|
end subroutine psb_lc_base_scal
|
|
|
|
|
end interface
|
|
|
|
|
|
|
|
|
|
!
|
|
|
|
|
!> Function base_cmpval:
|
|
|
|
|
!! \memberof psb_lc_base_sparse_mat
|
|
|
|
|
!! \brief Compare the element of A with the value val |A(i,j) -val| < tol
|
|
|
|
|
!!
|
|
|
|
|
!! \param alpha scaling for A
|
|
|
|
|
!! \param A sparse matrix A (intent inout)
|
|
|
|
|
!! \param val comparing element for the entries of A
|
|
|
|
|
!! \param tol tolerance to which the comparison is done
|
|
|
|
|
!! \param res return logical
|
|
|
|
|
!! \param info return code
|
|
|
|
|
!
|
|
|
|
|
interface
|
|
|
|
|
function psb_lc_base_cmpval(a,val,tol,info) result(res)
|
|
|
|
|
import
|
|
|
|
|
class(psb_lc_base_sparse_mat), intent(inout) :: a
|
|
|
|
|
complex(psb_spk_), intent(in) :: val
|
|
|
|
|
real(psb_spk_), intent(in) :: tol
|
|
|
|
|
logical :: res
|
|
|
|
|
integer(psb_ipk_), intent(out) :: info
|
|
|
|
|
end function psb_lc_base_cmpval
|
|
|
|
|
end interface
|
|
|
|
|
|
|
|
|
|
!
|
|
|
|
|
!> Function base_cmpmat:
|
|
|
|
|
!! \memberof psb_lc_base_sparse_mat
|
|
|
|
|
!! \brief Compare the element of A with the ones of B |A(i,j) - B(i,j)| < tol
|
|
|
|
|
!!
|
|
|
|
|
!! \param alpha scaling for A
|
|
|
|
|
!! \param A sparse matrix A (intent inout)
|
|
|
|
|
!! \param A sparse matrix B (intent inout)
|
|
|
|
|
!! \param tol tolerance to which the comparison is done
|
|
|
|
|
!! \param res return logical
|
|
|
|
|
!! \param info return code
|
|
|
|
|
!
|
|
|
|
|
interface
|
|
|
|
|
function psb_lc_base_cmpmat(a,b,tol,info) result(res)
|
|
|
|
|
import
|
|
|
|
|
class(psb_lc_base_sparse_mat), intent(inout) :: a
|
|
|
|
|
class(psb_lc_base_sparse_mat), intent(inout) :: b
|
|
|
|
|
real(psb_spk_), intent(in) :: tol
|
|
|
|
|
logical :: res
|
|
|
|
|
integer(psb_ipk_), intent(out) :: info
|
|
|
|
|
end function psb_lc_base_cmpmat
|
|
|
|
|
end interface
|
|
|
|
|
|
|
|
|
|
!
|
|
|
|
|
!> Function base_maxval:
|
|
|
|
|
!! \memberof psb_lc_base_sparse_mat
|
|
|
|
@ -3569,6 +3699,34 @@ module psb_c_base_mat_mod
|
|
|
|
|
end subroutine psb_lc_coo_spaxpby
|
|
|
|
|
end interface
|
|
|
|
|
|
|
|
|
|
!
|
|
|
|
|
!! \memberof psb_lc_coo_sparse_mat
|
|
|
|
|
!! \see psb_lc_base_mat_mod::psb_lc_base_cmpval
|
|
|
|
|
interface
|
|
|
|
|
function psb_lc_coo_cmpval(a,val,tol,info) result(res)
|
|
|
|
|
import
|
|
|
|
|
class(psb_lc_coo_sparse_mat), intent(inout) :: a
|
|
|
|
|
complex(psb_spk_), intent(in) :: val
|
|
|
|
|
real(psb_spk_), intent(in) :: tol
|
|
|
|
|
logical :: res
|
|
|
|
|
integer(psb_ipk_), intent(out) :: info
|
|
|
|
|
end function psb_lc_coo_cmpval
|
|
|
|
|
end interface
|
|
|
|
|
|
|
|
|
|
!
|
|
|
|
|
!! \memberof psb_lc_coo_sparse_mat
|
|
|
|
|
!! \see psb_lc_base_mat_mod::psb_lc_base_cmpmat
|
|
|
|
|
interface
|
|
|
|
|
function psb_lc_coo_cmpmat(a,b,tol,info) result(res)
|
|
|
|
|
import
|
|
|
|
|
class(psb_lc_coo_sparse_mat), intent(inout) :: a
|
|
|
|
|
class(psb_lc_base_sparse_mat), intent(inout) :: b
|
|
|
|
|
real(psb_spk_), intent(in) :: tol
|
|
|
|
|
logical :: res
|
|
|
|
|
integer(psb_ipk_), intent(out) :: info
|
|
|
|
|
end function psb_lc_coo_cmpmat
|
|
|
|
|
end interface
|
|
|
|
|
|
|
|
|
|
contains
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|