|
|
@ -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
|
|
|
|