|
|
|
@ -34,7 +34,6 @@
|
|
|
|
module psb_c_base_mat_mod
|
|
|
|
module psb_c_base_mat_mod
|
|
|
|
|
|
|
|
|
|
|
|
use psb_base_mat_mod
|
|
|
|
use psb_base_mat_mod
|
|
|
|
use psb_lbase_mat_mod
|
|
|
|
|
|
|
|
use psb_c_base_vect_mod
|
|
|
|
use psb_c_base_vect_mod
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -80,6 +79,18 @@ module psb_c_base_mat_mod
|
|
|
|
procedure, pass(a) :: clone => psb_c_base_clone
|
|
|
|
procedure, pass(a) :: clone => psb_c_base_clone
|
|
|
|
procedure, pass(a) :: make_nonunit => psb_c_base_make_nonunit
|
|
|
|
procedure, pass(a) :: make_nonunit => psb_c_base_make_nonunit
|
|
|
|
procedure, pass(a) :: clean_zeros => psb_c_base_clean_zeros
|
|
|
|
procedure, pass(a) :: clean_zeros => psb_c_base_clean_zeros
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
! Convert internal indices
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
procedure, pass(a) :: cp_to_lcoo => psb_c_base_cp_to_lcoo
|
|
|
|
|
|
|
|
procedure, pass(a) :: cp_from_lcoo => psb_c_base_cp_from_lcoo
|
|
|
|
|
|
|
|
procedure, pass(a) :: cp_to_lfmt => psb_c_base_cp_to_lfmt
|
|
|
|
|
|
|
|
procedure, pass(a) :: cp_from_lfmt => psb_c_base_cp_from_lfmt
|
|
|
|
|
|
|
|
procedure, pass(a) :: mv_to_lcoo => psb_c_base_mv_to_lcoo
|
|
|
|
|
|
|
|
procedure, pass(a) :: mv_from_lcoo => psb_c_base_mv_from_lcoo
|
|
|
|
|
|
|
|
procedure, pass(a) :: mv_to_lfmt => psb_c_base_mv_to_lfmt
|
|
|
|
|
|
|
|
procedure, pass(a) :: mv_from_lfmt => psb_c_base_mv_from_lfmt
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
!
|
|
|
|
!
|
|
|
|
! Transpose methods: defined here but not implemented.
|
|
|
|
! Transpose methods: defined here but not implemented.
|
|
|
|
@ -159,6 +170,13 @@ module psb_c_base_mat_mod
|
|
|
|
procedure, pass(a) :: mv_from_coo => psb_c_mv_coo_from_coo
|
|
|
|
procedure, pass(a) :: mv_from_coo => psb_c_mv_coo_from_coo
|
|
|
|
procedure, pass(a) :: mv_to_fmt => psb_c_mv_coo_to_fmt
|
|
|
|
procedure, pass(a) :: mv_to_fmt => psb_c_mv_coo_to_fmt
|
|
|
|
procedure, pass(a) :: mv_from_fmt => psb_c_mv_coo_from_fmt
|
|
|
|
procedure, pass(a) :: mv_from_fmt => psb_c_mv_coo_from_fmt
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
! Convert internal indices
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
procedure, pass(a) :: cp_to_lcoo => psb_c_cp_coo_to_lcoo
|
|
|
|
|
|
|
|
procedure, pass(a) :: cp_from_lcoo => psb_c_cp_coo_from_lcoo
|
|
|
|
|
|
|
|
|
|
|
|
procedure, pass(a) :: csput_a => psb_c_coo_csput_a
|
|
|
|
procedure, pass(a) :: csput_a => psb_c_coo_csput_a
|
|
|
|
procedure, pass(a) :: get_diag => psb_c_coo_get_diag
|
|
|
|
procedure, pass(a) :: get_diag => psb_c_coo_get_diag
|
|
|
|
procedure, pass(a) :: csgetrow => psb_c_coo_csgetrow
|
|
|
|
procedure, pass(a) :: csgetrow => psb_c_coo_csgetrow
|
|
|
|
@ -216,6 +234,197 @@ module psb_c_base_mat_mod
|
|
|
|
& c_coo_transp_1mat, c_coo_transc_1mat
|
|
|
|
& c_coo_transp_1mat, c_coo_transc_1mat
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
!> \namespace psb_base_mod \class psb_lc_base_sparse_mat
|
|
|
|
|
|
|
|
!! \extends psb_lbase_mat_mod::psb_lbase_sparse_mat
|
|
|
|
|
|
|
|
!! The psb_lc_base_sparse_mat type, extending psb_base_sparse_mat,
|
|
|
|
|
|
|
|
!! defines a middle level complex(psb_spk_) sparse matrix object.
|
|
|
|
|
|
|
|
!! This class object itself does not have any additional members
|
|
|
|
|
|
|
|
!! with respect to those of the base class. Most methods cannot be fully
|
|
|
|
|
|
|
|
!! implemented at this level, but we can define the interface for the
|
|
|
|
|
|
|
|
!! computational methods requiring the knowledge of the underlying
|
|
|
|
|
|
|
|
!! field, such as the matrix-vector product; this interface is defined,
|
|
|
|
|
|
|
|
!! but is supposed to be overridden at the leaf level.
|
|
|
|
|
|
|
|
!!
|
|
|
|
|
|
|
|
!! About the method MOLD: this has been defined for those compilers
|
|
|
|
|
|
|
|
!! not yet supporting ALLOCATE( ...,MOLD=...); it's otherwise silly to
|
|
|
|
|
|
|
|
!! duplicate "by hand" what is specified in the language (in this case F2008)
|
|
|
|
|
|
|
|
!!
|
|
|
|
|
|
|
|
type, extends(psb_lbase_sparse_mat) :: psb_lc_base_sparse_mat
|
|
|
|
|
|
|
|
contains
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
! Data management methods: defined here, but (mostly) not implemented.
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
procedure, pass(a) :: csput_a => psb_lc_base_csput_a
|
|
|
|
|
|
|
|
procedure, pass(a) :: csput_v => psb_lc_base_csput_v
|
|
|
|
|
|
|
|
generic, public :: csput => csput_a, csput_v
|
|
|
|
|
|
|
|
procedure, pass(a) :: csgetrow => psb_lc_base_csgetrow
|
|
|
|
|
|
|
|
procedure, pass(a) :: csgetblk => psb_lc_base_csgetblk
|
|
|
|
|
|
|
|
procedure, pass(a) :: get_diag => psb_lc_base_get_diag
|
|
|
|
|
|
|
|
generic, public :: csget => csgetrow, csgetblk
|
|
|
|
|
|
|
|
procedure, pass(a) :: tril => psb_lc_base_tril
|
|
|
|
|
|
|
|
procedure, pass(a) :: triu => psb_lc_base_triu
|
|
|
|
|
|
|
|
procedure, pass(a) :: csclip => psb_lc_base_csclip
|
|
|
|
|
|
|
|
procedure, pass(a) :: cp_to_coo => psb_lc_base_cp_to_coo
|
|
|
|
|
|
|
|
procedure, pass(a) :: cp_from_coo => psb_lc_base_cp_from_coo
|
|
|
|
|
|
|
|
procedure, pass(a) :: cp_to_fmt => psb_lc_base_cp_to_fmt
|
|
|
|
|
|
|
|
procedure, pass(a) :: cp_from_fmt => psb_lc_base_cp_from_fmt
|
|
|
|
|
|
|
|
procedure, pass(a) :: mv_to_coo => psb_lc_base_mv_to_coo
|
|
|
|
|
|
|
|
procedure, pass(a) :: mv_from_coo => psb_lc_base_mv_from_coo
|
|
|
|
|
|
|
|
procedure, pass(a) :: mv_to_fmt => psb_lc_base_mv_to_fmt
|
|
|
|
|
|
|
|
procedure, pass(a) :: mv_from_fmt => psb_lc_base_mv_from_fmt
|
|
|
|
|
|
|
|
procedure, pass(a) :: mold => psb_lc_base_mold
|
|
|
|
|
|
|
|
procedure, pass(a) :: clone => psb_lc_base_clone
|
|
|
|
|
|
|
|
procedure, pass(a) :: make_nonunit => psb_lc_base_make_nonunit
|
|
|
|
|
|
|
|
procedure, pass(a) :: clean_zeros => psb_lc_base_clean_zeros
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
! Convert internal indices
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
procedure, pass(a) :: cp_to_icoo => psb_lc_base_cp_to_icoo
|
|
|
|
|
|
|
|
procedure, pass(a) :: cp_from_icoo => psb_lc_base_cp_from_icoo
|
|
|
|
|
|
|
|
procedure, pass(a) :: cp_to_ifmt => psb_lc_base_cp_to_ifmt
|
|
|
|
|
|
|
|
procedure, pass(a) :: cp_from_ifmt => psb_lc_base_cp_from_ifmt
|
|
|
|
|
|
|
|
procedure, pass(a) :: mv_to_icoo => psb_lc_base_mv_to_icoo
|
|
|
|
|
|
|
|
procedure, pass(a) :: mv_from_icoo => psb_lc_base_mv_from_icoo
|
|
|
|
|
|
|
|
procedure, pass(a) :: mv_to_ifmt => psb_lc_base_mv_to_ifmt
|
|
|
|
|
|
|
|
procedure, pass(a) :: mv_from_ifmt => psb_lc_base_mv_from_ifmt
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
! Transpose methods: defined here but not implemented.
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
procedure, pass(a) :: transp_1mat => psb_lc_base_transp_1mat
|
|
|
|
|
|
|
|
procedure, pass(a) :: transp_2mat => psb_lc_base_transp_2mat
|
|
|
|
|
|
|
|
procedure, pass(a) :: transc_1mat => psb_lc_base_transc_1mat
|
|
|
|
|
|
|
|
procedure, pass(a) :: transc_2mat => psb_lc_base_transc_2mat
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
! Computational methods: defined here but not implemented.
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
procedure, pass(a) :: vect_mv => psb_lc_base_vect_mv
|
|
|
|
|
|
|
|
procedure, pass(a) :: csmv => psb_lc_base_csmv
|
|
|
|
|
|
|
|
procedure, pass(a) :: csmm => psb_lc_base_csmm
|
|
|
|
|
|
|
|
generic, public :: spmm => csmm, csmv, vect_mv
|
|
|
|
|
|
|
|
procedure, pass(a) :: in_vect_sv => psb_lc_base_inner_vect_sv
|
|
|
|
|
|
|
|
procedure, pass(a) :: inner_cssv => psb_lc_base_inner_cssv
|
|
|
|
|
|
|
|
procedure, pass(a) :: inner_cssm => psb_lc_base_inner_cssm
|
|
|
|
|
|
|
|
generic, public :: inner_spsm => inner_cssm, inner_cssv, in_vect_sv
|
|
|
|
|
|
|
|
procedure, pass(a) :: vect_cssv => psb_lc_base_vect_cssv
|
|
|
|
|
|
|
|
procedure, pass(a) :: cssv => psb_lc_base_cssv
|
|
|
|
|
|
|
|
procedure, pass(a) :: cssm => psb_lc_base_cssm
|
|
|
|
|
|
|
|
generic, public :: spsm => cssm, cssv, vect_cssv
|
|
|
|
|
|
|
|
procedure, pass(a) :: scals => psb_lc_base_scals
|
|
|
|
|
|
|
|
procedure, pass(a) :: scalv => psb_lc_base_scal
|
|
|
|
|
|
|
|
generic, public :: scal => scals, scalv
|
|
|
|
|
|
|
|
procedure, pass(a) :: maxval => psb_lc_base_maxval
|
|
|
|
|
|
|
|
procedure, pass(a) :: spnmi => psb_lc_base_csnmi
|
|
|
|
|
|
|
|
procedure, pass(a) :: spnm1 => psb_lc_base_csnm1
|
|
|
|
|
|
|
|
procedure, pass(a) :: rowsum => psb_lc_base_rowsum
|
|
|
|
|
|
|
|
procedure, pass(a) :: arwsum => psb_lc_base_arwsum
|
|
|
|
|
|
|
|
procedure, pass(a) :: colsum => psb_lc_base_colsum
|
|
|
|
|
|
|
|
procedure, pass(a) :: aclsum => psb_lc_base_aclsum
|
|
|
|
|
|
|
|
end type psb_lc_base_sparse_mat
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private :: lc_base_mat_sync, lc_base_mat_is_host, lc_base_mat_is_dev, &
|
|
|
|
|
|
|
|
& lc_base_mat_is_sync, lc_base_mat_set_host, lc_base_mat_set_dev,&
|
|
|
|
|
|
|
|
& lc_base_mat_set_sync
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
!> \namespace psb_base_mod \class psb_lc_coo_sparse_mat
|
|
|
|
|
|
|
|
!! \extends psb_lc_base_mat_mod::psb_lc_base_sparse_mat
|
|
|
|
|
|
|
|
!!
|
|
|
|
|
|
|
|
!! psb_lc_coo_sparse_mat type and the related methods. This is the
|
|
|
|
|
|
|
|
!! reference type for all the format transitions, copies and mv unless
|
|
|
|
|
|
|
|
!! methods are implemented that allow the direct transition from one
|
|
|
|
|
|
|
|
!! format to another. It is defined here since all other classes must
|
|
|
|
|
|
|
|
!! refer to it per the MEDIATOR design pattern.
|
|
|
|
|
|
|
|
!!
|
|
|
|
|
|
|
|
type, extends(psb_lc_base_sparse_mat) :: psb_lc_coo_sparse_mat
|
|
|
|
|
|
|
|
!> Number of nonzeros.
|
|
|
|
|
|
|
|
integer(psb_lpk_) :: nnz
|
|
|
|
|
|
|
|
!> Row indices.
|
|
|
|
|
|
|
|
integer(psb_lpk_), allocatable :: ia(:)
|
|
|
|
|
|
|
|
!> Column indices.
|
|
|
|
|
|
|
|
integer(psb_lpk_), allocatable :: ja(:)
|
|
|
|
|
|
|
|
!> Coefficient values.
|
|
|
|
|
|
|
|
complex(psb_spk_), allocatable :: val(:)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
integer, private :: sort_status=psb_unsorted_
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
contains
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
! Data management methods.
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
procedure, pass(a) :: get_size => lc_coo_get_size
|
|
|
|
|
|
|
|
procedure, pass(a) :: get_nzeros => lc_coo_get_nzeros
|
|
|
|
|
|
|
|
procedure, nopass :: get_fmt => lc_coo_get_fmt
|
|
|
|
|
|
|
|
procedure, pass(a) :: sizeof => lc_coo_sizeof
|
|
|
|
|
|
|
|
procedure, pass(a) :: reallocate_nz => psb_lc_coo_reallocate_nz
|
|
|
|
|
|
|
|
procedure, pass(a) :: allocate_mnnz => psb_lc_coo_allocate_mnnz
|
|
|
|
|
|
|
|
procedure, pass(a) :: cp_to_coo => psb_lc_cp_coo_to_coo
|
|
|
|
|
|
|
|
procedure, pass(a) :: cp_from_coo => psb_lc_cp_coo_from_coo
|
|
|
|
|
|
|
|
procedure, pass(a) :: cp_to_fmt => psb_lc_cp_coo_to_fmt
|
|
|
|
|
|
|
|
procedure, pass(a) :: cp_from_fmt => psb_lc_cp_coo_from_fmt
|
|
|
|
|
|
|
|
procedure, pass(a) :: mv_to_coo => psb_lc_mv_coo_to_coo
|
|
|
|
|
|
|
|
procedure, pass(a) :: mv_from_coo => psb_lc_mv_coo_from_coo
|
|
|
|
|
|
|
|
procedure, pass(a) :: mv_to_fmt => psb_lc_mv_coo_to_fmt
|
|
|
|
|
|
|
|
procedure, pass(a) :: mv_from_fmt => psb_lc_mv_coo_from_fmt
|
|
|
|
|
|
|
|
procedure, pass(a) :: cp_to_icoo => psb_lc_cp_coo_to_icoo
|
|
|
|
|
|
|
|
procedure, pass(a) :: cp_from_icoo => psb_lc_cp_coo_from_icoo
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
procedure, pass(a) :: csput_a => psb_lc_coo_csput_a
|
|
|
|
|
|
|
|
procedure, pass(a) :: get_diag => psb_lc_coo_get_diag
|
|
|
|
|
|
|
|
procedure, pass(a) :: csgetrow => psb_lc_coo_csgetrow
|
|
|
|
|
|
|
|
procedure, pass(a) :: csgetptn => psb_lc_coo_csgetptn
|
|
|
|
|
|
|
|
procedure, pass(a) :: reinit => psb_lc_coo_reinit
|
|
|
|
|
|
|
|
procedure, pass(a) :: get_nz_row => psb_lc_coo_get_nz_row
|
|
|
|
|
|
|
|
procedure, pass(a) :: fix => psb_lc_fix_coo
|
|
|
|
|
|
|
|
procedure, pass(a) :: trim => psb_lc_coo_trim
|
|
|
|
|
|
|
|
procedure, pass(a) :: clean_zeros => psb_lc_coo_clean_zeros
|
|
|
|
|
|
|
|
procedure, pass(a) :: print => psb_lc_coo_print
|
|
|
|
|
|
|
|
procedure, pass(a) :: free => lc_coo_free
|
|
|
|
|
|
|
|
procedure, pass(a) :: mold => psb_lc_coo_mold
|
|
|
|
|
|
|
|
procedure, pass(a) :: is_sorted => lc_coo_is_sorted
|
|
|
|
|
|
|
|
procedure, pass(a) :: is_by_rows => lc_coo_is_by_rows
|
|
|
|
|
|
|
|
procedure, pass(a) :: is_by_cols => lc_coo_is_by_cols
|
|
|
|
|
|
|
|
procedure, pass(a) :: set_by_rows => lc_coo_set_by_rows
|
|
|
|
|
|
|
|
procedure, pass(a) :: set_by_cols => lc_coo_set_by_cols
|
|
|
|
|
|
|
|
procedure, pass(a) :: set_sort_status => lc_coo_set_sort_status
|
|
|
|
|
|
|
|
procedure, pass(a) :: get_sort_status => lc_coo_get_sort_status
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
! This is COO specific
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
procedure, pass(a) :: set_nzeros => lc_coo_set_nzeros
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
! Transpose methods. These are the base of all
|
|
|
|
|
|
|
|
! indirection in transpose, together with conversions
|
|
|
|
|
|
|
|
! they are sufficient for all cases.
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
procedure, pass(a) :: transp_1mat => lc_coo_transp_1mat
|
|
|
|
|
|
|
|
procedure, pass(a) :: transc_1mat => lc_coo_transc_1mat
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
! Computational methods.
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
procedure, pass(a) :: csmm => psb_lc_coo_csmm
|
|
|
|
|
|
|
|
procedure, pass(a) :: csmv => psb_lc_coo_csmv
|
|
|
|
|
|
|
|
procedure, pass(a) :: inner_cssm => psb_lc_coo_cssm
|
|
|
|
|
|
|
|
procedure, pass(a) :: inner_cssv => psb_lc_coo_cssv
|
|
|
|
|
|
|
|
procedure, pass(a) :: scals => psb_lc_coo_scals
|
|
|
|
|
|
|
|
procedure, pass(a) :: scalv => psb_lc_coo_scal
|
|
|
|
|
|
|
|
procedure, pass(a) :: maxval => psb_lc_coo_maxval
|
|
|
|
|
|
|
|
procedure, pass(a) :: spnmi => psb_lc_coo_csnmi
|
|
|
|
|
|
|
|
procedure, pass(a) :: spnm1 => psb_lc_coo_csnm1
|
|
|
|
|
|
|
|
procedure, pass(a) :: rowsum => psb_lc_coo_rowsum
|
|
|
|
|
|
|
|
procedure, pass(a) :: arwsum => psb_lc_coo_arwsum
|
|
|
|
|
|
|
|
procedure, pass(a) :: colsum => psb_lc_coo_colsum
|
|
|
|
|
|
|
|
procedure, pass(a) :: aclsum => psb_lc_coo_aclsum
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
end type psb_lc_coo_sparse_mat
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private :: lc_coo_get_nzeros, lc_coo_set_nzeros, &
|
|
|
|
|
|
|
|
& lc_coo_get_fmt, lc_coo_free, lc_coo_sizeof, &
|
|
|
|
|
|
|
|
& lc_coo_transp_1mat, lc_coo_transc_1mat
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
! == =================
|
|
|
|
! == =================
|
|
|
|
!
|
|
|
|
!
|
|
|
|
@ -683,12 +892,151 @@ module psb_c_base_mat_mod
|
|
|
|
!! \param info return code
|
|
|
|
!! \param info return code
|
|
|
|
!
|
|
|
|
!
|
|
|
|
interface
|
|
|
|
interface
|
|
|
|
subroutine psb_c_base_mv_to_fmt(a,b,info)
|
|
|
|
subroutine psb_c_base_mv_to_fmt(a,b,info)
|
|
|
|
|
|
|
|
import
|
|
|
|
|
|
|
|
class(psb_c_base_sparse_mat), intent(inout) :: a
|
|
|
|
|
|
|
|
class(psb_c_base_sparse_mat), intent(inout) :: b
|
|
|
|
|
|
|
|
integer(psb_ipk_), intent(out) :: info
|
|
|
|
|
|
|
|
end subroutine psb_c_base_mv_to_fmt
|
|
|
|
|
|
|
|
end interface
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
!> Function mv_from_fmt:
|
|
|
|
|
|
|
|
!! \memberof psb_c_base_sparse_mat
|
|
|
|
|
|
|
|
!! \brief Convert from a class(psb_c_base_sparse_mat), freeing the source.
|
|
|
|
|
|
|
|
!! Invoked from the target object. Can be implemented by
|
|
|
|
|
|
|
|
!! simply invoking b%mv_to_coo(tmp) and then a%mv_from_coo(tmp).
|
|
|
|
|
|
|
|
!! \param b The output variable
|
|
|
|
|
|
|
|
!! \param info return code
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
interface
|
|
|
|
|
|
|
|
subroutine psb_c_base_mv_from_fmt(a,b,info)
|
|
|
|
|
|
|
|
import
|
|
|
|
|
|
|
|
class(psb_c_base_sparse_mat), intent(inout) :: a
|
|
|
|
|
|
|
|
class(psb_c_base_sparse_mat), intent(inout) :: b
|
|
|
|
|
|
|
|
integer(psb_ipk_), intent(out) :: info
|
|
|
|
|
|
|
|
end subroutine psb_c_base_mv_from_fmt
|
|
|
|
|
|
|
|
end interface
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
!> Function cp_to_coo:
|
|
|
|
|
|
|
|
!! \memberof psb_c_base_sparse_mat
|
|
|
|
|
|
|
|
!! \brief Copy and convert to psb_c_coo_sparse_mat
|
|
|
|
|
|
|
|
!! Invoked from the source object.
|
|
|
|
|
|
|
|
!! \param b The output variable
|
|
|
|
|
|
|
|
!! \param info return code
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
interface
|
|
|
|
|
|
|
|
subroutine psb_c_base_cp_to_lcoo(a,b,info)
|
|
|
|
|
|
|
|
import
|
|
|
|
|
|
|
|
class(psb_c_base_sparse_mat), intent(in) :: a
|
|
|
|
|
|
|
|
class(psb_lc_coo_sparse_mat), intent(inout) :: b
|
|
|
|
|
|
|
|
integer(psb_ipk_), intent(out) :: info
|
|
|
|
|
|
|
|
end subroutine psb_c_base_cp_to_lcoo
|
|
|
|
|
|
|
|
end interface
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
!> Function cp_from_coo:
|
|
|
|
|
|
|
|
!! \memberof psb_c_base_sparse_mat
|
|
|
|
|
|
|
|
!! \brief Copy and convert from psb_c_coo_sparse_mat
|
|
|
|
|
|
|
|
!! Invoked from the target object.
|
|
|
|
|
|
|
|
!! \param b The input variable
|
|
|
|
|
|
|
|
!! \param info return code
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
interface
|
|
|
|
|
|
|
|
subroutine psb_c_base_cp_from_lcoo(a,b,info)
|
|
|
|
|
|
|
|
import
|
|
|
|
|
|
|
|
class(psb_c_base_sparse_mat), intent(inout) :: a
|
|
|
|
|
|
|
|
class(psb_lc_coo_sparse_mat), intent(in) :: b
|
|
|
|
|
|
|
|
integer(psb_ipk_), intent(out) :: info
|
|
|
|
|
|
|
|
end subroutine psb_c_base_cp_from_lcoo
|
|
|
|
|
|
|
|
end interface
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
!> Function cp_to_fmt:
|
|
|
|
|
|
|
|
!! \memberof psb_c_base_sparse_mat
|
|
|
|
|
|
|
|
!! \brief Copy and convert to a class(psb_c_base_sparse_mat)
|
|
|
|
|
|
|
|
!! Invoked from the source object. Can be implemented by
|
|
|
|
|
|
|
|
!! simply invoking a%cp_to_coo(tmp) and then b%cp_from_coo(tmp).
|
|
|
|
|
|
|
|
!! \param b The output variable
|
|
|
|
|
|
|
|
!! \param info return code
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
interface
|
|
|
|
|
|
|
|
subroutine psb_c_base_cp_to_lfmt(a,b,info)
|
|
|
|
|
|
|
|
import
|
|
|
|
|
|
|
|
class(psb_c_base_sparse_mat), intent(in) :: a
|
|
|
|
|
|
|
|
class(psb_lc_base_sparse_mat), intent(inout) :: b
|
|
|
|
|
|
|
|
integer(psb_ipk_), intent(out) :: info
|
|
|
|
|
|
|
|
end subroutine psb_c_base_cp_to_lfmt
|
|
|
|
|
|
|
|
end interface
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
!> Function cp_from_fmt:
|
|
|
|
|
|
|
|
!! \memberof psb_c_base_sparse_mat
|
|
|
|
|
|
|
|
!! \brief Copy and convert from a class(psb_c_base_sparse_mat)
|
|
|
|
|
|
|
|
!! Invoked from the target object. Can be implemented by
|
|
|
|
|
|
|
|
!! simply invoking b%cp_to_coo(tmp) and then a%cp_from_coo(tmp).
|
|
|
|
|
|
|
|
!! \param b The output variable
|
|
|
|
|
|
|
|
!! \param info return code
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
interface
|
|
|
|
|
|
|
|
subroutine psb_c_base_cp_from_lfmt(a,b,info)
|
|
|
|
|
|
|
|
import
|
|
|
|
|
|
|
|
class(psb_c_base_sparse_mat), intent(inout) :: a
|
|
|
|
|
|
|
|
class(psb_lc_base_sparse_mat), intent(in) :: b
|
|
|
|
|
|
|
|
integer(psb_ipk_), intent(out) :: info
|
|
|
|
|
|
|
|
end subroutine psb_c_base_cp_from_lfmt
|
|
|
|
|
|
|
|
end interface
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
!> Function mv_to_coo:
|
|
|
|
|
|
|
|
!! \memberof psb_c_base_sparse_mat
|
|
|
|
|
|
|
|
!! \brief Convert to psb_c_coo_sparse_mat, freeing the source.
|
|
|
|
|
|
|
|
!! Invoked from the source object.
|
|
|
|
|
|
|
|
!! \param b The output variable
|
|
|
|
|
|
|
|
!! \param info return code
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
interface
|
|
|
|
|
|
|
|
subroutine psb_c_base_mv_to_lcoo(a,b,info)
|
|
|
|
|
|
|
|
import
|
|
|
|
|
|
|
|
class(psb_c_base_sparse_mat), intent(inout) :: a
|
|
|
|
|
|
|
|
class(psb_lc_coo_sparse_mat), intent(inout) :: b
|
|
|
|
|
|
|
|
integer(psb_ipk_), intent(out) :: info
|
|
|
|
|
|
|
|
end subroutine psb_c_base_mv_to_lcoo
|
|
|
|
|
|
|
|
end interface
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
!> Function mv_from_coo:
|
|
|
|
|
|
|
|
!! \memberof psb_c_base_sparse_mat
|
|
|
|
|
|
|
|
!! \brief Convert from psb_c_coo_sparse_mat, freeing the source.
|
|
|
|
|
|
|
|
!! Invoked from the target object.
|
|
|
|
|
|
|
|
!! \param b The input variable
|
|
|
|
|
|
|
|
!! \param info return code
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
interface
|
|
|
|
|
|
|
|
subroutine psb_c_base_mv_from_lcoo(a,b,info)
|
|
|
|
|
|
|
|
import
|
|
|
|
|
|
|
|
class(psb_c_base_sparse_mat), intent(inout) :: a
|
|
|
|
|
|
|
|
class(psb_lc_coo_sparse_mat), intent(inout) :: b
|
|
|
|
|
|
|
|
integer(psb_ipk_), intent(out) :: info
|
|
|
|
|
|
|
|
end subroutine psb_c_base_mv_from_lcoo
|
|
|
|
|
|
|
|
end interface
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
!> Function mv_to_fmt:
|
|
|
|
|
|
|
|
!! \memberof psb_c_base_sparse_mat
|
|
|
|
|
|
|
|
!! \brief Convert to a class(psb_c_base_sparse_mat), freeing the source.
|
|
|
|
|
|
|
|
!! Invoked from the source object. Can be implemented by
|
|
|
|
|
|
|
|
!! simply invoking a%mv_to_coo(tmp) and then b%mv_from_coo(tmp).
|
|
|
|
|
|
|
|
!! \param b The output variable
|
|
|
|
|
|
|
|
!! \param info return code
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
interface
|
|
|
|
|
|
|
|
subroutine psb_c_base_mv_to_lfmt(a,b,info)
|
|
|
|
import
|
|
|
|
import
|
|
|
|
class(psb_c_base_sparse_mat), intent(inout) :: a
|
|
|
|
class(psb_c_base_sparse_mat), intent(inout) :: a
|
|
|
|
class(psb_c_base_sparse_mat), intent(inout) :: b
|
|
|
|
class(psb_lc_base_sparse_mat), intent(inout) :: b
|
|
|
|
integer(psb_ipk_), intent(out) :: info
|
|
|
|
integer(psb_ipk_), intent(out) :: info
|
|
|
|
end subroutine psb_c_base_mv_to_fmt
|
|
|
|
end subroutine psb_c_base_mv_to_lfmt
|
|
|
|
end interface
|
|
|
|
end interface
|
|
|
|
|
|
|
|
|
|
|
|
!
|
|
|
|
!
|
|
|
|
@ -701,13 +1049,15 @@ module psb_c_base_mat_mod
|
|
|
|
!! \param info return code
|
|
|
|
!! \param info return code
|
|
|
|
!
|
|
|
|
!
|
|
|
|
interface
|
|
|
|
interface
|
|
|
|
subroutine psb_c_base_mv_from_fmt(a,b,info)
|
|
|
|
subroutine psb_c_base_mv_from_lfmt(a,b,info)
|
|
|
|
import
|
|
|
|
import
|
|
|
|
class(psb_c_base_sparse_mat), intent(inout) :: a
|
|
|
|
class(psb_c_base_sparse_mat), intent(inout) :: a
|
|
|
|
class(psb_c_base_sparse_mat), intent(inout) :: b
|
|
|
|
class(psb_lc_base_sparse_mat), intent(inout) :: b
|
|
|
|
integer(psb_ipk_), intent(out) :: info
|
|
|
|
integer(psb_ipk_), intent(out) :: info
|
|
|
|
end subroutine psb_c_base_mv_from_fmt
|
|
|
|
end subroutine psb_c_base_mv_from_lfmt
|
|
|
|
end interface
|
|
|
|
end interface
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
!
|
|
|
|
!
|
|
|
|
!>
|
|
|
|
!>
|
|
|
|
!! \memberof psb_c_base_sparse_mat
|
|
|
|
!! \memberof psb_c_base_sparse_mat
|
|
|
|
@ -1407,6 +1757,29 @@ module psb_c_base_mat_mod
|
|
|
|
integer(psb_ipk_), intent(out) :: info
|
|
|
|
integer(psb_ipk_), intent(out) :: info
|
|
|
|
end subroutine psb_c_cp_coo_from_coo
|
|
|
|
end subroutine psb_c_cp_coo_from_coo
|
|
|
|
end interface
|
|
|
|
end interface
|
|
|
|
|
|
|
|
!>
|
|
|
|
|
|
|
|
!! \memberof psb_c_coo_sparse_mat
|
|
|
|
|
|
|
|
!! \see psb_c_base_mat_mod::psb_c_base_cp_to_coo
|
|
|
|
|
|
|
|
interface
|
|
|
|
|
|
|
|
subroutine psb_c_cp_coo_to_lcoo(a,b,info)
|
|
|
|
|
|
|
|
import
|
|
|
|
|
|
|
|
class(psb_c_coo_sparse_mat), intent(in) :: a
|
|
|
|
|
|
|
|
class(psb_lc_coo_sparse_mat), intent(inout) :: b
|
|
|
|
|
|
|
|
integer(psb_ipk_), intent(out) :: info
|
|
|
|
|
|
|
|
end subroutine psb_c_cp_coo_to_lcoo
|
|
|
|
|
|
|
|
end interface
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
!>
|
|
|
|
|
|
|
|
!! \memberof psb_c_coo_sparse_mat
|
|
|
|
|
|
|
|
!! \see psb_c_base_mat_mod::psb_c_base_cp_from_coo
|
|
|
|
|
|
|
|
interface
|
|
|
|
|
|
|
|
subroutine psb_c_cp_coo_from_lcoo(a,b,info)
|
|
|
|
|
|
|
|
import
|
|
|
|
|
|
|
|
class(psb_c_coo_sparse_mat), intent(inout) :: a
|
|
|
|
|
|
|
|
class(psb_lc_coo_sparse_mat), intent(in) :: b
|
|
|
|
|
|
|
|
integer(psb_ipk_), intent(out) :: info
|
|
|
|
|
|
|
|
end subroutine psb_c_cp_coo_from_lcoo
|
|
|
|
|
|
|
|
end interface
|
|
|
|
|
|
|
|
|
|
|
|
!>
|
|
|
|
!>
|
|
|
|
!! \memberof psb_c_coo_sparse_mat
|
|
|
|
!! \memberof psb_c_coo_sparse_mat
|
|
|
|
@ -1653,266 +2026,87 @@ module psb_c_base_mat_mod
|
|
|
|
class(psb_c_coo_sparse_mat), intent(in) :: a
|
|
|
|
class(psb_c_coo_sparse_mat), intent(in) :: a
|
|
|
|
real(psb_spk_) :: res
|
|
|
|
real(psb_spk_) :: res
|
|
|
|
end function psb_c_coo_csnm1
|
|
|
|
end function psb_c_coo_csnm1
|
|
|
|
end interface
|
|
|
|
end interface
|
|
|
|
|
|
|
|
|
|
|
|
!>
|
|
|
|
|
|
|
|
!! \memberof psb_c_coo_sparse_mat
|
|
|
|
|
|
|
|
!! \see psb_c_base_mat_mod::psb_c_base_rowsum
|
|
|
|
|
|
|
|
interface
|
|
|
|
|
|
|
|
subroutine psb_c_coo_rowsum(d,a)
|
|
|
|
|
|
|
|
import
|
|
|
|
|
|
|
|
class(psb_c_coo_sparse_mat), intent(in) :: a
|
|
|
|
|
|
|
|
complex(psb_spk_), intent(out) :: d(:)
|
|
|
|
|
|
|
|
end subroutine psb_c_coo_rowsum
|
|
|
|
|
|
|
|
end interface
|
|
|
|
|
|
|
|
!>
|
|
|
|
|
|
|
|
!! \memberof psb_c_coo_sparse_mat
|
|
|
|
|
|
|
|
!! \see psb_c_base_mat_mod::psb_c_base_arwsum
|
|
|
|
|
|
|
|
interface
|
|
|
|
|
|
|
|
subroutine psb_c_coo_arwsum(d,a)
|
|
|
|
|
|
|
|
import
|
|
|
|
|
|
|
|
class(psb_c_coo_sparse_mat), intent(in) :: a
|
|
|
|
|
|
|
|
real(psb_spk_), intent(out) :: d(:)
|
|
|
|
|
|
|
|
end subroutine psb_c_coo_arwsum
|
|
|
|
|
|
|
|
end interface
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
!>
|
|
|
|
|
|
|
|
!! \memberof psb_c_coo_sparse_mat
|
|
|
|
|
|
|
|
!! \see psb_c_base_mat_mod::psb_c_base_colsum
|
|
|
|
|
|
|
|
interface
|
|
|
|
|
|
|
|
subroutine psb_c_coo_colsum(d,a)
|
|
|
|
|
|
|
|
import
|
|
|
|
|
|
|
|
class(psb_c_coo_sparse_mat), intent(in) :: a
|
|
|
|
|
|
|
|
complex(psb_spk_), intent(out) :: d(:)
|
|
|
|
|
|
|
|
end subroutine psb_c_coo_colsum
|
|
|
|
|
|
|
|
end interface
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
!>
|
|
|
|
|
|
|
|
!! \memberof psb_c_coo_sparse_mat
|
|
|
|
|
|
|
|
!! \see psb_c_base_mat_mod::psb_c_base_aclsum
|
|
|
|
|
|
|
|
interface
|
|
|
|
|
|
|
|
subroutine psb_c_coo_aclsum(d,a)
|
|
|
|
|
|
|
|
import
|
|
|
|
|
|
|
|
class(psb_c_coo_sparse_mat), intent(in) :: a
|
|
|
|
|
|
|
|
real(psb_spk_), intent(out) :: d(:)
|
|
|
|
|
|
|
|
end subroutine psb_c_coo_aclsum
|
|
|
|
|
|
|
|
end interface
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
!>
|
|
|
|
|
|
|
|
!! \memberof psb_c_coo_sparse_mat
|
|
|
|
|
|
|
|
!! \see psb_c_base_mat_mod::psb_c_base_get_diag
|
|
|
|
|
|
|
|
interface
|
|
|
|
|
|
|
|
subroutine psb_c_coo_get_diag(a,d,info)
|
|
|
|
|
|
|
|
import
|
|
|
|
|
|
|
|
class(psb_c_coo_sparse_mat), intent(in) :: a
|
|
|
|
|
|
|
|
complex(psb_spk_), intent(out) :: d(:)
|
|
|
|
|
|
|
|
integer(psb_ipk_), intent(out) :: info
|
|
|
|
|
|
|
|
end subroutine psb_c_coo_get_diag
|
|
|
|
|
|
|
|
end interface
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
!>
|
|
|
|
|
|
|
|
!! \memberof psb_c_coo_sparse_mat
|
|
|
|
|
|
|
|
!! \see psb_c_base_mat_mod::psb_c_base_scal
|
|
|
|
|
|
|
|
interface
|
|
|
|
|
|
|
|
subroutine psb_c_coo_scal(d,a,info,side)
|
|
|
|
|
|
|
|
import
|
|
|
|
|
|
|
|
class(psb_c_coo_sparse_mat), intent(inout) :: a
|
|
|
|
|
|
|
|
complex(psb_spk_), intent(in) :: d(:)
|
|
|
|
|
|
|
|
integer(psb_ipk_), intent(out) :: info
|
|
|
|
|
|
|
|
character, intent(in), optional :: side
|
|
|
|
|
|
|
|
end subroutine psb_c_coo_scal
|
|
|
|
|
|
|
|
end interface
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
!>
|
|
|
|
|
|
|
|
!! \memberof psb_c_coo_sparse_mat
|
|
|
|
|
|
|
|
!! \see psb_c_base_mat_mod::psb_c_base_scals
|
|
|
|
|
|
|
|
interface
|
|
|
|
|
|
|
|
subroutine psb_c_coo_scals(d,a,info)
|
|
|
|
|
|
|
|
import
|
|
|
|
|
|
|
|
class(psb_c_coo_sparse_mat), intent(inout) :: a
|
|
|
|
|
|
|
|
complex(psb_spk_), intent(in) :: d
|
|
|
|
|
|
|
|
integer(psb_ipk_), intent(out) :: info
|
|
|
|
|
|
|
|
end subroutine psb_c_coo_scals
|
|
|
|
|
|
|
|
end interface
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
!> \namespace psb_base_mod \class psb_lc_base_sparse_mat
|
|
|
|
|
|
|
|
!! \extends psb_lbase_mat_mod::psb_lbase_sparse_mat
|
|
|
|
|
|
|
|
!! The psb_lc_base_sparse_mat type, extending psb_base_sparse_mat,
|
|
|
|
|
|
|
|
!! defines a middle level complex(psb_spk_) sparse matrix object.
|
|
|
|
|
|
|
|
!! This class object itself does not have any additional members
|
|
|
|
|
|
|
|
!! with respect to those of the base class. Most methods cannot be fully
|
|
|
|
|
|
|
|
!! implemented at this level, but we can define the interface for the
|
|
|
|
|
|
|
|
!! computational methods requiring the knowledge of the underlying
|
|
|
|
|
|
|
|
!! field, such as the matrix-vector product; this interface is defined,
|
|
|
|
|
|
|
|
!! but is supposed to be overridden at the leaf level.
|
|
|
|
|
|
|
|
!!
|
|
|
|
|
|
|
|
!! About the method MOLD: this has been defined for those compilers
|
|
|
|
|
|
|
|
!! not yet supporting ALLOCATE( ...,MOLD=...); it's otherwise silly to
|
|
|
|
|
|
|
|
!! duplicate "by hand" what is specified in the language (in this case F2008)
|
|
|
|
|
|
|
|
!!
|
|
|
|
|
|
|
|
type, extends(psb_lbase_sparse_mat) :: psb_lc_base_sparse_mat
|
|
|
|
|
|
|
|
contains
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
! Data management methods: defined here, but (mostly) not implemented.
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
procedure, pass(a) :: csput_a => psb_lc_base_csput_a
|
|
|
|
|
|
|
|
procedure, pass(a) :: csput_v => psb_lc_base_csput_v
|
|
|
|
|
|
|
|
generic, public :: csput => csput_a, csput_v
|
|
|
|
|
|
|
|
procedure, pass(a) :: csgetrow => psb_lc_base_csgetrow
|
|
|
|
|
|
|
|
procedure, pass(a) :: csgetblk => psb_lc_base_csgetblk
|
|
|
|
|
|
|
|
procedure, pass(a) :: get_diag => psb_lc_base_get_diag
|
|
|
|
|
|
|
|
generic, public :: csget => csgetrow, csgetblk
|
|
|
|
|
|
|
|
procedure, pass(a) :: tril => psb_lc_base_tril
|
|
|
|
|
|
|
|
procedure, pass(a) :: triu => psb_lc_base_triu
|
|
|
|
|
|
|
|
procedure, pass(a) :: csclip => psb_lc_base_csclip
|
|
|
|
|
|
|
|
procedure, pass(a) :: cp_to_coo => psb_lc_base_cp_to_coo
|
|
|
|
|
|
|
|
procedure, pass(a) :: cp_from_coo => psb_lc_base_cp_from_coo
|
|
|
|
|
|
|
|
procedure, pass(a) :: cp_to_fmt => psb_lc_base_cp_to_fmt
|
|
|
|
|
|
|
|
procedure, pass(a) :: cp_from_fmt => psb_lc_base_cp_from_fmt
|
|
|
|
|
|
|
|
procedure, pass(a) :: mv_to_coo => psb_lc_base_mv_to_coo
|
|
|
|
|
|
|
|
procedure, pass(a) :: mv_from_coo => psb_lc_base_mv_from_coo
|
|
|
|
|
|
|
|
procedure, pass(a) :: mv_to_fmt => psb_lc_base_mv_to_fmt
|
|
|
|
|
|
|
|
procedure, pass(a) :: mv_from_fmt => psb_lc_base_mv_from_fmt
|
|
|
|
|
|
|
|
procedure, pass(a) :: mold => psb_lc_base_mold
|
|
|
|
|
|
|
|
procedure, pass(a) :: clone => psb_lc_base_clone
|
|
|
|
|
|
|
|
procedure, pass(a) :: make_nonunit => psb_lc_base_make_nonunit
|
|
|
|
|
|
|
|
procedure, pass(a) :: clean_zeros => psb_lc_base_clean_zeros
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
! Transpose methods: defined here but not implemented.
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
procedure, pass(a) :: transp_1mat => psb_lc_base_transp_1mat
|
|
|
|
|
|
|
|
procedure, pass(a) :: transp_2mat => psb_lc_base_transp_2mat
|
|
|
|
|
|
|
|
procedure, pass(a) :: transc_1mat => psb_lc_base_transc_1mat
|
|
|
|
|
|
|
|
procedure, pass(a) :: transc_2mat => psb_lc_base_transc_2mat
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
! Computational methods: defined here but not implemented.
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
procedure, pass(a) :: vect_mv => psb_lc_base_vect_mv
|
|
|
|
|
|
|
|
procedure, pass(a) :: csmv => psb_lc_base_csmv
|
|
|
|
|
|
|
|
procedure, pass(a) :: csmm => psb_lc_base_csmm
|
|
|
|
|
|
|
|
generic, public :: spmm => csmm, csmv, vect_mv
|
|
|
|
|
|
|
|
procedure, pass(a) :: in_vect_sv => psb_lc_base_inner_vect_sv
|
|
|
|
|
|
|
|
procedure, pass(a) :: inner_cssv => psb_lc_base_inner_cssv
|
|
|
|
|
|
|
|
procedure, pass(a) :: inner_cssm => psb_lc_base_inner_cssm
|
|
|
|
|
|
|
|
generic, public :: inner_spsm => inner_cssm, inner_cssv, in_vect_sv
|
|
|
|
|
|
|
|
procedure, pass(a) :: vect_cssv => psb_lc_base_vect_cssv
|
|
|
|
|
|
|
|
procedure, pass(a) :: cssv => psb_lc_base_cssv
|
|
|
|
|
|
|
|
procedure, pass(a) :: cssm => psb_lc_base_cssm
|
|
|
|
|
|
|
|
generic, public :: spsm => cssm, cssv, vect_cssv
|
|
|
|
|
|
|
|
procedure, pass(a) :: scals => psb_lc_base_scals
|
|
|
|
|
|
|
|
procedure, pass(a) :: scalv => psb_lc_base_scal
|
|
|
|
|
|
|
|
generic, public :: scal => scals, scalv
|
|
|
|
|
|
|
|
procedure, pass(a) :: maxval => psb_lc_base_maxval
|
|
|
|
|
|
|
|
procedure, pass(a) :: spnmi => psb_lc_base_csnmi
|
|
|
|
|
|
|
|
procedure, pass(a) :: spnm1 => psb_lc_base_csnm1
|
|
|
|
|
|
|
|
procedure, pass(a) :: rowsum => psb_lc_base_rowsum
|
|
|
|
|
|
|
|
procedure, pass(a) :: arwsum => psb_lc_base_arwsum
|
|
|
|
|
|
|
|
procedure, pass(a) :: colsum => psb_lc_base_colsum
|
|
|
|
|
|
|
|
procedure, pass(a) :: aclsum => psb_lc_base_aclsum
|
|
|
|
|
|
|
|
end type psb_lc_base_sparse_mat
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private :: lc_base_mat_sync, lc_base_mat_is_host, lc_base_mat_is_dev, &
|
|
|
|
|
|
|
|
& lc_base_mat_is_sync, lc_base_mat_set_host, lc_base_mat_set_dev,&
|
|
|
|
|
|
|
|
& lc_base_mat_set_sync
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
!> \namespace psb_base_mod \class psb_lc_coo_sparse_mat
|
|
|
|
|
|
|
|
!! \extends psb_lc_base_mat_mod::psb_lc_base_sparse_mat
|
|
|
|
|
|
|
|
!!
|
|
|
|
|
|
|
|
!! psb_lc_coo_sparse_mat type and the related methods. This is the
|
|
|
|
|
|
|
|
!! reference type for all the format transitions, copies and mv unless
|
|
|
|
|
|
|
|
!! methods are implemented that allow the direct transition from one
|
|
|
|
|
|
|
|
!! format to another. It is defined here since all other classes must
|
|
|
|
|
|
|
|
!! refer to it per the MEDIATOR design pattern.
|
|
|
|
|
|
|
|
!!
|
|
|
|
|
|
|
|
type, extends(psb_lc_base_sparse_mat) :: psb_lc_coo_sparse_mat
|
|
|
|
|
|
|
|
!> Number of nonzeros.
|
|
|
|
|
|
|
|
integer(psb_lpk_) :: nnz
|
|
|
|
|
|
|
|
!> Row indices.
|
|
|
|
|
|
|
|
integer(psb_lpk_), allocatable :: ia(:)
|
|
|
|
|
|
|
|
!> Column indices.
|
|
|
|
|
|
|
|
integer(psb_lpk_), allocatable :: ja(:)
|
|
|
|
|
|
|
|
!> Coefficient values.
|
|
|
|
|
|
|
|
complex(psb_spk_), allocatable :: val(:)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
integer, private :: sort_status=psb_unsorted_
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
contains
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
! Data management methods.
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
procedure, pass(a) :: get_size => lc_coo_get_size
|
|
|
|
|
|
|
|
procedure, pass(a) :: get_nzeros => lc_coo_get_nzeros
|
|
|
|
|
|
|
|
procedure, nopass :: get_fmt => lc_coo_get_fmt
|
|
|
|
|
|
|
|
procedure, pass(a) :: sizeof => lc_coo_sizeof
|
|
|
|
|
|
|
|
procedure, pass(a) :: reallocate_nz => psb_lc_coo_reallocate_nz
|
|
|
|
|
|
|
|
procedure, pass(a) :: allocate_mnnz => psb_lc_coo_allocate_mnnz
|
|
|
|
|
|
|
|
procedure, pass(a) :: cp_to_coo => psb_lc_cp_coo_to_coo
|
|
|
|
|
|
|
|
procedure, pass(a) :: cp_from_coo => psb_lc_cp_coo_from_coo
|
|
|
|
|
|
|
|
procedure, pass(a) :: cp_to_fmt => psb_lc_cp_coo_to_fmt
|
|
|
|
|
|
|
|
procedure, pass(a) :: cp_from_fmt => psb_lc_cp_coo_from_fmt
|
|
|
|
|
|
|
|
procedure, pass(a) :: mv_to_coo => psb_lc_mv_coo_to_coo
|
|
|
|
|
|
|
|
procedure, pass(a) :: mv_from_coo => psb_lc_mv_coo_from_coo
|
|
|
|
|
|
|
|
procedure, pass(a) :: mv_to_fmt => psb_lc_mv_coo_to_fmt
|
|
|
|
|
|
|
|
procedure, pass(a) :: mv_from_fmt => psb_lc_mv_coo_from_fmt
|
|
|
|
|
|
|
|
procedure, pass(a) :: csput_a => psb_lc_coo_csput_a
|
|
|
|
|
|
|
|
procedure, pass(a) :: get_diag => psb_lc_coo_get_diag
|
|
|
|
|
|
|
|
procedure, pass(a) :: csgetrow => psb_lc_coo_csgetrow
|
|
|
|
|
|
|
|
procedure, pass(a) :: csgetptn => psb_lc_coo_csgetptn
|
|
|
|
|
|
|
|
procedure, pass(a) :: reinit => psb_lc_coo_reinit
|
|
|
|
|
|
|
|
procedure, pass(a) :: get_nz_row => psb_lc_coo_get_nz_row
|
|
|
|
|
|
|
|
procedure, pass(a) :: fix => psb_lc_fix_coo
|
|
|
|
|
|
|
|
procedure, pass(a) :: trim => psb_lc_coo_trim
|
|
|
|
|
|
|
|
procedure, pass(a) :: clean_zeros => psb_lc_coo_clean_zeros
|
|
|
|
|
|
|
|
procedure, pass(a) :: print => psb_lc_coo_print
|
|
|
|
|
|
|
|
procedure, pass(a) :: free => lc_coo_free
|
|
|
|
|
|
|
|
procedure, pass(a) :: mold => psb_lc_coo_mold
|
|
|
|
|
|
|
|
procedure, pass(a) :: is_sorted => lc_coo_is_sorted
|
|
|
|
|
|
|
|
procedure, pass(a) :: is_by_rows => lc_coo_is_by_rows
|
|
|
|
|
|
|
|
procedure, pass(a) :: is_by_cols => lc_coo_is_by_cols
|
|
|
|
|
|
|
|
procedure, pass(a) :: set_by_rows => lc_coo_set_by_rows
|
|
|
|
|
|
|
|
procedure, pass(a) :: set_by_cols => lc_coo_set_by_cols
|
|
|
|
|
|
|
|
procedure, pass(a) :: set_sort_status => lc_coo_set_sort_status
|
|
|
|
|
|
|
|
procedure, pass(a) :: get_sort_status => lc_coo_get_sort_status
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
! This is COO specific
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
procedure, pass(a) :: set_nzeros => lc_coo_set_nzeros
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
!
|
|
|
|
!>
|
|
|
|
! Transpose methods. These are the base of all
|
|
|
|
!! \memberof psb_c_coo_sparse_mat
|
|
|
|
! indirection in transpose, together with conversions
|
|
|
|
!! \see psb_c_base_mat_mod::psb_c_base_rowsum
|
|
|
|
! they are sufficient for all cases.
|
|
|
|
interface
|
|
|
|
!
|
|
|
|
subroutine psb_c_coo_rowsum(d,a)
|
|
|
|
procedure, pass(a) :: transp_1mat => lc_coo_transp_1mat
|
|
|
|
import
|
|
|
|
procedure, pass(a) :: transc_1mat => lc_coo_transc_1mat
|
|
|
|
class(psb_c_coo_sparse_mat), intent(in) :: a
|
|
|
|
|
|
|
|
complex(psb_spk_), intent(out) :: d(:)
|
|
|
|
|
|
|
|
end subroutine psb_c_coo_rowsum
|
|
|
|
|
|
|
|
end interface
|
|
|
|
|
|
|
|
!>
|
|
|
|
|
|
|
|
!! \memberof psb_c_coo_sparse_mat
|
|
|
|
|
|
|
|
!! \see psb_c_base_mat_mod::psb_c_base_arwsum
|
|
|
|
|
|
|
|
interface
|
|
|
|
|
|
|
|
subroutine psb_c_coo_arwsum(d,a)
|
|
|
|
|
|
|
|
import
|
|
|
|
|
|
|
|
class(psb_c_coo_sparse_mat), intent(in) :: a
|
|
|
|
|
|
|
|
real(psb_spk_), intent(out) :: d(:)
|
|
|
|
|
|
|
|
end subroutine psb_c_coo_arwsum
|
|
|
|
|
|
|
|
end interface
|
|
|
|
|
|
|
|
|
|
|
|
!
|
|
|
|
!>
|
|
|
|
! Computational methods.
|
|
|
|
!! \memberof psb_c_coo_sparse_mat
|
|
|
|
!
|
|
|
|
!! \see psb_c_base_mat_mod::psb_c_base_colsum
|
|
|
|
procedure, pass(a) :: csmm => psb_lc_coo_csmm
|
|
|
|
interface
|
|
|
|
procedure, pass(a) :: csmv => psb_lc_coo_csmv
|
|
|
|
subroutine psb_c_coo_colsum(d,a)
|
|
|
|
procedure, pass(a) :: inner_cssm => psb_lc_coo_cssm
|
|
|
|
import
|
|
|
|
procedure, pass(a) :: inner_cssv => psb_lc_coo_cssv
|
|
|
|
class(psb_c_coo_sparse_mat), intent(in) :: a
|
|
|
|
procedure, pass(a) :: scals => psb_lc_coo_scals
|
|
|
|
complex(psb_spk_), intent(out) :: d(:)
|
|
|
|
procedure, pass(a) :: scalv => psb_lc_coo_scal
|
|
|
|
end subroutine psb_c_coo_colsum
|
|
|
|
procedure, pass(a) :: maxval => psb_lc_coo_maxval
|
|
|
|
end interface
|
|
|
|
procedure, pass(a) :: spnmi => psb_lc_coo_csnmi
|
|
|
|
|
|
|
|
procedure, pass(a) :: spnm1 => psb_lc_coo_csnm1
|
|
|
|
|
|
|
|
procedure, pass(a) :: rowsum => psb_lc_coo_rowsum
|
|
|
|
|
|
|
|
procedure, pass(a) :: arwsum => psb_lc_coo_arwsum
|
|
|
|
|
|
|
|
procedure, pass(a) :: colsum => psb_lc_coo_colsum
|
|
|
|
|
|
|
|
procedure, pass(a) :: aclsum => psb_lc_coo_aclsum
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
end type psb_lc_coo_sparse_mat
|
|
|
|
!>
|
|
|
|
|
|
|
|
!! \memberof psb_c_coo_sparse_mat
|
|
|
|
|
|
|
|
!! \see psb_c_base_mat_mod::psb_c_base_aclsum
|
|
|
|
|
|
|
|
interface
|
|
|
|
|
|
|
|
subroutine psb_c_coo_aclsum(d,a)
|
|
|
|
|
|
|
|
import
|
|
|
|
|
|
|
|
class(psb_c_coo_sparse_mat), intent(in) :: a
|
|
|
|
|
|
|
|
real(psb_spk_), intent(out) :: d(:)
|
|
|
|
|
|
|
|
end subroutine psb_c_coo_aclsum
|
|
|
|
|
|
|
|
end interface
|
|
|
|
|
|
|
|
|
|
|
|
private :: lc_coo_get_nzeros, lc_coo_set_nzeros, &
|
|
|
|
!>
|
|
|
|
& lc_coo_get_fmt, lc_coo_free, lc_coo_sizeof, &
|
|
|
|
!! \memberof psb_c_coo_sparse_mat
|
|
|
|
& lc_coo_transp_1mat, lc_coo_transc_1mat
|
|
|
|
!! \see psb_c_base_mat_mod::psb_c_base_get_diag
|
|
|
|
|
|
|
|
interface
|
|
|
|
|
|
|
|
subroutine psb_c_coo_get_diag(a,d,info)
|
|
|
|
|
|
|
|
import
|
|
|
|
|
|
|
|
class(psb_c_coo_sparse_mat), intent(in) :: a
|
|
|
|
|
|
|
|
complex(psb_spk_), intent(out) :: d(:)
|
|
|
|
|
|
|
|
integer(psb_ipk_), intent(out) :: info
|
|
|
|
|
|
|
|
end subroutine psb_c_coo_get_diag
|
|
|
|
|
|
|
|
end interface
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
!>
|
|
|
|
|
|
|
|
!! \memberof psb_c_coo_sparse_mat
|
|
|
|
|
|
|
|
!! \see psb_c_base_mat_mod::psb_c_base_scal
|
|
|
|
|
|
|
|
interface
|
|
|
|
|
|
|
|
subroutine psb_c_coo_scal(d,a,info,side)
|
|
|
|
|
|
|
|
import
|
|
|
|
|
|
|
|
class(psb_c_coo_sparse_mat), intent(inout) :: a
|
|
|
|
|
|
|
|
complex(psb_spk_), intent(in) :: d(:)
|
|
|
|
|
|
|
|
integer(psb_ipk_), intent(out) :: info
|
|
|
|
|
|
|
|
character, intent(in), optional :: side
|
|
|
|
|
|
|
|
end subroutine psb_c_coo_scal
|
|
|
|
|
|
|
|
end interface
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
!>
|
|
|
|
|
|
|
|
!! \memberof psb_c_coo_sparse_mat
|
|
|
|
|
|
|
|
!! \see psb_c_base_mat_mod::psb_c_base_scals
|
|
|
|
|
|
|
|
interface
|
|
|
|
|
|
|
|
subroutine psb_c_coo_scals(d,a,info)
|
|
|
|
|
|
|
|
import
|
|
|
|
|
|
|
|
class(psb_c_coo_sparse_mat), intent(inout) :: a
|
|
|
|
|
|
|
|
complex(psb_spk_), intent(in) :: d
|
|
|
|
|
|
|
|
integer(psb_ipk_), intent(out) :: info
|
|
|
|
|
|
|
|
end subroutine psb_c_coo_scals
|
|
|
|
|
|
|
|
end interface
|
|
|
|
|
|
|
|
|
|
|
|
! == =================
|
|
|
|
! == =================
|
|
|
|
!
|
|
|
|
!
|
|
|
|
@ -1972,7 +2166,7 @@ module psb_c_base_mat_mod
|
|
|
|
import
|
|
|
|
import
|
|
|
|
class(psb_lc_base_sparse_mat), intent(inout) :: a
|
|
|
|
class(psb_lc_base_sparse_mat), intent(inout) :: a
|
|
|
|
class(psb_c_base_vect_type), intent(inout) :: val
|
|
|
|
class(psb_c_base_vect_type), intent(inout) :: val
|
|
|
|
class(psb_i_base_vect_type), intent(inout) :: ia, ja
|
|
|
|
class(psb_l_base_vect_type), intent(inout) :: ia, ja
|
|
|
|
integer(psb_lpk_), intent(in) :: nz, imin, imax,jmin,jmax
|
|
|
|
integer(psb_lpk_), intent(in) :: nz, imin, imax,jmin,jmax
|
|
|
|
integer(psb_ipk_), intent(out) :: info
|
|
|
|
integer(psb_ipk_), intent(out) :: info
|
|
|
|
integer(psb_lpk_), intent(in), optional :: gtl(:)
|
|
|
|
integer(psb_lpk_), intent(in), optional :: gtl(:)
|
|
|
|
@ -2405,6 +2599,150 @@ module psb_c_base_mat_mod
|
|
|
|
integer(psb_ipk_), intent(out) :: info
|
|
|
|
integer(psb_ipk_), intent(out) :: info
|
|
|
|
end subroutine psb_lc_base_mv_from_fmt
|
|
|
|
end subroutine psb_lc_base_mv_from_fmt
|
|
|
|
end interface
|
|
|
|
end interface
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
!> Function cp_to_coo:
|
|
|
|
|
|
|
|
!! \memberof psb_lc_base_sparse_mat
|
|
|
|
|
|
|
|
!! \brief Copy and convert to psb_lc_coo_sparse_mat
|
|
|
|
|
|
|
|
!! Invoked from the source object.
|
|
|
|
|
|
|
|
!! \param b The output variable
|
|
|
|
|
|
|
|
!! \param info return code
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
interface
|
|
|
|
|
|
|
|
subroutine psb_lc_base_cp_to_icoo(a,b,info)
|
|
|
|
|
|
|
|
import
|
|
|
|
|
|
|
|
class(psb_lc_base_sparse_mat), intent(in) :: a
|
|
|
|
|
|
|
|
class(psb_c_coo_sparse_mat), intent(inout) :: b
|
|
|
|
|
|
|
|
integer(psb_ipk_), intent(out) :: info
|
|
|
|
|
|
|
|
end subroutine psb_lc_base_cp_to_icoo
|
|
|
|
|
|
|
|
end interface
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
!> Function cp_from_coo:
|
|
|
|
|
|
|
|
!! \memberof psb_lc_base_sparse_mat
|
|
|
|
|
|
|
|
!! \brief Copy and convert from psb_lc_coo_sparse_mat
|
|
|
|
|
|
|
|
!! Invoked from the target object.
|
|
|
|
|
|
|
|
!! \param b The input variable
|
|
|
|
|
|
|
|
!! \param info return code
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
interface
|
|
|
|
|
|
|
|
subroutine psb_lc_base_cp_from_icoo(a,b,info)
|
|
|
|
|
|
|
|
import
|
|
|
|
|
|
|
|
class(psb_lc_base_sparse_mat), intent(inout) :: a
|
|
|
|
|
|
|
|
class(psb_c_coo_sparse_mat), intent(in) :: b
|
|
|
|
|
|
|
|
integer(psb_ipk_), intent(out) :: info
|
|
|
|
|
|
|
|
end subroutine psb_lc_base_cp_from_icoo
|
|
|
|
|
|
|
|
end interface
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
!> Function cp_to_fmt:
|
|
|
|
|
|
|
|
!! \memberof psb_lc_base_sparse_mat
|
|
|
|
|
|
|
|
!! \brief Copy and convert to a class(psb_lc_base_sparse_mat)
|
|
|
|
|
|
|
|
!! Invoked from the source object. Can be implemented by
|
|
|
|
|
|
|
|
!! simply invoking a%cp_to_coo(tmp) and then b%cp_from_coo(tmp).
|
|
|
|
|
|
|
|
!! \param b The output variable
|
|
|
|
|
|
|
|
!! \param info return code
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
interface
|
|
|
|
|
|
|
|
subroutine psb_lc_base_cp_to_ifmt(a,b,info)
|
|
|
|
|
|
|
|
import
|
|
|
|
|
|
|
|
class(psb_lc_base_sparse_mat), intent(in) :: a
|
|
|
|
|
|
|
|
class(psb_c_base_sparse_mat), intent(inout) :: b
|
|
|
|
|
|
|
|
integer(psb_ipk_), intent(out) :: info
|
|
|
|
|
|
|
|
end subroutine psb_lc_base_cp_to_ifmt
|
|
|
|
|
|
|
|
end interface
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
!> Function cp_from_fmt:
|
|
|
|
|
|
|
|
!! \memberof psb_lc_base_sparse_mat
|
|
|
|
|
|
|
|
!! \brief Copy and convert from a class(psb_lc_base_sparse_mat)
|
|
|
|
|
|
|
|
!! Invoked from the target object. Can be implemented by
|
|
|
|
|
|
|
|
!! simply invoking b%cp_to_coo(tmp) and then a%cp_from_coo(tmp).
|
|
|
|
|
|
|
|
!! \param b The output variable
|
|
|
|
|
|
|
|
!! \param info return code
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
interface
|
|
|
|
|
|
|
|
subroutine psb_lc_base_cp_from_ifmt(a,b,info)
|
|
|
|
|
|
|
|
import
|
|
|
|
|
|
|
|
class(psb_lc_base_sparse_mat), intent(inout) :: a
|
|
|
|
|
|
|
|
class(psb_c_base_sparse_mat), intent(in) :: b
|
|
|
|
|
|
|
|
integer(psb_ipk_), intent(out) :: info
|
|
|
|
|
|
|
|
end subroutine psb_lc_base_cp_from_ifmt
|
|
|
|
|
|
|
|
end interface
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
!> Function mv_to_coo:
|
|
|
|
|
|
|
|
!! \memberof psb_lc_base_sparse_mat
|
|
|
|
|
|
|
|
!! \brief Convert to psb_lc_coo_sparse_mat, freeing the source.
|
|
|
|
|
|
|
|
!! Invoked from the source object.
|
|
|
|
|
|
|
|
!! \param b The output variable
|
|
|
|
|
|
|
|
!! \param info return code
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
interface
|
|
|
|
|
|
|
|
subroutine psb_lc_base_mv_to_icoo(a,b,info)
|
|
|
|
|
|
|
|
import
|
|
|
|
|
|
|
|
class(psb_lc_base_sparse_mat), intent(inout) :: a
|
|
|
|
|
|
|
|
class(psb_c_coo_sparse_mat), intent(inout) :: b
|
|
|
|
|
|
|
|
integer(psb_ipk_), intent(out) :: info
|
|
|
|
|
|
|
|
end subroutine psb_lc_base_mv_to_icoo
|
|
|
|
|
|
|
|
end interface
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
!> Function mv_from_coo:
|
|
|
|
|
|
|
|
!! \memberof psb_lc_base_sparse_mat
|
|
|
|
|
|
|
|
!! \brief Convert from psb_lc_coo_sparse_mat, freeing the source.
|
|
|
|
|
|
|
|
!! Invoked from the target object.
|
|
|
|
|
|
|
|
!! \param b The input variable
|
|
|
|
|
|
|
|
!! \param info return code
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
interface
|
|
|
|
|
|
|
|
subroutine psb_lc_base_mv_from_icoo(a,b,info)
|
|
|
|
|
|
|
|
import
|
|
|
|
|
|
|
|
class(psb_lc_base_sparse_mat), intent(inout) :: a
|
|
|
|
|
|
|
|
class(psb_c_coo_sparse_mat), intent(inout) :: b
|
|
|
|
|
|
|
|
integer(psb_ipk_), intent(out) :: info
|
|
|
|
|
|
|
|
end subroutine psb_lc_base_mv_from_icoo
|
|
|
|
|
|
|
|
end interface
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
!> Function mv_to_fmt:
|
|
|
|
|
|
|
|
!! \memberof psb_lc_base_sparse_mat
|
|
|
|
|
|
|
|
!! \brief Convert to a class(psb_lc_base_sparse_mat), freeing the source.
|
|
|
|
|
|
|
|
!! Invoked from the source object. Can be implemented by
|
|
|
|
|
|
|
|
!! simply invoking a%mv_to_coo(tmp) and then b%mv_from_coo(tmp).
|
|
|
|
|
|
|
|
!! \param b The output variable
|
|
|
|
|
|
|
|
!! \param info return code
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
interface
|
|
|
|
|
|
|
|
subroutine psb_lc_base_mv_to_ifmt(a,b,info)
|
|
|
|
|
|
|
|
import
|
|
|
|
|
|
|
|
class(psb_lc_base_sparse_mat), intent(inout) :: a
|
|
|
|
|
|
|
|
class(psb_c_base_sparse_mat), intent(inout) :: b
|
|
|
|
|
|
|
|
integer(psb_ipk_), intent(out) :: info
|
|
|
|
|
|
|
|
end subroutine psb_lc_base_mv_to_ifmt
|
|
|
|
|
|
|
|
end interface
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
!> Function mv_from_fmt:
|
|
|
|
|
|
|
|
!! \memberof psb_lc_base_sparse_mat
|
|
|
|
|
|
|
|
!! \brief Convert from a class(psb_lc_base_sparse_mat), freeing the source.
|
|
|
|
|
|
|
|
!! Invoked from the target object. Can be implemented by
|
|
|
|
|
|
|
|
!! simply invoking b%mv_to_coo(tmp) and then a%mv_from_coo(tmp).
|
|
|
|
|
|
|
|
!! \param b The output variable
|
|
|
|
|
|
|
|
!! \param info return code
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
interface
|
|
|
|
|
|
|
|
subroutine psb_lc_base_mv_from_ifmt(a,b,info)
|
|
|
|
|
|
|
|
import
|
|
|
|
|
|
|
|
class(psb_lc_base_sparse_mat), intent(inout) :: a
|
|
|
|
|
|
|
|
class(psb_c_base_sparse_mat), intent(inout) :: b
|
|
|
|
|
|
|
|
integer(psb_ipk_), intent(out) :: info
|
|
|
|
|
|
|
|
end subroutine psb_lc_base_mv_from_ifmt
|
|
|
|
|
|
|
|
end interface
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
!
|
|
|
|
!
|
|
|
|
!>
|
|
|
|
!>
|
|
|
|
!! \memberof psb_lc_base_sparse_mat
|
|
|
|
!! \memberof psb_lc_base_sparse_mat
|
|
|
|
@ -3055,7 +3393,8 @@ module psb_c_base_mat_mod
|
|
|
|
interface
|
|
|
|
interface
|
|
|
|
subroutine psb_lc_fix_coo_inner(nr,nc,nzin,dupl,ia,ja,val,nzout,info,idir)
|
|
|
|
subroutine psb_lc_fix_coo_inner(nr,nc,nzin,dupl,ia,ja,val,nzout,info,idir)
|
|
|
|
import
|
|
|
|
import
|
|
|
|
integer(psb_ipk_), intent(in) :: nr,nc,nzin,dupl
|
|
|
|
integer(psb_lpk_), intent(in) :: nr,nc,nzin
|
|
|
|
|
|
|
|
integer(psb_ipk_), intent(in) :: dupl
|
|
|
|
integer(psb_lpk_), intent(inout) :: ia(:), ja(:)
|
|
|
|
integer(psb_lpk_), intent(inout) :: ia(:), ja(:)
|
|
|
|
complex(psb_spk_), intent(inout) :: val(:)
|
|
|
|
complex(psb_spk_), intent(inout) :: val(:)
|
|
|
|
integer(psb_lpk_), intent(out) :: nzout
|
|
|
|
integer(psb_lpk_), intent(out) :: nzout
|
|
|
|
@ -3105,6 +3444,31 @@ module psb_c_base_mat_mod
|
|
|
|
end subroutine psb_lc_cp_coo_from_coo
|
|
|
|
end subroutine psb_lc_cp_coo_from_coo
|
|
|
|
end interface
|
|
|
|
end interface
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
!>
|
|
|
|
|
|
|
|
!! \memberof psb_lc_coo_sparse_mat
|
|
|
|
|
|
|
|
!! \see psb_lc_base_mat_mod::psb_lc_base_cp_to_coo
|
|
|
|
|
|
|
|
interface
|
|
|
|
|
|
|
|
subroutine psb_lc_cp_coo_to_icoo(a,b,info)
|
|
|
|
|
|
|
|
import
|
|
|
|
|
|
|
|
class(psb_lc_coo_sparse_mat), intent(in) :: a
|
|
|
|
|
|
|
|
class(psb_c_coo_sparse_mat), intent(inout) :: b
|
|
|
|
|
|
|
|
integer(psb_ipk_), intent(out) :: info
|
|
|
|
|
|
|
|
end subroutine psb_lc_cp_coo_to_icoo
|
|
|
|
|
|
|
|
end interface
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
!>
|
|
|
|
|
|
|
|
!! \memberof psb_lc_coo_sparse_mat
|
|
|
|
|
|
|
|
!! \see psb_lc_base_mat_mod::psb_lc_base_cp_from_coo
|
|
|
|
|
|
|
|
interface
|
|
|
|
|
|
|
|
subroutine psb_lc_cp_coo_from_icoo(a,b,info)
|
|
|
|
|
|
|
|
import
|
|
|
|
|
|
|
|
class(psb_lc_coo_sparse_mat), intent(inout) :: a
|
|
|
|
|
|
|
|
class(psb_c_coo_sparse_mat), intent(in) :: b
|
|
|
|
|
|
|
|
integer(psb_ipk_), intent(out) :: info
|
|
|
|
|
|
|
|
end subroutine psb_lc_cp_coo_from_icoo
|
|
|
|
|
|
|
|
end interface
|
|
|
|
|
|
|
|
|
|
|
|
!>
|
|
|
|
!>
|
|
|
|
!! \memberof psb_lc_coo_sparse_mat
|
|
|
|
!! \memberof psb_lc_coo_sparse_mat
|
|
|
|
!! \see psb_lc_base_mat_mod::psb_lc_base_cp_from_coo
|
|
|
|
!! \see psb_lc_base_mat_mod::psb_lc_base_cp_from_coo
|
|
|
|
@ -3433,9 +3797,6 @@ module psb_c_base_mat_mod
|
|
|
|
end interface
|
|
|
|
end interface
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
contains
|
|
|
|
contains
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|