Updates for doxygen.
psblas3-type-indexed
Salvatore Filippone 13 years ago
parent 0a4f0fcd46
commit 6cd3709757

@ -39,9 +39,8 @@ module psb_c_base_mat_mod
!> \namespace psb_base_mod \class psb_c_base_sparse_mat !> \namespace psb_base_mod \class psb_c_base_sparse_mat
!! \extends psb_base_mod::psb_base_sparse_mat !! \extends psb_base_mod::psb_base_sparse_mat
!! This module contains the definition of the psb_c_base_sparse_mat !! The psb_c_base_sparse_mat type, extending psb_base_sparse_mat,
!! type, extending the psb_base_sparse_mat to define a middle !! defines a middle level complex(psb_spk_) sparse matrix object.
!! level complex(psb_spk_) sparse matrix object.
!! This class object itself does not have any additional members !! This class object itself does not have any additional members
!! with respect to those of the base class. No methods can be fully !! with respect to those of the base class. No methods can be fully
!! implemented at this level, but we can define the interface for the !! implemented at this level, but we can define the interface for the
@ -49,13 +48,6 @@ module psb_c_base_mat_mod
!! field, such as the matrix-vector product; this interface is defined, !! field, such as the matrix-vector product; this interface is defined,
!! but is supposed to be overridden at the leaf level. !! but is supposed to be overridden at the leaf level.
!! !!
!! This module also contains the definition of the
!! psb_c_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.
!!
!! About the method MOLD: this has been defined for those compilers !! About the method MOLD: this has been defined for those compilers
!! not yet supporting ALLOCATE( ...,MOLD=...); it's otherwise silly to !! not yet supporting ALLOCATE( ...,MOLD=...); it's otherwise silly to
!! duplicate "by hand" what is specified in the language (in this case F2008) !! duplicate "by hand" what is specified in the language (in this case F2008)
@ -123,10 +115,23 @@ module psb_c_base_mat_mod
private :: c_base_cp_from, c_base_mv_from private :: c_base_cp_from, c_base_mv_from
!> \namespace psb_base_mod \class psb_c_base_sparse_mat
!! \extends psb_base_mod::psb_base_sparse_mat
!!
!! psb_c_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_c_base_sparse_mat) :: psb_c_coo_sparse_mat type, extends(psb_c_base_sparse_mat) :: psb_c_coo_sparse_mat
!> Number of nonzeros.
integer(psb_ipk_) :: nnz integer(psb_ipk_) :: nnz
integer(psb_ipk_), allocatable :: ia(:), ja(:) !> Row indices.
integer(psb_ipk_), allocatable :: ia(:)
!> Column indices.
integer(psb_ipk_), allocatable :: ja(:)
!> Coefficient values.
complex(psb_spk_), allocatable :: val(:) complex(psb_spk_), allocatable :: val(:)
contains contains
@ -206,20 +211,40 @@ module psb_c_base_mat_mod
! !
! == ================= ! == =================
! !> Function csput:
! CSPUT: Hand over a set of values to A. !! \brief Insert coefficients.
! Simple description: !!
! A(IA(1:nz),JA(1:nz)) = VAL(1:NZ) !!
! !! Given a list of NZ triples
! Catches: !! (IA(i),JA(i),VAL(i))
! 1. If A is in the BUILD state, then this method !! record a new coefficient in A such that
! can only be called for COO matrice, in which case it !! A(IA(1:nz),JA(1:nz)) = VAL(1:NZ).
! is more like queueing coefficients for later processing; !!
! 2. If A is in the UPDATE state, then every derived class must !! The internal components IA,JA,VAL are reallocated as necessary.
! implement it; !! Constraints:
! 3. In the UPDATE state, depending on the value of DUPL flag !! - If the matrix A is in the BUILD state, then the method will
! inside A, it will be A=VAL or A = A + VAL !! only work for COO matrices, all other format will throw an error.
! !! In this case coefficients are queued inside A for further processing.
!! - If the matrix A is in the UPDATE state, then it can be in any format;
!! the update operation will perform either
!! A(IA(1:nz),JA(1:nz)) = VAL(1:NZ)
!! or
!! A(IA(1:nz),JA(1:nz)) = A(IA(1:nz),JA(1:nz))+VAL(1:NZ)
!! according to the value of DUPLICATE.
!! - Coefficients with (IA(I),JA(I)) outside the ranges specified by
!! IMIN:IMAX,JMIN:JMAX will be ignored.
!!
!! \param nz number of triples in input
!! \param ia(:) the input row indices
!! \param ja(:) the input col indices
!! \param val(:) the input coefficients
!! \param imin minimum row index
!! \param imax maximum row index
!! \param jmin minimum col index
!! \param jmax maximum col index
!! \param info return code
!! \param gtl(:) [none] an array to renumber indices (iren(ia(:)),iren(ja(:))
!!
! !
interface interface
subroutine psb_c_base_csput(nz,ia,ja,val,a,imin,imax,jmin,jmax,info,gtl) subroutine psb_c_base_csput(nz,ia,ja,val,a,imin,imax,jmin,jmax,info,gtl)
@ -233,27 +258,36 @@ module psb_c_base_mat_mod
end interface end interface
! !
! CSGET methods: getrow, getblk, clip.
! getrow is the basic method, the other two are
! basically convenient wrappers/shorthand.
!
! out(:) = A(imin:imax,:)
!
! The two methods differ on the output format
! !
! GETROW returns as the set !> Function csgetrow:
! NZ, IA(1:nz), JA(1:nz), VAL(1:NZ) !! \brief Get a (subset of) row(s)
! !!
! Optional arguments: !! getrow is the basic method by which the other (getblk, clip) can
! JMIN,JMAX: get A(IMIN:IMAX,JMIN:JMAX), !! be implemented.
! default 1:ncols !!
! APPEND: append at the end of data, in which case !! Returns the set
! # used entries must be in NZ !! NZ, IA(1:nz), JA(1:nz), VAL(1:NZ)
! RSCALE, CSCALE: scale output indices at base 1. !! each identifying the position of a nonzero in A
! !! between row indices IMIN:IMAX;
! GETROW must be overridden by all data formats. !! IA,JA are reallocated as necessary.
!!
!! \param imin the minimum row index we are interested in
!! \param imax the minimum row index we are interested in
!! \param nz the number of output coefficients
!! \param ia(:) the output row indices
!! \param ja(:) the output col indices
!! \param val(:) the output coefficients
!! \param info return code
!! \param jmin [1] minimum col index
!! \param jmax [a\%get_ncols()] maximum col index
!! \param iren(:) [none] an array to return renumbered indices (iren(ia(:)),iren(ja(:))
!! \param rscale [false] map [min(ia(:)):max(ia(:))] onto [1:max(ia(:))-min(ia(:))+1]
!! \param cscale [false] map [min(ja(:)):max(ja(:))] onto [1:max(ja(:))-min(ja(:))+1]
!! ( iren cannot be specified with rscale/cscale)
!! \param append [false] append to ia,ja
!! \param nzin [none] if append, then first new entry should go in entry nzin+1
!!
! !
interface interface
subroutine psb_c_base_csgetrow(imin,imax,a,nz,ia,ja,val,info,& subroutine psb_c_base_csgetrow(imin,imax,a,nz,ia,ja,val,info,&
& jmin,jmax,iren,append,nzin,rscale,cscale) & jmin,jmax,iren,append,nzin,rscale,cscale)
@ -272,13 +306,25 @@ module psb_c_base_mat_mod
end interface end interface
! !
! CSGET methods: getrow, getblk. !> Function csgetblk:
! out(:) = A(imin:imax,:) !! \brief Get a (subset of) row(s)
! !!
! GETBLK returns a pbs_c_coo_sparse_mat with !! getblk is very similar to getrow, except that the output
! the same contents. !! is packaged in a psb_c_coo_sparse_mat object
! Default implementation at base level !!
! in terms of (derived) GETROW !! \param imin the minimum row index we are interested in
!! \param imax the minimum row index we are interested in
!! \param b the output (sub)matrix
!! \param info return code
!! \param jmin [1] minimum col index
!! \param jmax [a\%get_ncols()] maximum col index
!! \param iren(:) [none] an array to return renumbered indices (iren(ia(:)),iren(ja(:))
!! \param rscale [false] map [min(ia(:)):max(ia(:))] onto [1:max(ia(:))-min(ia(:))+1]
!! \param cscale [false] map [min(ja(:)):max(ja(:))] onto [1:max(ja(:))-min(ja(:))+1]
!! ( iren cannot be specified with rscale/cscale)
!! \param append [false] append to ia,ja
!! \param nzin [none] if append, then first new entry should go in entry nzin+1
!!
! !
interface interface
subroutine psb_c_base_csgetblk(imin,imax,a,b,info,& subroutine psb_c_base_csgetblk(imin,imax,a,b,info,&
@ -296,12 +342,26 @@ module psb_c_base_mat_mod
end interface end interface
! !
! CLIP: extract a subset
! B(:,:) = A(imin:imax,jmin:jmax)
! control: rscale,cscale as in getblk above.
! !
! Default implementation at base level in terms of !> Function csclip:
! GETBLK. !! \brief Get a submatrix.
!!
!! csclip is practically identical to getblk.
!! One of them has to go away.....
!!
!! \param b the output submatrix
!! \param info return code
!! \param imin [1] the minimum row index we are interested in
!! \param imax [a%get_nrows()] the minimum row index we are interested in
!! \param jmin [1] minimum col index
!! \param jmax [a\%get_ncols()] maximum col index
!! \param iren(:) [none] an array to return renumbered indices (iren(ia(:)),iren(ja(:))
!! \param rscale [false] map [min(ia(:)):max(ia(:))] onto [1:max(ia(:))-min(ia(:))+1]
!! \param cscale [false] map [min(ja(:)):max(ja(:))] onto [1:max(ja(:))-min(ja(:))+1]
!! ( iren cannot be specified with rscale/cscale)
!! \param append [false] append to ia,ja
!! \param nzin [none] if append, then first new entry should go in entry nzin+1
!!
! !
interface interface
subroutine psb_c_base_csclip(a,b,info,& subroutine psb_c_base_csclip(a,b,info,&
@ -316,9 +376,13 @@ module psb_c_base_mat_mod
end interface end interface
! !
! GET_DIAG method !> Function get_diag:
! !! \brief Extract the diagonal of A.
! D(i) = A(i:i), i=1:min(nrows,ncols) !!
!! D(i) = A(i:i), i=1:min(nrows,ncols)
!!
!! \param d(:) The output diagonal
!! \param info return code.
! !
interface interface
subroutine psb_c_base_get_diag(a,d,info) subroutine psb_c_base_get_diag(a,d,info)
@ -330,10 +394,13 @@ module psb_c_base_mat_mod
end interface end interface
! !
! MOLD: make B have the same dinamyc type !> Function mold:
! as A. !! \brief Allocate a class(psb_c_base_sparse_mat) with the
! For compilers not supporting !! same dynamic type as the input.
! allocate( mold= ) !! This is equivalent to allocate( mold= ) and is provided
!! for those compilers not yet supporting mold.
!! \param b The output variable
!! \param info return code
! !
interface interface
subroutine psb_c_base_mold(a,b,info) subroutine psb_c_base_mold(a,b,info)
@ -346,16 +413,11 @@ module psb_c_base_mat_mod
! !
! These are the methods implementing the MEDIATOR pattern !> Function cp_to_coo:
! to allow switch between arbitrary. !! \brief Copy and convert to psb_c_coo_sparse_mat
! Indeed, the TO/FROM FMT can be implemented at the base level !! Invoked from the source object.
! in terms of the TO/FROM COO per the MEDIATOR design pattern. !! \param b The output variable
! This does not prevent most of the derived classes to !! \param info return code
! provide their own versions with shortcuts.
! A%{MV|CP}_{TO|FROM}_{FMT|COO}
! MV|CP: copy versus move, i.e. deallocate
! TO|FROM: invoked from source or target object
!
! !
interface interface
subroutine psb_c_base_cp_to_coo(a,b,info) subroutine psb_c_base_cp_to_coo(a,b,info)
@ -366,6 +428,13 @@ module psb_c_base_mat_mod
end subroutine psb_c_base_cp_to_coo end subroutine psb_c_base_cp_to_coo
end interface end interface
!
!> Function cp_from_coo:
!! \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 interface
subroutine psb_c_base_cp_from_coo(a,b,info) subroutine psb_c_base_cp_from_coo(a,b,info)
import :: psb_ipk_, psb_c_base_sparse_mat, psb_c_coo_sparse_mat, psb_spk_ import :: psb_ipk_, psb_c_base_sparse_mat, psb_c_coo_sparse_mat, psb_spk_
@ -375,6 +444,14 @@ module psb_c_base_mat_mod
end subroutine psb_c_base_cp_from_coo end subroutine psb_c_base_cp_from_coo
end interface end interface
!
!> Function cp_to_fmt:
!! \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 interface
subroutine psb_c_base_cp_to_fmt(a,b,info) subroutine psb_c_base_cp_to_fmt(a,b,info)
import :: psb_ipk_, psb_c_base_sparse_mat, psb_spk_ import :: psb_ipk_, psb_c_base_sparse_mat, psb_spk_
@ -384,6 +461,14 @@ module psb_c_base_mat_mod
end subroutine psb_c_base_cp_to_fmt end subroutine psb_c_base_cp_to_fmt
end interface end interface
!
!> Function cp_from_fmt:
!! \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 interface
subroutine psb_c_base_cp_from_fmt(a,b,info) subroutine psb_c_base_cp_from_fmt(a,b,info)
import :: psb_ipk_, psb_c_base_sparse_mat, psb_spk_ import :: psb_ipk_, psb_c_base_sparse_mat, psb_spk_
@ -393,6 +478,13 @@ module psb_c_base_mat_mod
end subroutine psb_c_base_cp_from_fmt end subroutine psb_c_base_cp_from_fmt
end interface end interface
!
!> Function mv_to_coo:
!! \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 interface
subroutine psb_c_base_mv_to_coo(a,b,info) subroutine psb_c_base_mv_to_coo(a,b,info)
import :: psb_ipk_, psb_c_base_sparse_mat, psb_c_coo_sparse_mat, psb_spk_ import :: psb_ipk_, psb_c_base_sparse_mat, psb_c_coo_sparse_mat, psb_spk_
@ -402,6 +494,13 @@ module psb_c_base_mat_mod
end subroutine psb_c_base_mv_to_coo end subroutine psb_c_base_mv_to_coo
end interface end interface
!
!> Function mv_from_coo:
!! \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 interface
subroutine psb_c_base_mv_from_coo(a,b,info) subroutine psb_c_base_mv_from_coo(a,b,info)
import :: psb_ipk_, psb_c_base_sparse_mat, psb_c_coo_sparse_mat, psb_spk_ import :: psb_ipk_, psb_c_base_sparse_mat, psb_c_coo_sparse_mat, psb_spk_
@ -411,6 +510,14 @@ module psb_c_base_mat_mod
end subroutine psb_c_base_mv_from_coo end subroutine psb_c_base_mv_from_coo
end interface end interface
!
!> Function mv_to_fmt:
!! \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 interface
subroutine psb_c_base_mv_to_fmt(a,b,info) subroutine psb_c_base_mv_to_fmt(a,b,info)
import :: psb_ipk_, psb_c_base_sparse_mat, psb_spk_ import :: psb_ipk_, psb_c_base_sparse_mat, psb_spk_
@ -420,6 +527,14 @@ module psb_c_base_mat_mod
end subroutine psb_c_base_mv_to_fmt end subroutine psb_c_base_mv_to_fmt
end interface end interface
!
!> Function mv_from_fmt:
!! \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 interface
subroutine psb_c_base_mv_from_fmt(a,b,info) subroutine psb_c_base_mv_from_fmt(a,b,info)
import :: psb_ipk_, psb_c_base_sparse_mat, psb_spk_ import :: psb_ipk_, psb_c_base_sparse_mat, psb_spk_
@ -430,11 +545,13 @@ module psb_c_base_mat_mod
end interface end interface
! !
! Transpose methods. !> Function transp:
! You can always default to COO to do the actual !! \brief Transpose. Can always be implemented by staging through a COO
! transpose work. !! temporary for which transpose is very easy.
!! Copyout version
!! \param b The output variable
! !
interface interface
subroutine psb_c_base_transp_2mat(a,b) subroutine psb_c_base_transp_2mat(a,b)
import :: psb_ipk_, psb_c_base_sparse_mat, psb_base_sparse_mat, psb_spk_ import :: psb_ipk_, psb_c_base_sparse_mat, psb_base_sparse_mat, psb_spk_
class(psb_c_base_sparse_mat), intent(in) :: a class(psb_c_base_sparse_mat), intent(in) :: a
@ -442,6 +559,13 @@ module psb_c_base_mat_mod
end subroutine psb_c_base_transp_2mat end subroutine psb_c_base_transp_2mat
end interface end interface
!
!> Function transc:
!! \brief Conjugate Transpose. Can always be implemented by staging through a COO
!! temporary for which transpose is very easy.
!! Copyout version.
!! \param b The output variable
!
interface interface
subroutine psb_c_base_transc_2mat(a,b) subroutine psb_c_base_transc_2mat(a,b)
import :: psb_ipk_, psb_c_base_sparse_mat, psb_base_sparse_mat, psb_spk_ import :: psb_ipk_, psb_c_base_sparse_mat, psb_base_sparse_mat, psb_spk_
@ -450,6 +574,12 @@ module psb_c_base_mat_mod
end subroutine psb_c_base_transc_2mat end subroutine psb_c_base_transc_2mat
end interface end interface
!
!> Function transp:
!! \brief Transpose. Can always be implemented by staging through a COO
!! temporary for which transpose is very easy.
!! In-place version.
!
interface interface
subroutine psb_c_base_transp_1mat(a) subroutine psb_c_base_transp_1mat(a)
import :: psb_ipk_, psb_c_base_sparse_mat, psb_spk_ import :: psb_ipk_, psb_c_base_sparse_mat, psb_spk_
@ -457,6 +587,12 @@ module psb_c_base_mat_mod
end subroutine psb_c_base_transp_1mat end subroutine psb_c_base_transp_1mat
end interface end interface
!
!> Function transc:
!! \brief Conjugate Transpose. Can always be implemented by staging through a COO
!! temporary for which transpose is very easy.
!! In-place version.
!
interface interface
subroutine psb_c_base_transc_1mat(a) subroutine psb_c_base_transc_1mat(a)
import :: psb_ipk_, psb_c_base_sparse_mat, psb_spk_ import :: psb_ipk_, psb_c_base_sparse_mat, psb_spk_
@ -685,6 +821,10 @@ module psb_c_base_mat_mod
! !
! == =============== ! == ===============
!
!>
!! \see psb_base_mat_mod::psb_base_reallocate_nz
!
interface interface
subroutine psb_c_coo_reallocate_nz(nz,a) subroutine psb_c_coo_reallocate_nz(nz,a)
import :: psb_ipk_, psb_c_coo_sparse_mat import :: psb_ipk_, psb_c_coo_sparse_mat

@ -39,9 +39,8 @@ module psb_d_base_mat_mod
!> \namespace psb_base_mod \class psb_d_base_sparse_mat !> \namespace psb_base_mod \class psb_d_base_sparse_mat
!! \extends psb_base_mod::psb_base_sparse_mat !! \extends psb_base_mod::psb_base_sparse_mat
!! This module contains the definition of the psb_d_base_sparse_mat !! The psb_d_base_sparse_mat type, extending psb_base_sparse_mat,
!! type, extending the psb_base_sparse_mat to define a middle !! defines a middle level real(psb_dpk_) sparse matrix object.
!! level real(psb_dpk_) sparse matrix object.
!! This class object itself does not have any additional members !! This class object itself does not have any additional members
!! with respect to those of the base class. No methods can be fully !! with respect to those of the base class. No methods can be fully
!! implemented at this level, but we can define the interface for the !! implemented at this level, but we can define the interface for the
@ -49,13 +48,6 @@ module psb_d_base_mat_mod
!! field, such as the matrix-vector product; this interface is defined, !! field, such as the matrix-vector product; this interface is defined,
!! but is supposed to be overridden at the leaf level. !! but is supposed to be overridden at the leaf level.
!! !!
!! This module also contains the definition of the
!! psb_d_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.
!!
!! About the method MOLD: this has been defined for those compilers !! About the method MOLD: this has been defined for those compilers
!! not yet supporting ALLOCATE( ...,MOLD=...); it's otherwise silly to !! not yet supporting ALLOCATE( ...,MOLD=...); it's otherwise silly to
!! duplicate "by hand" what is specified in the language (in this case F2008) !! duplicate "by hand" what is specified in the language (in this case F2008)
@ -123,10 +115,23 @@ module psb_d_base_mat_mod
private :: d_base_cp_from, d_base_mv_from private :: d_base_cp_from, d_base_mv_from
!> \namespace psb_base_mod \class psb_d_base_sparse_mat
!! \extends psb_base_mod::psb_base_sparse_mat
!!
!! psb_d_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_d_base_sparse_mat) :: psb_d_coo_sparse_mat type, extends(psb_d_base_sparse_mat) :: psb_d_coo_sparse_mat
!> Number of nonzeros.
integer(psb_ipk_) :: nnz integer(psb_ipk_) :: nnz
integer(psb_ipk_), allocatable :: ia(:), ja(:) !> Row indices.
integer(psb_ipk_), allocatable :: ia(:)
!> Column indices.
integer(psb_ipk_), allocatable :: ja(:)
!> Coefficient values.
real(psb_dpk_), allocatable :: val(:) real(psb_dpk_), allocatable :: val(:)
contains contains
@ -206,20 +211,40 @@ module psb_d_base_mat_mod
! !
! == ================= ! == =================
! !> Function csput:
! CSPUT: Hand over a set of values to A. !! \brief Insert coefficients.
! Simple description: !!
! A(IA(1:nz),JA(1:nz)) = VAL(1:NZ) !!
! !! Given a list of NZ triples
! Catches: !! (IA(i),JA(i),VAL(i))
! 1. If A is in the BUILD state, then this method !! record a new coefficient in A such that
! can only be called for COO matrice, in which case it !! A(IA(1:nz),JA(1:nz)) = VAL(1:NZ).
! is more like queueing coefficients for later processing; !!
! 2. If A is in the UPDATE state, then every derived class must !! The internal components IA,JA,VAL are reallocated as necessary.
! implement it; !! Constraints:
! 3. In the UPDATE state, depending on the value of DUPL flag !! - If the matrix A is in the BUILD state, then the method will
! inside A, it will be A=VAL or A = A + VAL !! only work for COO matrices, all other format will throw an error.
! !! In this case coefficients are queued inside A for further processing.
!! - If the matrix A is in the UPDATE state, then it can be in any format;
!! the update operation will perform either
!! A(IA(1:nz),JA(1:nz)) = VAL(1:NZ)
!! or
!! A(IA(1:nz),JA(1:nz)) = A(IA(1:nz),JA(1:nz))+VAL(1:NZ)
!! according to the value of DUPLICATE.
!! - Coefficients with (IA(I),JA(I)) outside the ranges specified by
!! IMIN:IMAX,JMIN:JMAX will be ignored.
!!
!! \param nz number of triples in input
!! \param ia(:) the input row indices
!! \param ja(:) the input col indices
!! \param val(:) the input coefficients
!! \param imin minimum row index
!! \param imax maximum row index
!! \param jmin minimum col index
!! \param jmax maximum col index
!! \param info return code
!! \param gtl(:) [none] an array to renumber indices (iren(ia(:)),iren(ja(:))
!!
! !
interface interface
subroutine psb_d_base_csput(nz,ia,ja,val,a,imin,imax,jmin,jmax,info,gtl) subroutine psb_d_base_csput(nz,ia,ja,val,a,imin,imax,jmin,jmax,info,gtl)
@ -233,27 +258,36 @@ module psb_d_base_mat_mod
end interface end interface
! !
! CSGET methods: getrow, getblk, clip.
! getrow is the basic method, the other two are
! basically convenient wrappers/shorthand.
!
! out(:) = A(imin:imax,:)
!
! The two methods differ on the output format
! !
! GETROW returns as the set !> Function csgetrow:
! NZ, IA(1:nz), JA(1:nz), VAL(1:NZ) !! \brief Get a (subset of) row(s)
! !!
! Optional arguments: !! getrow is the basic method by which the other (getblk, clip) can
! JMIN,JMAX: get A(IMIN:IMAX,JMIN:JMAX), !! be implemented.
! default 1:ncols !!
! APPEND: append at the end of data, in which case !! Returns the set
! # used entries must be in NZ !! NZ, IA(1:nz), JA(1:nz), VAL(1:NZ)
! RSCALE, CSCALE: scale output indices at base 1. !! each identifying the position of a nonzero in A
! !! between row indices IMIN:IMAX;
! GETROW must be overridden by all data formats. !! IA,JA are reallocated as necessary.
!!
!! \param imin the minimum row index we are interested in
!! \param imax the minimum row index we are interested in
!! \param nz the number of output coefficients
!! \param ia(:) the output row indices
!! \param ja(:) the output col indices
!! \param val(:) the output coefficients
!! \param info return code
!! \param jmin [1] minimum col index
!! \param jmax [a\%get_ncols()] maximum col index
!! \param iren(:) [none] an array to return renumbered indices (iren(ia(:)),iren(ja(:))
!! \param rscale [false] map [min(ia(:)):max(ia(:))] onto [1:max(ia(:))-min(ia(:))+1]
!! \param cscale [false] map [min(ja(:)):max(ja(:))] onto [1:max(ja(:))-min(ja(:))+1]
!! ( iren cannot be specified with rscale/cscale)
!! \param append [false] append to ia,ja
!! \param nzin [none] if append, then first new entry should go in entry nzin+1
!!
! !
interface interface
subroutine psb_d_base_csgetrow(imin,imax,a,nz,ia,ja,val,info,& subroutine psb_d_base_csgetrow(imin,imax,a,nz,ia,ja,val,info,&
& jmin,jmax,iren,append,nzin,rscale,cscale) & jmin,jmax,iren,append,nzin,rscale,cscale)
@ -272,13 +306,25 @@ module psb_d_base_mat_mod
end interface end interface
! !
! CSGET methods: getrow, getblk. !> Function csgetblk:
! out(:) = A(imin:imax,:) !! \brief Get a (subset of) row(s)
! !!
! GETBLK returns a pbs_d_coo_sparse_mat with !! getblk is very similar to getrow, except that the output
! the same contents. !! is packaged in a psb_d_coo_sparse_mat object
! Default implementation at base level !!
! in terms of (derived) GETROW !! \param imin the minimum row index we are interested in
!! \param imax the minimum row index we are interested in
!! \param b the output (sub)matrix
!! \param info return code
!! \param jmin [1] minimum col index
!! \param jmax [a\%get_ncols()] maximum col index
!! \param iren(:) [none] an array to return renumbered indices (iren(ia(:)),iren(ja(:))
!! \param rscale [false] map [min(ia(:)):max(ia(:))] onto [1:max(ia(:))-min(ia(:))+1]
!! \param cscale [false] map [min(ja(:)):max(ja(:))] onto [1:max(ja(:))-min(ja(:))+1]
!! ( iren cannot be specified with rscale/cscale)
!! \param append [false] append to ia,ja
!! \param nzin [none] if append, then first new entry should go in entry nzin+1
!!
! !
interface interface
subroutine psb_d_base_csgetblk(imin,imax,a,b,info,& subroutine psb_d_base_csgetblk(imin,imax,a,b,info,&
@ -296,12 +342,26 @@ module psb_d_base_mat_mod
end interface end interface
! !
! CLIP: extract a subset
! B(:,:) = A(imin:imax,jmin:jmax)
! control: rscale,cscale as in getblk above.
! !
! Default implementation at base level in terms of !> Function csclip:
! GETBLK. !! \brief Get a submatrix.
!!
!! csclip is practically identical to getblk.
!! One of them has to go away.....
!!
!! \param b the output submatrix
!! \param info return code
!! \param imin [1] the minimum row index we are interested in
!! \param imax [a%get_nrows()] the minimum row index we are interested in
!! \param jmin [1] minimum col index
!! \param jmax [a\%get_ncols()] maximum col index
!! \param iren(:) [none] an array to return renumbered indices (iren(ia(:)),iren(ja(:))
!! \param rscale [false] map [min(ia(:)):max(ia(:))] onto [1:max(ia(:))-min(ia(:))+1]
!! \param cscale [false] map [min(ja(:)):max(ja(:))] onto [1:max(ja(:))-min(ja(:))+1]
!! ( iren cannot be specified with rscale/cscale)
!! \param append [false] append to ia,ja
!! \param nzin [none] if append, then first new entry should go in entry nzin+1
!!
! !
interface interface
subroutine psb_d_base_csclip(a,b,info,& subroutine psb_d_base_csclip(a,b,info,&
@ -316,9 +376,13 @@ module psb_d_base_mat_mod
end interface end interface
! !
! GET_DIAG method !> Function get_diag:
! !! \brief Extract the diagonal of A.
! D(i) = A(i:i), i=1:min(nrows,ncols) !!
!! D(i) = A(i:i), i=1:min(nrows,ncols)
!!
!! \param d(:) The output diagonal
!! \param info return code.
! !
interface interface
subroutine psb_d_base_get_diag(a,d,info) subroutine psb_d_base_get_diag(a,d,info)
@ -330,10 +394,13 @@ module psb_d_base_mat_mod
end interface end interface
! !
! MOLD: make B have the same dinamyc type !> Function mold:
! as A. !! \brief Allocate a class(psb_d_base_sparse_mat) with the
! For compilers not supporting !! same dynamic type as the input.
! allocate( mold= ) !! This is equivalent to allocate( mold= ) and is provided
!! for those compilers not yet supporting mold.
!! \param b The output variable
!! \param info return code
! !
interface interface
subroutine psb_d_base_mold(a,b,info) subroutine psb_d_base_mold(a,b,info)
@ -346,16 +413,11 @@ module psb_d_base_mat_mod
! !
! These are the methods implementing the MEDIATOR pattern !> Function cp_to_coo:
! to allow switch between arbitrary. !! \brief Copy and convert to psb_d_coo_sparse_mat
! Indeed, the TO/FROM FMT can be implemented at the base level !! Invoked from the source object.
! in terms of the TO/FROM COO per the MEDIATOR design pattern. !! \param b The output variable
! This does not prevent most of the derived classes to !! \param info return code
! provide their own versions with shortcuts.
! A%{MV|CP}_{TO|FROM}_{FMT|COO}
! MV|CP: copy versus move, i.e. deallocate
! TO|FROM: invoked from source or target object
!
! !
interface interface
subroutine psb_d_base_cp_to_coo(a,b,info) subroutine psb_d_base_cp_to_coo(a,b,info)
@ -366,6 +428,13 @@ module psb_d_base_mat_mod
end subroutine psb_d_base_cp_to_coo end subroutine psb_d_base_cp_to_coo
end interface end interface
!
!> Function cp_from_coo:
!! \brief Copy and convert from psb_d_coo_sparse_mat
!! Invoked from the target object.
!! \param b The input variable
!! \param info return code
!
interface interface
subroutine psb_d_base_cp_from_coo(a,b,info) subroutine psb_d_base_cp_from_coo(a,b,info)
import :: psb_ipk_, psb_d_base_sparse_mat, psb_d_coo_sparse_mat, psb_dpk_ import :: psb_ipk_, psb_d_base_sparse_mat, psb_d_coo_sparse_mat, psb_dpk_
@ -375,6 +444,14 @@ module psb_d_base_mat_mod
end subroutine psb_d_base_cp_from_coo end subroutine psb_d_base_cp_from_coo
end interface end interface
!
!> Function cp_to_fmt:
!! \brief Copy and convert to a class(psb_d_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 interface
subroutine psb_d_base_cp_to_fmt(a,b,info) subroutine psb_d_base_cp_to_fmt(a,b,info)
import :: psb_ipk_, psb_d_base_sparse_mat, psb_dpk_ import :: psb_ipk_, psb_d_base_sparse_mat, psb_dpk_
@ -384,6 +461,14 @@ module psb_d_base_mat_mod
end subroutine psb_d_base_cp_to_fmt end subroutine psb_d_base_cp_to_fmt
end interface end interface
!
!> Function cp_from_fmt:
!! \brief Copy and convert from a class(psb_d_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 interface
subroutine psb_d_base_cp_from_fmt(a,b,info) subroutine psb_d_base_cp_from_fmt(a,b,info)
import :: psb_ipk_, psb_d_base_sparse_mat, psb_dpk_ import :: psb_ipk_, psb_d_base_sparse_mat, psb_dpk_
@ -393,6 +478,13 @@ module psb_d_base_mat_mod
end subroutine psb_d_base_cp_from_fmt end subroutine psb_d_base_cp_from_fmt
end interface end interface
!
!> Function mv_to_coo:
!! \brief Convert to psb_d_coo_sparse_mat, freeing the source.
!! Invoked from the source object.
!! \param b The output variable
!! \param info return code
!
interface interface
subroutine psb_d_base_mv_to_coo(a,b,info) subroutine psb_d_base_mv_to_coo(a,b,info)
import :: psb_ipk_, psb_d_base_sparse_mat, psb_d_coo_sparse_mat, psb_dpk_ import :: psb_ipk_, psb_d_base_sparse_mat, psb_d_coo_sparse_mat, psb_dpk_
@ -402,6 +494,13 @@ module psb_d_base_mat_mod
end subroutine psb_d_base_mv_to_coo end subroutine psb_d_base_mv_to_coo
end interface end interface
!
!> Function mv_from_coo:
!! \brief Convert from psb_d_coo_sparse_mat, freeing the source.
!! Invoked from the target object.
!! \param b The input variable
!! \param info return code
!
interface interface
subroutine psb_d_base_mv_from_coo(a,b,info) subroutine psb_d_base_mv_from_coo(a,b,info)
import :: psb_ipk_, psb_d_base_sparse_mat, psb_d_coo_sparse_mat, psb_dpk_ import :: psb_ipk_, psb_d_base_sparse_mat, psb_d_coo_sparse_mat, psb_dpk_
@ -411,6 +510,14 @@ module psb_d_base_mat_mod
end subroutine psb_d_base_mv_from_coo end subroutine psb_d_base_mv_from_coo
end interface end interface
!
!> Function mv_to_fmt:
!! \brief Convert to a class(psb_d_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 interface
subroutine psb_d_base_mv_to_fmt(a,b,info) subroutine psb_d_base_mv_to_fmt(a,b,info)
import :: psb_ipk_, psb_d_base_sparse_mat, psb_dpk_ import :: psb_ipk_, psb_d_base_sparse_mat, psb_dpk_
@ -420,6 +527,14 @@ module psb_d_base_mat_mod
end subroutine psb_d_base_mv_to_fmt end subroutine psb_d_base_mv_to_fmt
end interface end interface
!
!> Function mv_from_fmt:
!! \brief Convert from a class(psb_d_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 interface
subroutine psb_d_base_mv_from_fmt(a,b,info) subroutine psb_d_base_mv_from_fmt(a,b,info)
import :: psb_ipk_, psb_d_base_sparse_mat, psb_dpk_ import :: psb_ipk_, psb_d_base_sparse_mat, psb_dpk_
@ -430,11 +545,13 @@ module psb_d_base_mat_mod
end interface end interface
! !
! Transpose methods. !> Function transp:
! You can always default to COO to do the actual !! \brief Transpose. Can always be implemented by staging through a COO
! transpose work. !! temporary for which transpose is very easy.
!! Copyout version
!! \param b The output variable
! !
interface interface
subroutine psb_d_base_transp_2mat(a,b) subroutine psb_d_base_transp_2mat(a,b)
import :: psb_ipk_, psb_d_base_sparse_mat, psb_base_sparse_mat, psb_dpk_ import :: psb_ipk_, psb_d_base_sparse_mat, psb_base_sparse_mat, psb_dpk_
class(psb_d_base_sparse_mat), intent(in) :: a class(psb_d_base_sparse_mat), intent(in) :: a
@ -442,6 +559,13 @@ module psb_d_base_mat_mod
end subroutine psb_d_base_transp_2mat end subroutine psb_d_base_transp_2mat
end interface end interface
!
!> Function transc:
!! \brief Conjugate Transpose. Can always be implemented by staging through a COO
!! temporary for which transpose is very easy.
!! Copyout version.
!! \param b The output variable
!
interface interface
subroutine psb_d_base_transc_2mat(a,b) subroutine psb_d_base_transc_2mat(a,b)
import :: psb_ipk_, psb_d_base_sparse_mat, psb_base_sparse_mat, psb_dpk_ import :: psb_ipk_, psb_d_base_sparse_mat, psb_base_sparse_mat, psb_dpk_
@ -450,6 +574,12 @@ module psb_d_base_mat_mod
end subroutine psb_d_base_transc_2mat end subroutine psb_d_base_transc_2mat
end interface end interface
!
!> Function transp:
!! \brief Transpose. Can always be implemented by staging through a COO
!! temporary for which transpose is very easy.
!! In-place version.
!
interface interface
subroutine psb_d_base_transp_1mat(a) subroutine psb_d_base_transp_1mat(a)
import :: psb_ipk_, psb_d_base_sparse_mat, psb_dpk_ import :: psb_ipk_, psb_d_base_sparse_mat, psb_dpk_
@ -457,6 +587,12 @@ module psb_d_base_mat_mod
end subroutine psb_d_base_transp_1mat end subroutine psb_d_base_transp_1mat
end interface end interface
!
!> Function transc:
!! \brief Conjugate Transpose. Can always be implemented by staging through a COO
!! temporary for which transpose is very easy.
!! In-place version.
!
interface interface
subroutine psb_d_base_transc_1mat(a) subroutine psb_d_base_transc_1mat(a)
import :: psb_ipk_, psb_d_base_sparse_mat, psb_dpk_ import :: psb_ipk_, psb_d_base_sparse_mat, psb_dpk_
@ -685,6 +821,10 @@ module psb_d_base_mat_mod
! !
! == =============== ! == ===============
!
!>
!! \see psb_base_mat_mod::psb_base_reallocate_nz
!
interface interface
subroutine psb_d_coo_reallocate_nz(nz,a) subroutine psb_d_coo_reallocate_nz(nz,a)
import :: psb_ipk_, psb_d_coo_sparse_mat import :: psb_ipk_, psb_d_coo_sparse_mat

@ -39,9 +39,8 @@ module psb_s_base_mat_mod
!> \namespace psb_base_mod \class psb_s_base_sparse_mat !> \namespace psb_base_mod \class psb_s_base_sparse_mat
!! \extends psb_base_mod::psb_base_sparse_mat !! \extends psb_base_mod::psb_base_sparse_mat
!! This module contains the definition of the psb_s_base_sparse_mat !! The psb_s_base_sparse_mat type, extending psb_base_sparse_mat,
!! type, extending the psb_base_sparse_mat to define a middle !! defines a middle level real(psb_spk_) sparse matrix object.
!! level real(psb_spk_) sparse matrix object.
!! This class object itself does not have any additional members !! This class object itself does not have any additional members
!! with respect to those of the base class. No methods can be fully !! with respect to those of the base class. No methods can be fully
!! implemented at this level, but we can define the interface for the !! implemented at this level, but we can define the interface for the
@ -49,13 +48,6 @@ module psb_s_base_mat_mod
!! field, such as the matrix-vector product; this interface is defined, !! field, such as the matrix-vector product; this interface is defined,
!! but is supposed to be overridden at the leaf level. !! but is supposed to be overridden at the leaf level.
!! !!
!! This module also contains the definition of the
!! psb_s_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.
!!
!! About the method MOLD: this has been defined for those compilers !! About the method MOLD: this has been defined for those compilers
!! not yet supporting ALLOCATE( ...,MOLD=...); it's otherwise silly to !! not yet supporting ALLOCATE( ...,MOLD=...); it's otherwise silly to
!! duplicate "by hand" what is specified in the language (in this case F2008) !! duplicate "by hand" what is specified in the language (in this case F2008)
@ -123,10 +115,23 @@ module psb_s_base_mat_mod
private :: s_base_cp_from, s_base_mv_from private :: s_base_cp_from, s_base_mv_from
!> \namespace psb_base_mod \class psb_s_base_sparse_mat
!! \extends psb_base_mod::psb_base_sparse_mat
!!
!! psb_s_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_s_base_sparse_mat) :: psb_s_coo_sparse_mat type, extends(psb_s_base_sparse_mat) :: psb_s_coo_sparse_mat
!> Number of nonzeros.
integer(psb_ipk_) :: nnz integer(psb_ipk_) :: nnz
integer(psb_ipk_), allocatable :: ia(:), ja(:) !> Row indices.
integer(psb_ipk_), allocatable :: ia(:)
!> Column indices.
integer(psb_ipk_), allocatable :: ja(:)
!> Coefficient values.
real(psb_spk_), allocatable :: val(:) real(psb_spk_), allocatable :: val(:)
contains contains
@ -206,20 +211,40 @@ module psb_s_base_mat_mod
! !
! == ================= ! == =================
! !> Function csput:
! CSPUT: Hand over a set of values to A. !! \brief Insert coefficients.
! Simple description: !!
! A(IA(1:nz),JA(1:nz)) = VAL(1:NZ) !!
! !! Given a list of NZ triples
! Catches: !! (IA(i),JA(i),VAL(i))
! 1. If A is in the BUILD state, then this method !! record a new coefficient in A such that
! can only be called for COO matrice, in which case it !! A(IA(1:nz),JA(1:nz)) = VAL(1:NZ).
! is more like queueing coefficients for later processing; !!
! 2. If A is in the UPDATE state, then every derived class must !! The internal components IA,JA,VAL are reallocated as necessary.
! implement it; !! Constraints:
! 3. In the UPDATE state, depending on the value of DUPL flag !! - If the matrix A is in the BUILD state, then the method will
! inside A, it will be A=VAL or A = A + VAL !! only work for COO matrices, all other format will throw an error.
! !! In this case coefficients are queued inside A for further processing.
!! - If the matrix A is in the UPDATE state, then it can be in any format;
!! the update operation will perform either
!! A(IA(1:nz),JA(1:nz)) = VAL(1:NZ)
!! or
!! A(IA(1:nz),JA(1:nz)) = A(IA(1:nz),JA(1:nz))+VAL(1:NZ)
!! according to the value of DUPLICATE.
!! - Coefficients with (IA(I),JA(I)) outside the ranges specified by
!! IMIN:IMAX,JMIN:JMAX will be ignored.
!!
!! \param nz number of triples in input
!! \param ia(:) the input row indices
!! \param ja(:) the input col indices
!! \param val(:) the input coefficients
!! \param imin minimum row index
!! \param imax maximum row index
!! \param jmin minimum col index
!! \param jmax maximum col index
!! \param info return code
!! \param gtl(:) [none] an array to renumber indices (iren(ia(:)),iren(ja(:))
!!
! !
interface interface
subroutine psb_s_base_csput(nz,ia,ja,val,a,imin,imax,jmin,jmax,info,gtl) subroutine psb_s_base_csput(nz,ia,ja,val,a,imin,imax,jmin,jmax,info,gtl)
@ -233,27 +258,36 @@ module psb_s_base_mat_mod
end interface end interface
! !
! CSGET methods: getrow, getblk, clip.
! getrow is the basic method, the other two are
! basically convenient wrappers/shorthand.
!
! out(:) = A(imin:imax,:)
!
! The two methods differ on the output format
! !
! GETROW returns as the set !> Function csgetrow:
! NZ, IA(1:nz), JA(1:nz), VAL(1:NZ) !! \brief Get a (subset of) row(s)
! !!
! Optional arguments: !! getrow is the basic method by which the other (getblk, clip) can
! JMIN,JMAX: get A(IMIN:IMAX,JMIN:JMAX), !! be implemented.
! default 1:ncols !!
! APPEND: append at the end of data, in which case !! Returns the set
! # used entries must be in NZ !! NZ, IA(1:nz), JA(1:nz), VAL(1:NZ)
! RSCALE, CSCALE: scale output indices at base 1. !! each identifying the position of a nonzero in A
! !! between row indices IMIN:IMAX;
! GETROW must be overridden by all data formats. !! IA,JA are reallocated as necessary.
!!
!! \param imin the minimum row index we are interested in
!! \param imax the minimum row index we are interested in
!! \param nz the number of output coefficients
!! \param ia(:) the output row indices
!! \param ja(:) the output col indices
!! \param val(:) the output coefficients
!! \param info return code
!! \param jmin [1] minimum col index
!! \param jmax [a\%get_ncols()] maximum col index
!! \param iren(:) [none] an array to return renumbered indices (iren(ia(:)),iren(ja(:))
!! \param rscale [false] map [min(ia(:)):max(ia(:))] onto [1:max(ia(:))-min(ia(:))+1]
!! \param cscale [false] map [min(ja(:)):max(ja(:))] onto [1:max(ja(:))-min(ja(:))+1]
!! ( iren cannot be specified with rscale/cscale)
!! \param append [false] append to ia,ja
!! \param nzin [none] if append, then first new entry should go in entry nzin+1
!!
! !
interface interface
subroutine psb_s_base_csgetrow(imin,imax,a,nz,ia,ja,val,info,& subroutine psb_s_base_csgetrow(imin,imax,a,nz,ia,ja,val,info,&
& jmin,jmax,iren,append,nzin,rscale,cscale) & jmin,jmax,iren,append,nzin,rscale,cscale)
@ -272,13 +306,25 @@ module psb_s_base_mat_mod
end interface end interface
! !
! CSGET methods: getrow, getblk. !> Function csgetblk:
! out(:) = A(imin:imax,:) !! \brief Get a (subset of) row(s)
! !!
! GETBLK returns a pbs_s_coo_sparse_mat with !! getblk is very similar to getrow, except that the output
! the same contents. !! is packaged in a psb_s_coo_sparse_mat object
! Default implementation at base level !!
! in terms of (derived) GETROW !! \param imin the minimum row index we are interested in
!! \param imax the minimum row index we are interested in
!! \param b the output (sub)matrix
!! \param info return code
!! \param jmin [1] minimum col index
!! \param jmax [a\%get_ncols()] maximum col index
!! \param iren(:) [none] an array to return renumbered indices (iren(ia(:)),iren(ja(:))
!! \param rscale [false] map [min(ia(:)):max(ia(:))] onto [1:max(ia(:))-min(ia(:))+1]
!! \param cscale [false] map [min(ja(:)):max(ja(:))] onto [1:max(ja(:))-min(ja(:))+1]
!! ( iren cannot be specified with rscale/cscale)
!! \param append [false] append to ia,ja
!! \param nzin [none] if append, then first new entry should go in entry nzin+1
!!
! !
interface interface
subroutine psb_s_base_csgetblk(imin,imax,a,b,info,& subroutine psb_s_base_csgetblk(imin,imax,a,b,info,&
@ -296,12 +342,26 @@ module psb_s_base_mat_mod
end interface end interface
! !
! CLIP: extract a subset
! B(:,:) = A(imin:imax,jmin:jmax)
! control: rscale,cscale as in getblk above.
! !
! Default implementation at base level in terms of !> Function csclip:
! GETBLK. !! \brief Get a submatrix.
!!
!! csclip is practically identical to getblk.
!! One of them has to go away.....
!!
!! \param b the output submatrix
!! \param info return code
!! \param imin [1] the minimum row index we are interested in
!! \param imax [a%get_nrows()] the minimum row index we are interested in
!! \param jmin [1] minimum col index
!! \param jmax [a\%get_ncols()] maximum col index
!! \param iren(:) [none] an array to return renumbered indices (iren(ia(:)),iren(ja(:))
!! \param rscale [false] map [min(ia(:)):max(ia(:))] onto [1:max(ia(:))-min(ia(:))+1]
!! \param cscale [false] map [min(ja(:)):max(ja(:))] onto [1:max(ja(:))-min(ja(:))+1]
!! ( iren cannot be specified with rscale/cscale)
!! \param append [false] append to ia,ja
!! \param nzin [none] if append, then first new entry should go in entry nzin+1
!!
! !
interface interface
subroutine psb_s_base_csclip(a,b,info,& subroutine psb_s_base_csclip(a,b,info,&
@ -316,9 +376,13 @@ module psb_s_base_mat_mod
end interface end interface
! !
! GET_DIAG method !> Function get_diag:
! !! \brief Extract the diagonal of A.
! D(i) = A(i:i), i=1:min(nrows,ncols) !!
!! D(i) = A(i:i), i=1:min(nrows,ncols)
!!
!! \param d(:) The output diagonal
!! \param info return code.
! !
interface interface
subroutine psb_s_base_get_diag(a,d,info) subroutine psb_s_base_get_diag(a,d,info)
@ -330,10 +394,13 @@ module psb_s_base_mat_mod
end interface end interface
! !
! MOLD: make B have the same dinamyc type !> Function mold:
! as A. !! \brief Allocate a class(psb_s_base_sparse_mat) with the
! For compilers not supporting !! same dynamic type as the input.
! allocate( mold= ) !! This is equivalent to allocate( mold= ) and is provided
!! for those compilers not yet supporting mold.
!! \param b The output variable
!! \param info return code
! !
interface interface
subroutine psb_s_base_mold(a,b,info) subroutine psb_s_base_mold(a,b,info)
@ -346,16 +413,11 @@ module psb_s_base_mat_mod
! !
! These are the methods implementing the MEDIATOR pattern !> Function cp_to_coo:
! to allow switch between arbitrary. !! \brief Copy and convert to psb_s_coo_sparse_mat
! Indeed, the TO/FROM FMT can be implemented at the base level !! Invoked from the source object.
! in terms of the TO/FROM COO per the MEDIATOR design pattern. !! \param b The output variable
! This does not prevent most of the derived classes to !! \param info return code
! provide their own versions with shortcuts.
! A%{MV|CP}_{TO|FROM}_{FMT|COO}
! MV|CP: copy versus move, i.e. deallocate
! TO|FROM: invoked from source or target object
!
! !
interface interface
subroutine psb_s_base_cp_to_coo(a,b,info) subroutine psb_s_base_cp_to_coo(a,b,info)
@ -366,6 +428,13 @@ module psb_s_base_mat_mod
end subroutine psb_s_base_cp_to_coo end subroutine psb_s_base_cp_to_coo
end interface end interface
!
!> Function cp_from_coo:
!! \brief Copy and convert from psb_s_coo_sparse_mat
!! Invoked from the target object.
!! \param b The input variable
!! \param info return code
!
interface interface
subroutine psb_s_base_cp_from_coo(a,b,info) subroutine psb_s_base_cp_from_coo(a,b,info)
import :: psb_ipk_, psb_s_base_sparse_mat, psb_s_coo_sparse_mat, psb_spk_ import :: psb_ipk_, psb_s_base_sparse_mat, psb_s_coo_sparse_mat, psb_spk_
@ -375,6 +444,14 @@ module psb_s_base_mat_mod
end subroutine psb_s_base_cp_from_coo end subroutine psb_s_base_cp_from_coo
end interface end interface
!
!> Function cp_to_fmt:
!! \brief Copy and convert to a class(psb_s_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 interface
subroutine psb_s_base_cp_to_fmt(a,b,info) subroutine psb_s_base_cp_to_fmt(a,b,info)
import :: psb_ipk_, psb_s_base_sparse_mat, psb_spk_ import :: psb_ipk_, psb_s_base_sparse_mat, psb_spk_
@ -384,6 +461,14 @@ module psb_s_base_mat_mod
end subroutine psb_s_base_cp_to_fmt end subroutine psb_s_base_cp_to_fmt
end interface end interface
!
!> Function cp_from_fmt:
!! \brief Copy and convert from a class(psb_s_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 interface
subroutine psb_s_base_cp_from_fmt(a,b,info) subroutine psb_s_base_cp_from_fmt(a,b,info)
import :: psb_ipk_, psb_s_base_sparse_mat, psb_spk_ import :: psb_ipk_, psb_s_base_sparse_mat, psb_spk_
@ -393,6 +478,13 @@ module psb_s_base_mat_mod
end subroutine psb_s_base_cp_from_fmt end subroutine psb_s_base_cp_from_fmt
end interface end interface
!
!> Function mv_to_coo:
!! \brief Convert to psb_s_coo_sparse_mat, freeing the source.
!! Invoked from the source object.
!! \param b The output variable
!! \param info return code
!
interface interface
subroutine psb_s_base_mv_to_coo(a,b,info) subroutine psb_s_base_mv_to_coo(a,b,info)
import :: psb_ipk_, psb_s_base_sparse_mat, psb_s_coo_sparse_mat, psb_spk_ import :: psb_ipk_, psb_s_base_sparse_mat, psb_s_coo_sparse_mat, psb_spk_
@ -402,6 +494,13 @@ module psb_s_base_mat_mod
end subroutine psb_s_base_mv_to_coo end subroutine psb_s_base_mv_to_coo
end interface end interface
!
!> Function mv_from_coo:
!! \brief Convert from psb_s_coo_sparse_mat, freeing the source.
!! Invoked from the target object.
!! \param b The input variable
!! \param info return code
!
interface interface
subroutine psb_s_base_mv_from_coo(a,b,info) subroutine psb_s_base_mv_from_coo(a,b,info)
import :: psb_ipk_, psb_s_base_sparse_mat, psb_s_coo_sparse_mat, psb_spk_ import :: psb_ipk_, psb_s_base_sparse_mat, psb_s_coo_sparse_mat, psb_spk_
@ -411,6 +510,14 @@ module psb_s_base_mat_mod
end subroutine psb_s_base_mv_from_coo end subroutine psb_s_base_mv_from_coo
end interface end interface
!
!> Function mv_to_fmt:
!! \brief Convert to a class(psb_s_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 interface
subroutine psb_s_base_mv_to_fmt(a,b,info) subroutine psb_s_base_mv_to_fmt(a,b,info)
import :: psb_ipk_, psb_s_base_sparse_mat, psb_spk_ import :: psb_ipk_, psb_s_base_sparse_mat, psb_spk_
@ -420,6 +527,14 @@ module psb_s_base_mat_mod
end subroutine psb_s_base_mv_to_fmt end subroutine psb_s_base_mv_to_fmt
end interface end interface
!
!> Function mv_from_fmt:
!! \brief Convert from a class(psb_s_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 interface
subroutine psb_s_base_mv_from_fmt(a,b,info) subroutine psb_s_base_mv_from_fmt(a,b,info)
import :: psb_ipk_, psb_s_base_sparse_mat, psb_spk_ import :: psb_ipk_, psb_s_base_sparse_mat, psb_spk_
@ -430,11 +545,13 @@ module psb_s_base_mat_mod
end interface end interface
! !
! Transpose methods. !> Function transp:
! You can always default to COO to do the actual !! \brief Transpose. Can always be implemented by staging through a COO
! transpose work. !! temporary for which transpose is very easy.
!! Copyout version
!! \param b The output variable
! !
interface interface
subroutine psb_s_base_transp_2mat(a,b) subroutine psb_s_base_transp_2mat(a,b)
import :: psb_ipk_, psb_s_base_sparse_mat, psb_base_sparse_mat, psb_spk_ import :: psb_ipk_, psb_s_base_sparse_mat, psb_base_sparse_mat, psb_spk_
class(psb_s_base_sparse_mat), intent(in) :: a class(psb_s_base_sparse_mat), intent(in) :: a
@ -442,6 +559,13 @@ module psb_s_base_mat_mod
end subroutine psb_s_base_transp_2mat end subroutine psb_s_base_transp_2mat
end interface end interface
!
!> Function transc:
!! \brief Conjugate Transpose. Can always be implemented by staging through a COO
!! temporary for which transpose is very easy.
!! Copyout version.
!! \param b The output variable
!
interface interface
subroutine psb_s_base_transc_2mat(a,b) subroutine psb_s_base_transc_2mat(a,b)
import :: psb_ipk_, psb_s_base_sparse_mat, psb_base_sparse_mat, psb_spk_ import :: psb_ipk_, psb_s_base_sparse_mat, psb_base_sparse_mat, psb_spk_
@ -450,6 +574,12 @@ module psb_s_base_mat_mod
end subroutine psb_s_base_transc_2mat end subroutine psb_s_base_transc_2mat
end interface end interface
!
!> Function transp:
!! \brief Transpose. Can always be implemented by staging through a COO
!! temporary for which transpose is very easy.
!! In-place version.
!
interface interface
subroutine psb_s_base_transp_1mat(a) subroutine psb_s_base_transp_1mat(a)
import :: psb_ipk_, psb_s_base_sparse_mat, psb_spk_ import :: psb_ipk_, psb_s_base_sparse_mat, psb_spk_
@ -457,6 +587,12 @@ module psb_s_base_mat_mod
end subroutine psb_s_base_transp_1mat end subroutine psb_s_base_transp_1mat
end interface end interface
!
!> Function transc:
!! \brief Conjugate Transpose. Can always be implemented by staging through a COO
!! temporary for which transpose is very easy.
!! In-place version.
!
interface interface
subroutine psb_s_base_transc_1mat(a) subroutine psb_s_base_transc_1mat(a)
import :: psb_ipk_, psb_s_base_sparse_mat, psb_spk_ import :: psb_ipk_, psb_s_base_sparse_mat, psb_spk_
@ -685,6 +821,10 @@ module psb_s_base_mat_mod
! !
! == =============== ! == ===============
!
!>
!! \see psb_base_mat_mod::psb_base_reallocate_nz
!
interface interface
subroutine psb_s_coo_reallocate_nz(nz,a) subroutine psb_s_coo_reallocate_nz(nz,a)
import :: psb_ipk_, psb_s_coo_sparse_mat import :: psb_ipk_, psb_s_coo_sparse_mat

@ -39,9 +39,8 @@ module psb_z_base_mat_mod
!> \namespace psb_base_mod \class psb_z_base_sparse_mat !> \namespace psb_base_mod \class psb_z_base_sparse_mat
!! \extends psb_base_mod::psb_base_sparse_mat !! \extends psb_base_mod::psb_base_sparse_mat
!! This module contains the definition of the psb_z_base_sparse_mat !! The psb_z_base_sparse_mat type, extending psb_base_sparse_mat,
!! type, extending the psb_base_sparse_mat to define a middle !! defines a middle level complex(psb_dpk_) sparse matrix object.
!! level complex(psb_dpk_) sparse matrix object.
!! This class object itself does not have any additional members !! This class object itself does not have any additional members
!! with respect to those of the base class. No methods can be fully !! with respect to those of the base class. No methods can be fully
!! implemented at this level, but we can define the interface for the !! implemented at this level, but we can define the interface for the
@ -49,13 +48,6 @@ module psb_z_base_mat_mod
!! field, such as the matrix-vector product; this interface is defined, !! field, such as the matrix-vector product; this interface is defined,
!! but is supposed to be overridden at the leaf level. !! but is supposed to be overridden at the leaf level.
!! !!
!! This module also contains the definition of the
!! psb_z_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.
!!
!! About the method MOLD: this has been defined for those compilers !! About the method MOLD: this has been defined for those compilers
!! not yet supporting ALLOCATE( ...,MOLD=...); it's otherwise silly to !! not yet supporting ALLOCATE( ...,MOLD=...); it's otherwise silly to
!! duplicate "by hand" what is specified in the language (in this case F2008) !! duplicate "by hand" what is specified in the language (in this case F2008)
@ -123,10 +115,23 @@ module psb_z_base_mat_mod
private :: z_base_cp_from, z_base_mv_from private :: z_base_cp_from, z_base_mv_from
!> \namespace psb_base_mod \class psb_z_base_sparse_mat
!! \extends psb_base_mod::psb_base_sparse_mat
!!
!! psb_z_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_z_base_sparse_mat) :: psb_z_coo_sparse_mat type, extends(psb_z_base_sparse_mat) :: psb_z_coo_sparse_mat
!> Number of nonzeros.
integer(psb_ipk_) :: nnz integer(psb_ipk_) :: nnz
integer(psb_ipk_), allocatable :: ia(:), ja(:) !> Row indices.
integer(psb_ipk_), allocatable :: ia(:)
!> Column indices.
integer(psb_ipk_), allocatable :: ja(:)
!> Coefficient values.
complex(psb_dpk_), allocatable :: val(:) complex(psb_dpk_), allocatable :: val(:)
contains contains
@ -206,20 +211,40 @@ module psb_z_base_mat_mod
! !
! == ================= ! == =================
! !> Function csput:
! CSPUT: Hand over a set of values to A. !! \brief Insert coefficients.
! Simple description: !!
! A(IA(1:nz),JA(1:nz)) = VAL(1:NZ) !!
! !! Given a list of NZ triples
! Catches: !! (IA(i),JA(i),VAL(i))
! 1. If A is in the BUILD state, then this method !! record a new coefficient in A such that
! can only be called for COO matrice, in which case it !! A(IA(1:nz),JA(1:nz)) = VAL(1:NZ).
! is more like queueing coefficients for later processing; !!
! 2. If A is in the UPDATE state, then every derived class must !! The internal components IA,JA,VAL are reallocated as necessary.
! implement it; !! Constraints:
! 3. In the UPDATE state, depending on the value of DUPL flag !! - If the matrix A is in the BUILD state, then the method will
! inside A, it will be A=VAL or A = A + VAL !! only work for COO matrices, all other format will throw an error.
! !! In this case coefficients are queued inside A for further processing.
!! - If the matrix A is in the UPDATE state, then it can be in any format;
!! the update operation will perform either
!! A(IA(1:nz),JA(1:nz)) = VAL(1:NZ)
!! or
!! A(IA(1:nz),JA(1:nz)) = A(IA(1:nz),JA(1:nz))+VAL(1:NZ)
!! according to the value of DUPLICATE.
!! - Coefficients with (IA(I),JA(I)) outside the ranges specified by
!! IMIN:IMAX,JMIN:JMAX will be ignored.
!!
!! \param nz number of triples in input
!! \param ia(:) the input row indices
!! \param ja(:) the input col indices
!! \param val(:) the input coefficients
!! \param imin minimum row index
!! \param imax maximum row index
!! \param jmin minimum col index
!! \param jmax maximum col index
!! \param info return code
!! \param gtl(:) [none] an array to renumber indices (iren(ia(:)),iren(ja(:))
!!
! !
interface interface
subroutine psb_z_base_csput(nz,ia,ja,val,a,imin,imax,jmin,jmax,info,gtl) subroutine psb_z_base_csput(nz,ia,ja,val,a,imin,imax,jmin,jmax,info,gtl)
@ -233,27 +258,36 @@ module psb_z_base_mat_mod
end interface end interface
! !
! CSGET methods: getrow, getblk, clip.
! getrow is the basic method, the other two are
! basically convenient wrappers/shorthand.
!
! out(:) = A(imin:imax,:)
!
! The two methods differ on the output format
! !
! GETROW returns as the set !> Function csgetrow:
! NZ, IA(1:nz), JA(1:nz), VAL(1:NZ) !! \brief Get a (subset of) row(s)
! !!
! Optional arguments: !! getrow is the basic method by which the other (getblk, clip) can
! JMIN,JMAX: get A(IMIN:IMAX,JMIN:JMAX), !! be implemented.
! default 1:ncols !!
! APPEND: append at the end of data, in which case !! Returns the set
! # used entries must be in NZ !! NZ, IA(1:nz), JA(1:nz), VAL(1:NZ)
! RSCALE, CSCALE: scale output indices at base 1. !! each identifying the position of a nonzero in A
! !! between row indices IMIN:IMAX;
! GETROW must be overridden by all data formats. !! IA,JA are reallocated as necessary.
!!
!! \param imin the minimum row index we are interested in
!! \param imax the minimum row index we are interested in
!! \param nz the number of output coefficients
!! \param ia(:) the output row indices
!! \param ja(:) the output col indices
!! \param val(:) the output coefficients
!! \param info return code
!! \param jmin [1] minimum col index
!! \param jmax [a\%get_ncols()] maximum col index
!! \param iren(:) [none] an array to return renumbered indices (iren(ia(:)),iren(ja(:))
!! \param rscale [false] map [min(ia(:)):max(ia(:))] onto [1:max(ia(:))-min(ia(:))+1]
!! \param cscale [false] map [min(ja(:)):max(ja(:))] onto [1:max(ja(:))-min(ja(:))+1]
!! ( iren cannot be specified with rscale/cscale)
!! \param append [false] append to ia,ja
!! \param nzin [none] if append, then first new entry should go in entry nzin+1
!!
! !
interface interface
subroutine psb_z_base_csgetrow(imin,imax,a,nz,ia,ja,val,info,& subroutine psb_z_base_csgetrow(imin,imax,a,nz,ia,ja,val,info,&
& jmin,jmax,iren,append,nzin,rscale,cscale) & jmin,jmax,iren,append,nzin,rscale,cscale)
@ -272,13 +306,25 @@ module psb_z_base_mat_mod
end interface end interface
! !
! CSGET methods: getrow, getblk. !> Function csgetblk:
! out(:) = A(imin:imax,:) !! \brief Get a (subset of) row(s)
! !!
! GETBLK returns a pbs_z_coo_sparse_mat with !! getblk is very similar to getrow, except that the output
! the same contents. !! is packaged in a psb_z_coo_sparse_mat object
! Default implementation at base level !!
! in terms of (derived) GETROW !! \param imin the minimum row index we are interested in
!! \param imax the minimum row index we are interested in
!! \param b the output (sub)matrix
!! \param info return code
!! \param jmin [1] minimum col index
!! \param jmax [a\%get_ncols()] maximum col index
!! \param iren(:) [none] an array to return renumbered indices (iren(ia(:)),iren(ja(:))
!! \param rscale [false] map [min(ia(:)):max(ia(:))] onto [1:max(ia(:))-min(ia(:))+1]
!! \param cscale [false] map [min(ja(:)):max(ja(:))] onto [1:max(ja(:))-min(ja(:))+1]
!! ( iren cannot be specified with rscale/cscale)
!! \param append [false] append to ia,ja
!! \param nzin [none] if append, then first new entry should go in entry nzin+1
!!
! !
interface interface
subroutine psb_z_base_csgetblk(imin,imax,a,b,info,& subroutine psb_z_base_csgetblk(imin,imax,a,b,info,&
@ -296,12 +342,26 @@ module psb_z_base_mat_mod
end interface end interface
! !
! CLIP: extract a subset
! B(:,:) = A(imin:imax,jmin:jmax)
! control: rscale,cscale as in getblk above.
! !
! Default implementation at base level in terms of !> Function csclip:
! GETBLK. !! \brief Get a submatrix.
!!
!! csclip is practically identical to getblk.
!! One of them has to go away.....
!!
!! \param b the output submatrix
!! \param info return code
!! \param imin [1] the minimum row index we are interested in
!! \param imax [a%get_nrows()] the minimum row index we are interested in
!! \param jmin [1] minimum col index
!! \param jmax [a\%get_ncols()] maximum col index
!! \param iren(:) [none] an array to return renumbered indices (iren(ia(:)),iren(ja(:))
!! \param rscale [false] map [min(ia(:)):max(ia(:))] onto [1:max(ia(:))-min(ia(:))+1]
!! \param cscale [false] map [min(ja(:)):max(ja(:))] onto [1:max(ja(:))-min(ja(:))+1]
!! ( iren cannot be specified with rscale/cscale)
!! \param append [false] append to ia,ja
!! \param nzin [none] if append, then first new entry should go in entry nzin+1
!!
! !
interface interface
subroutine psb_z_base_csclip(a,b,info,& subroutine psb_z_base_csclip(a,b,info,&
@ -316,9 +376,13 @@ module psb_z_base_mat_mod
end interface end interface
! !
! GET_DIAG method !> Function get_diag:
! !! \brief Extract the diagonal of A.
! D(i) = A(i:i), i=1:min(nrows,ncols) !!
!! D(i) = A(i:i), i=1:min(nrows,ncols)
!!
!! \param d(:) The output diagonal
!! \param info return code.
! !
interface interface
subroutine psb_z_base_get_diag(a,d,info) subroutine psb_z_base_get_diag(a,d,info)
@ -330,10 +394,13 @@ module psb_z_base_mat_mod
end interface end interface
! !
! MOLD: make B have the same dinamyc type !> Function mold:
! as A. !! \brief Allocate a class(psb_z_base_sparse_mat) with the
! For compilers not supporting !! same dynamic type as the input.
! allocate( mold= ) !! This is equivalent to allocate( mold= ) and is provided
!! for those compilers not yet supporting mold.
!! \param b The output variable
!! \param info return code
! !
interface interface
subroutine psb_z_base_mold(a,b,info) subroutine psb_z_base_mold(a,b,info)
@ -346,16 +413,11 @@ module psb_z_base_mat_mod
! !
! These are the methods implementing the MEDIATOR pattern !> Function cp_to_coo:
! to allow switch between arbitrary. !! \brief Copy and convert to psb_z_coo_sparse_mat
! Indeed, the TO/FROM FMT can be implemented at the base level !! Invoked from the source object.
! in terms of the TO/FROM COO per the MEDIATOR design pattern. !! \param b The output variable
! This does not prevent most of the derived classes to !! \param info return code
! provide their own versions with shortcuts.
! A%{MV|CP}_{TO|FROM}_{FMT|COO}
! MV|CP: copy versus move, i.e. deallocate
! TO|FROM: invoked from source or target object
!
! !
interface interface
subroutine psb_z_base_cp_to_coo(a,b,info) subroutine psb_z_base_cp_to_coo(a,b,info)
@ -366,6 +428,13 @@ module psb_z_base_mat_mod
end subroutine psb_z_base_cp_to_coo end subroutine psb_z_base_cp_to_coo
end interface end interface
!
!> Function cp_from_coo:
!! \brief Copy and convert from psb_z_coo_sparse_mat
!! Invoked from the target object.
!! \param b The input variable
!! \param info return code
!
interface interface
subroutine psb_z_base_cp_from_coo(a,b,info) subroutine psb_z_base_cp_from_coo(a,b,info)
import :: psb_ipk_, psb_z_base_sparse_mat, psb_z_coo_sparse_mat, psb_dpk_ import :: psb_ipk_, psb_z_base_sparse_mat, psb_z_coo_sparse_mat, psb_dpk_
@ -375,6 +444,14 @@ module psb_z_base_mat_mod
end subroutine psb_z_base_cp_from_coo end subroutine psb_z_base_cp_from_coo
end interface end interface
!
!> Function cp_to_fmt:
!! \brief Copy and convert to a class(psb_z_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 interface
subroutine psb_z_base_cp_to_fmt(a,b,info) subroutine psb_z_base_cp_to_fmt(a,b,info)
import :: psb_ipk_, psb_z_base_sparse_mat, psb_dpk_ import :: psb_ipk_, psb_z_base_sparse_mat, psb_dpk_
@ -384,6 +461,14 @@ module psb_z_base_mat_mod
end subroutine psb_z_base_cp_to_fmt end subroutine psb_z_base_cp_to_fmt
end interface end interface
!
!> Function cp_from_fmt:
!! \brief Copy and convert from a class(psb_z_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 interface
subroutine psb_z_base_cp_from_fmt(a,b,info) subroutine psb_z_base_cp_from_fmt(a,b,info)
import :: psb_ipk_, psb_z_base_sparse_mat, psb_dpk_ import :: psb_ipk_, psb_z_base_sparse_mat, psb_dpk_
@ -393,6 +478,13 @@ module psb_z_base_mat_mod
end subroutine psb_z_base_cp_from_fmt end subroutine psb_z_base_cp_from_fmt
end interface end interface
!
!> Function mv_to_coo:
!! \brief Convert to psb_z_coo_sparse_mat, freeing the source.
!! Invoked from the source object.
!! \param b The output variable
!! \param info return code
!
interface interface
subroutine psb_z_base_mv_to_coo(a,b,info) subroutine psb_z_base_mv_to_coo(a,b,info)
import :: psb_ipk_, psb_z_base_sparse_mat, psb_z_coo_sparse_mat, psb_dpk_ import :: psb_ipk_, psb_z_base_sparse_mat, psb_z_coo_sparse_mat, psb_dpk_
@ -402,6 +494,13 @@ module psb_z_base_mat_mod
end subroutine psb_z_base_mv_to_coo end subroutine psb_z_base_mv_to_coo
end interface end interface
!
!> Function mv_from_coo:
!! \brief Convert from psb_z_coo_sparse_mat, freeing the source.
!! Invoked from the target object.
!! \param b The input variable
!! \param info return code
!
interface interface
subroutine psb_z_base_mv_from_coo(a,b,info) subroutine psb_z_base_mv_from_coo(a,b,info)
import :: psb_ipk_, psb_z_base_sparse_mat, psb_z_coo_sparse_mat, psb_dpk_ import :: psb_ipk_, psb_z_base_sparse_mat, psb_z_coo_sparse_mat, psb_dpk_
@ -411,6 +510,14 @@ module psb_z_base_mat_mod
end subroutine psb_z_base_mv_from_coo end subroutine psb_z_base_mv_from_coo
end interface end interface
!
!> Function mv_to_fmt:
!! \brief Convert to a class(psb_z_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 interface
subroutine psb_z_base_mv_to_fmt(a,b,info) subroutine psb_z_base_mv_to_fmt(a,b,info)
import :: psb_ipk_, psb_z_base_sparse_mat, psb_dpk_ import :: psb_ipk_, psb_z_base_sparse_mat, psb_dpk_
@ -420,6 +527,14 @@ module psb_z_base_mat_mod
end subroutine psb_z_base_mv_to_fmt end subroutine psb_z_base_mv_to_fmt
end interface end interface
!
!> Function mv_from_fmt:
!! \brief Convert from a class(psb_z_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 interface
subroutine psb_z_base_mv_from_fmt(a,b,info) subroutine psb_z_base_mv_from_fmt(a,b,info)
import :: psb_ipk_, psb_z_base_sparse_mat, psb_dpk_ import :: psb_ipk_, psb_z_base_sparse_mat, psb_dpk_
@ -430,11 +545,13 @@ module psb_z_base_mat_mod
end interface end interface
! !
! Transpose methods. !> Function transp:
! You can always default to COO to do the actual !! \brief Transpose. Can always be implemented by staging through a COO
! transpose work. !! temporary for which transpose is very easy.
!! Copyout version
!! \param b The output variable
! !
interface interface
subroutine psb_z_base_transp_2mat(a,b) subroutine psb_z_base_transp_2mat(a,b)
import :: psb_ipk_, psb_z_base_sparse_mat, psb_base_sparse_mat, psb_dpk_ import :: psb_ipk_, psb_z_base_sparse_mat, psb_base_sparse_mat, psb_dpk_
class(psb_z_base_sparse_mat), intent(in) :: a class(psb_z_base_sparse_mat), intent(in) :: a
@ -442,6 +559,13 @@ module psb_z_base_mat_mod
end subroutine psb_z_base_transp_2mat end subroutine psb_z_base_transp_2mat
end interface end interface
!
!> Function transc:
!! \brief Conjugate Transpose. Can always be implemented by staging through a COO
!! temporary for which transpose is very easy.
!! Copyout version.
!! \param b The output variable
!
interface interface
subroutine psb_z_base_transc_2mat(a,b) subroutine psb_z_base_transc_2mat(a,b)
import :: psb_ipk_, psb_z_base_sparse_mat, psb_base_sparse_mat, psb_dpk_ import :: psb_ipk_, psb_z_base_sparse_mat, psb_base_sparse_mat, psb_dpk_
@ -450,6 +574,12 @@ module psb_z_base_mat_mod
end subroutine psb_z_base_transc_2mat end subroutine psb_z_base_transc_2mat
end interface end interface
!
!> Function transp:
!! \brief Transpose. Can always be implemented by staging through a COO
!! temporary for which transpose is very easy.
!! In-place version.
!
interface interface
subroutine psb_z_base_transp_1mat(a) subroutine psb_z_base_transp_1mat(a)
import :: psb_ipk_, psb_z_base_sparse_mat, psb_dpk_ import :: psb_ipk_, psb_z_base_sparse_mat, psb_dpk_
@ -457,6 +587,12 @@ module psb_z_base_mat_mod
end subroutine psb_z_base_transp_1mat end subroutine psb_z_base_transp_1mat
end interface end interface
!
!> Function transc:
!! \brief Conjugate Transpose. Can always be implemented by staging through a COO
!! temporary for which transpose is very easy.
!! In-place version.
!
interface interface
subroutine psb_z_base_transc_1mat(a) subroutine psb_z_base_transc_1mat(a)
import :: psb_ipk_, psb_z_base_sparse_mat, psb_dpk_ import :: psb_ipk_, psb_z_base_sparse_mat, psb_dpk_
@ -685,6 +821,10 @@ module psb_z_base_mat_mod
! !
! == =============== ! == ===============
!
!>
!! \see psb_base_mat_mod::psb_base_reallocate_nz
!
interface interface
subroutine psb_z_coo_reallocate_nz(nz,a) subroutine psb_z_coo_reallocate_nz(nz,a)
import :: psb_ipk_, psb_z_coo_sparse_mat import :: psb_ipk_, psb_z_coo_sparse_mat

Binary file not shown.

Before

Width:  |  Height:  |  Size: 200 B

After

Width:  |  Height:  |  Size: 210 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 401 B

After

Width:  |  Height:  |  Size: 446 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 260 B

After

Width:  |  Height:  |  Size: 264 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 188 B

After

Width:  |  Height:  |  Size: 202 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 143 B

After

Width:  |  Height:  |  Size: 151 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 257 B

After

Width:  |  Height:  |  Size: 268 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 379 B

After

Width:  |  Height:  |  Size: 390 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 263 B

After

Width:  |  Height:  |  Size: 266 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 249 B

After

Width:  |  Height:  |  Size: 278 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 264 B

After

Width:  |  Height:  |  Size: 275 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 399 B

After

Width:  |  Height:  |  Size: 393 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 208 B

After

Width:  |  Height:  |  Size: 214 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 529 B

After

Width:  |  Height:  |  Size: 562 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 260 B

After

Width:  |  Height:  |  Size: 260 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 793 B

After

Width:  |  Height:  |  Size: 862 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 406 B

After

Width:  |  Height:  |  Size: 422 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 426 B

After

Width:  |  Height:  |  Size: 419 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 345 B

After

Width:  |  Height:  |  Size: 361 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 321 B

After

Width:  |  Height:  |  Size: 323 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 840 B

After

Width:  |  Height:  |  Size: 859 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 341 B

After

Width:  |  Height:  |  Size: 340 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 505 B

After

Width:  |  Height:  |  Size: 534 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 405 B

After

Width:  |  Height:  |  Size: 424 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 125 B

After

Width:  |  Height:  |  Size: 125 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 271 B

After

Width:  |  Height:  |  Size: 275 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 542 B

After

Width:  |  Height:  |  Size: 578 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 541 B

After

Width:  |  Height:  |  Size: 598 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 335 B

After

Width:  |  Height:  |  Size: 364 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 229 B

After

Width:  |  Height:  |  Size: 243 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 525 B

After

Width:  |  Height:  |  Size: 565 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 579 B

After

Width:  |  Height:  |  Size: 625 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 581 B

After

Width:  |  Height:  |  Size: 588 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 215 B

After

Width:  |  Height:  |  Size: 227 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 584 B

After

Width:  |  Height:  |  Size: 634 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 736 B

After

Width:  |  Height:  |  Size: 752 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 272 B

After

Width:  |  Height:  |  Size: 279 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 521 B

After

Width:  |  Height:  |  Size: 536 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 270 B

After

Width:  |  Height:  |  Size: 280 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 561 B

After

Width:  |  Height:  |  Size: 584 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 247 B

After

Width:  |  Height:  |  Size: 254 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 372 B

After

Width:  |  Height:  |  Size: 376 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 433 B

After

Width:  |  Height:  |  Size: 445 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 650 B

After

Width:  |  Height:  |  Size: 693 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 915 B

After

Width:  |  Height:  |  Size: 998 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 673 B

After

Width:  |  Height:  |  Size: 713 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 219 B

After

Width:  |  Height:  |  Size: 232 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 429 B

After

Width:  |  Height:  |  Size: 447 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 477 B

After

Width:  |  Height:  |  Size: 508 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 410 B

After

Width:  |  Height:  |  Size: 444 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 352 B

After

Width:  |  Height:  |  Size: 367 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 387 B

After

Width:  |  Height:  |  Size: 404 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 287 B

After

Width:  |  Height:  |  Size: 309 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 230 B

After

Width:  |  Height:  |  Size: 244 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 196 B

After

Width:  |  Height:  |  Size: 204 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 370 B

After

Width:  |  Height:  |  Size: 394 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 539 B

After

Width:  |  Height:  |  Size: 606 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.6 KiB

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 478 B

After

Width:  |  Height:  |  Size: 507 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 194 B

After

Width:  |  Height:  |  Size: 196 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 223 B

After

Width:  |  Height:  |  Size: 226 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 191 B

After

Width:  |  Height:  |  Size: 203 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 226 B

After

Width:  |  Height:  |  Size: 230 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 449 B

After

Width:  |  Height:  |  Size: 464 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 468 B

After

Width:  |  Height:  |  Size: 477 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 276 B

After

Width:  |  Height:  |  Size: 279 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 780 B

After

Width:  |  Height:  |  Size: 752 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 244 B

After

Width:  |  Height:  |  Size: 256 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 571 B

After

Width:  |  Height:  |  Size: 607 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 309 B

After

Width:  |  Height:  |  Size: 323 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 793 B

After

Width:  |  Height:  |  Size: 814 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 444 B

After

Width:  |  Height:  |  Size: 478 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 863 B

After

Width:  |  Height:  |  Size: 868 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 178 B

After

Width:  |  Height:  |  Size: 195 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 307 B

After

Width:  |  Height:  |  Size: 328 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 507 B

After

Width:  |  Height:  |  Size: 524 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 905 B

After

Width:  |  Height:  |  Size: 864 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 557 B

After

Width:  |  Height:  |  Size: 566 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 571 B

After

Width:  |  Height:  |  Size: 577 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 319 B

After

Width:  |  Height:  |  Size: 341 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 646 B

After

Width:  |  Height:  |  Size: 663 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 486 B

After

Width:  |  Height:  |  Size: 506 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 670 B

After

Width:  |  Height:  |  Size: 688 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 721 B

After

Width:  |  Height:  |  Size: 754 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 200 B

After

Width:  |  Height:  |  Size: 207 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 729 B

After

Width:  |  Height:  |  Size: 750 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 242 B

After

Width:  |  Height:  |  Size: 256 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 255 B

After

Width:  |  Height:  |  Size: 269 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 350 B

After

Width:  |  Height:  |  Size: 314 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 416 B

After

Width:  |  Height:  |  Size: 431 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 199 B

After

Width:  |  Height:  |  Size: 206 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 228 B

After

Width:  |  Height:  |  Size: 225 B

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save