You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
615 lines
22 KiB
Fortran
615 lines
22 KiB
Fortran
12 years ago
|
!!$
|
||
|
!!$ Parallel Sparse BLAS version 3.1
|
||
|
!!$ (C) Copyright 2006, 2007, 2008, 2009, 2010, 2012, 2013
|
||
|
!!$ Salvatore Filippone University of Rome Tor Vergata
|
||
|
!!$ Alfredo Buttari CNRS-IRIT, Toulouse
|
||
|
!!$
|
||
|
!!$ Redistribution and use in source and binary forms, with or without
|
||
|
!!$ modification, are permitted provided that the following conditions
|
||
|
!!$ are met:
|
||
|
!!$ 1. Redistributions of source code must retain the above copyright
|
||
|
!!$ notice, this list of conditions and the following disclaimer.
|
||
|
!!$ 2. Redistributions in binary form must reproduce the above copyright
|
||
|
!!$ notice, this list of conditions, and the following disclaimer in the
|
||
|
!!$ documentation and/or other materials provided with the distribution.
|
||
|
!!$ 3. The name of the PSBLAS group or the names of its contributors may
|
||
|
!!$ not be used to endorse or promote products derived from this
|
||
|
!!$ software without specific written permission.
|
||
|
!!$
|
||
|
!!$ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||
|
!!$ ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||
|
!!$ TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||
|
!!$ PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PSBLAS GROUP OR ITS CONTRIBUTORS
|
||
|
!!$ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||
|
!!$ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||
|
!!$ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||
|
!!$ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||
|
!!$ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||
|
!!$ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||
|
!!$ POSSIBILITY OF SUCH DAMAGE.
|
||
|
!!$
|
||
|
!!$
|
||
|
!
|
||
10 years ago
|
! package: psb_d_xyz_mat_mod
|
||
12 years ago
|
!
|
||
10 years ago
|
! This module contains the definition of the psb_d_xyz_sparse_mat type
|
||
12 years ago
|
! which is just an example of how to build a new storage format.
|
||
|
! Indeed this is simply CSR under a new name.
|
||
|
!
|
||
|
! Please refere to psb_d_base_mat_mod for a detailed description
|
||
10 years ago
|
! of the various methods, and to psb_d_xyz_impl for implementation details.
|
||
12 years ago
|
!
|
||
10 years ago
|
module psb_d_xyz_mat_mod
|
||
16 years ago
|
|
||
16 years ago
|
use psb_d_base_mat_mod
|
||
16 years ago
|
|
||
10 years ago
|
!> \namespace psb_base_mod \class psb_d_xyz_sparse_mat
|
||
12 years ago
|
!! \extends psb_d_base_mat_mod::psb_d_base_sparse_mat
|
||
|
!!
|
||
10 years ago
|
!! psb_d_xyz_sparse_mat type and the related methods.
|
||
12 years ago
|
!! This is a very common storage type, and is the default for assembled
|
||
|
!! matrices in our library
|
||
10 years ago
|
type, extends(psb_d_base_sparse_mat) :: psb_d_xyz_sparse_mat
|
||
16 years ago
|
|
||
12 years ago
|
!> Pointers to beginning of rows in JA and VAL.
|
||
|
integer(psb_ipk_), allocatable :: irp(:)
|
||
|
!> Column indices.
|
||
|
integer(psb_ipk_), allocatable :: ja(:)
|
||
|
!> Coefficient values.
|
||
16 years ago
|
real(psb_dpk_), allocatable :: val(:)
|
||
|
|
||
|
contains
|
||
10 years ago
|
procedure, pass(a) :: get_size => d_xyz_get_size
|
||
|
procedure, pass(a) :: get_nzeros => d_xyz_get_nzeros
|
||
|
procedure, nopass :: get_fmt => d_xyz_get_fmt
|
||
|
procedure, pass(a) :: sizeof => d_xyz_sizeof
|
||
|
procedure, pass(a) :: csmm => psb_d_xyz_csmm
|
||
|
procedure, pass(a) :: csmv => psb_d_xyz_csmv
|
||
|
procedure, pass(a) :: inner_cssm => psb_d_xyz_cssm
|
||
|
procedure, pass(a) :: inner_cssv => psb_d_xyz_cssv
|
||
|
procedure, pass(a) :: scals => psb_d_xyz_scals
|
||
|
procedure, pass(a) :: scalv => psb_d_xyz_scal
|
||
|
procedure, pass(a) :: maxval => psb_d_xyz_maxval
|
||
|
procedure, pass(a) :: spnmi => psb_d_xyz_csnmi
|
||
|
procedure, pass(a) :: spnm1 => psb_d_xyz_csnm1
|
||
|
procedure, pass(a) :: rowsum => psb_d_xyz_rowsum
|
||
|
procedure, pass(a) :: arwsum => psb_d_xyz_arwsum
|
||
|
procedure, pass(a) :: colsum => psb_d_xyz_colsum
|
||
|
procedure, pass(a) :: aclsum => psb_d_xyz_aclsum
|
||
|
procedure, pass(a) :: reallocate_nz => psb_d_xyz_reallocate_nz
|
||
|
procedure, pass(a) :: allocate_mnnz => psb_d_xyz_allocate_mnnz
|
||
|
procedure, pass(a) :: cp_to_coo => psb_d_cp_xyz_to_coo
|
||
|
procedure, pass(a) :: cp_from_coo => psb_d_cp_xyz_from_coo
|
||
|
procedure, pass(a) :: cp_to_fmt => psb_d_cp_xyz_to_fmt
|
||
|
procedure, pass(a) :: cp_from_fmt => psb_d_cp_xyz_from_fmt
|
||
|
procedure, pass(a) :: mv_to_coo => psb_d_mv_xyz_to_coo
|
||
|
procedure, pass(a) :: mv_from_coo => psb_d_mv_xyz_from_coo
|
||
|
procedure, pass(a) :: mv_to_fmt => psb_d_mv_xyz_to_fmt
|
||
|
procedure, pass(a) :: mv_from_fmt => psb_d_mv_xyz_from_fmt
|
||
|
procedure, pass(a) :: csput_a => psb_d_xyz_csput_a
|
||
|
procedure, pass(a) :: get_diag => psb_d_xyz_get_diag
|
||
|
procedure, pass(a) :: csgetptn => psb_d_xyz_csgetptn
|
||
|
procedure, pass(a) :: csgetrow => psb_d_xyz_csgetrow
|
||
|
procedure, pass(a) :: get_nz_row => d_xyz_get_nz_row
|
||
|
procedure, pass(a) :: reinit => psb_d_xyz_reinit
|
||
|
procedure, pass(a) :: trim => psb_d_xyz_trim
|
||
|
procedure, pass(a) :: print => psb_d_xyz_print
|
||
|
procedure, pass(a) :: free => d_xyz_free
|
||
|
procedure, pass(a) :: mold => psb_d_xyz_mold
|
||
|
|
||
|
end type psb_d_xyz_sparse_mat
|
||
|
|
||
|
private :: d_xyz_get_nzeros, d_xyz_free, d_xyz_get_fmt, &
|
||
|
& d_xyz_get_size, d_xyz_sizeof, d_xyz_get_nz_row
|
||
|
|
||
|
!> \memberof psb_d_xyz_sparse_mat
|
||
12 years ago
|
!| \see psb_base_mat_mod::psb_base_reallocate_nz
|
||
15 years ago
|
interface
|
||
10 years ago
|
subroutine psb_d_xyz_reallocate_nz(nz,a)
|
||
|
import :: psb_ipk_, psb_d_xyz_sparse_mat
|
||
13 years ago
|
integer(psb_ipk_), intent(in) :: nz
|
||
10 years ago
|
class(psb_d_xyz_sparse_mat), intent(inout) :: a
|
||
|
end subroutine psb_d_xyz_reallocate_nz
|
||
16 years ago
|
end interface
|
||
15 years ago
|
|
||
10 years ago
|
!> \memberof psb_d_xyz_sparse_mat
|
||
12 years ago
|
!| \see psb_base_mat_mod::psb_base_reinit
|
||
16 years ago
|
interface
|
||
10 years ago
|
subroutine psb_d_xyz_reinit(a,clear)
|
||
|
import :: psb_ipk_, psb_d_xyz_sparse_mat
|
||
|
class(psb_d_xyz_sparse_mat), intent(inout) :: a
|
||
15 years ago
|
logical, intent(in), optional :: clear
|
||
10 years ago
|
end subroutine psb_d_xyz_reinit
|
||
15 years ago
|
end interface
|
||
|
|
||
10 years ago
|
!> \memberof psb_d_xyz_sparse_mat
|
||
12 years ago
|
!| \see psb_base_mat_mod::psb_base_trim
|
||
15 years ago
|
interface
|
||
10 years ago
|
subroutine psb_d_xyz_trim(a)
|
||
|
import :: psb_ipk_, psb_d_xyz_sparse_mat
|
||
|
class(psb_d_xyz_sparse_mat), intent(inout) :: a
|
||
|
end subroutine psb_d_xyz_trim
|
||
16 years ago
|
end interface
|
||
12 years ago
|
|
||
15 years ago
|
|
||
10 years ago
|
!> \memberof psb_d_xyz_sparse_mat
|
||
12 years ago
|
!| \see psb_base_mat_mod::psb_base_mold
|
||
16 years ago
|
interface
|
||
10 years ago
|
subroutine psb_d_xyz_mold(a,b,info)
|
||
|
import :: psb_ipk_, psb_d_xyz_sparse_mat, psb_d_base_sparse_mat, psb_long_int_k_
|
||
|
class(psb_d_xyz_sparse_mat), intent(in) :: a
|
||
12 years ago
|
class(psb_d_base_sparse_mat), intent(inout), allocatable :: b
|
||
|
integer(psb_ipk_), intent(out) :: info
|
||
10 years ago
|
end subroutine psb_d_xyz_mold
|
||
15 years ago
|
end interface
|
||
12 years ago
|
|
||
10 years ago
|
!> \memberof psb_d_xyz_sparse_mat
|
||
12 years ago
|
!| \see psb_base_mat_mod::psb_base_allocate_mnnz
|
||
15 years ago
|
interface
|
||
10 years ago
|
subroutine psb_d_xyz_allocate_mnnz(m,n,a,nz)
|
||
|
import :: psb_ipk_, psb_d_xyz_sparse_mat
|
||
13 years ago
|
integer(psb_ipk_), intent(in) :: m,n
|
||
10 years ago
|
class(psb_d_xyz_sparse_mat), intent(inout) :: a
|
||
13 years ago
|
integer(psb_ipk_), intent(in), optional :: nz
|
||
10 years ago
|
end subroutine psb_d_xyz_allocate_mnnz
|
||
15 years ago
|
end interface
|
||
12 years ago
|
|
||
15 years ago
|
|
||
10 years ago
|
!> \memberof psb_d_xyz_sparse_mat
|
||
12 years ago
|
!! \see psb_d_base_mat_mod::psb_d_base_print
|
||
15 years ago
|
interface
|
||
10 years ago
|
subroutine psb_d_xyz_print(iout,a,iv,head,ivr,ivc)
|
||
|
import :: psb_ipk_, psb_d_xyz_sparse_mat
|
||
13 years ago
|
integer(psb_ipk_), intent(in) :: iout
|
||
10 years ago
|
class(psb_d_xyz_sparse_mat), intent(in) :: a
|
||
13 years ago
|
integer(psb_ipk_), intent(in), optional :: iv(:)
|
||
15 years ago
|
character(len=*), optional :: head
|
||
13 years ago
|
integer(psb_ipk_), intent(in), optional :: ivr(:), ivc(:)
|
||
10 years ago
|
end subroutine psb_d_xyz_print
|
||
15 years ago
|
end interface
|
||
|
|
||
10 years ago
|
!> \memberof psb_d_xyz_sparse_mat
|
||
12 years ago
|
!! \see psb_d_base_mat_mod::psb_d_base_cp_to_coo
|
||
15 years ago
|
interface
|
||
10 years ago
|
subroutine psb_d_cp_xyz_to_coo(a,b,info)
|
||
|
import :: psb_ipk_, psb_d_coo_sparse_mat, psb_d_xyz_sparse_mat
|
||
|
class(psb_d_xyz_sparse_mat), intent(in) :: a
|
||
15 years ago
|
class(psb_d_coo_sparse_mat), intent(inout) :: b
|
||
13 years ago
|
integer(psb_ipk_), intent(out) :: info
|
||
10 years ago
|
end subroutine psb_d_cp_xyz_to_coo
|
||
16 years ago
|
end interface
|
||
15 years ago
|
|
||
10 years ago
|
!> \memberof psb_d_xyz_sparse_mat
|
||
12 years ago
|
!! \see psb_d_base_mat_mod::psb_d_base_cp_from_coo
|
||
16 years ago
|
interface
|
||
10 years ago
|
subroutine psb_d_cp_xyz_from_coo(a,b,info)
|
||
|
import :: psb_ipk_, psb_d_xyz_sparse_mat, psb_d_coo_sparse_mat
|
||
|
class(psb_d_xyz_sparse_mat), intent(inout) :: a
|
||
16 years ago
|
class(psb_d_coo_sparse_mat), intent(in) :: b
|
||
13 years ago
|
integer(psb_ipk_), intent(out) :: info
|
||
10 years ago
|
end subroutine psb_d_cp_xyz_from_coo
|
||
16 years ago
|
end interface
|
||
15 years ago
|
|
||
10 years ago
|
!> \memberof psb_d_xyz_sparse_mat
|
||
12 years ago
|
!! \see psb_d_base_mat_mod::psb_d_base_cp_to_fmt
|
||
16 years ago
|
interface
|
||
10 years ago
|
subroutine psb_d_cp_xyz_to_fmt(a,b,info)
|
||
|
import :: psb_ipk_, psb_d_xyz_sparse_mat, psb_d_base_sparse_mat
|
||
|
class(psb_d_xyz_sparse_mat), intent(in) :: a
|
||
15 years ago
|
class(psb_d_base_sparse_mat), intent(inout) :: b
|
||
13 years ago
|
integer(psb_ipk_), intent(out) :: info
|
||
10 years ago
|
end subroutine psb_d_cp_xyz_to_fmt
|
||
16 years ago
|
end interface
|
||
15 years ago
|
|
||
10 years ago
|
!> \memberof psb_d_xyz_sparse_mat
|
||
12 years ago
|
!! \see psb_d_base_mat_mod::psb_d_base_cp_from_fmt
|
||
16 years ago
|
interface
|
||
10 years ago
|
subroutine psb_d_cp_xyz_from_fmt(a,b,info)
|
||
|
import :: psb_ipk_, psb_d_xyz_sparse_mat, psb_d_base_sparse_mat
|
||
|
class(psb_d_xyz_sparse_mat), intent(inout) :: a
|
||
15 years ago
|
class(psb_d_base_sparse_mat), intent(in) :: b
|
||
13 years ago
|
integer(psb_ipk_), intent(out) :: info
|
||
10 years ago
|
end subroutine psb_d_cp_xyz_from_fmt
|
||
16 years ago
|
end interface
|
||
15 years ago
|
|
||
10 years ago
|
!> \memberof psb_d_xyz_sparse_mat
|
||
12 years ago
|
!! \see psb_d_base_mat_mod::psb_d_base_mv_to_coo
|
||
16 years ago
|
interface
|
||
10 years ago
|
subroutine psb_d_mv_xyz_to_coo(a,b,info)
|
||
|
import :: psb_ipk_, psb_d_xyz_sparse_mat, psb_d_coo_sparse_mat
|
||
|
class(psb_d_xyz_sparse_mat), intent(inout) :: a
|
||
15 years ago
|
class(psb_d_coo_sparse_mat), intent(inout) :: b
|
||
13 years ago
|
integer(psb_ipk_), intent(out) :: info
|
||
10 years ago
|
end subroutine psb_d_mv_xyz_to_coo
|
||
16 years ago
|
end interface
|
||
15 years ago
|
|
||
10 years ago
|
!> \memberof psb_d_xyz_sparse_mat
|
||
12 years ago
|
!! \see psb_d_base_mat_mod::psb_d_base_mv_from_coo
|
||
16 years ago
|
interface
|
||
10 years ago
|
subroutine psb_d_mv_xyz_from_coo(a,b,info)
|
||
|
import :: psb_ipk_, psb_d_xyz_sparse_mat, psb_d_coo_sparse_mat
|
||
|
class(psb_d_xyz_sparse_mat), intent(inout) :: a
|
||
16 years ago
|
class(psb_d_coo_sparse_mat), intent(inout) :: b
|
||
13 years ago
|
integer(psb_ipk_), intent(out) :: info
|
||
10 years ago
|
end subroutine psb_d_mv_xyz_from_coo
|
||
16 years ago
|
end interface
|
||
15 years ago
|
|
||
10 years ago
|
!> \memberof psb_d_xyz_sparse_mat
|
||
12 years ago
|
!! \see psb_d_base_mat_mod::psb_d_base_mv_to_fmt
|
||
16 years ago
|
interface
|
||
10 years ago
|
subroutine psb_d_mv_xyz_to_fmt(a,b,info)
|
||
|
import :: psb_ipk_, psb_d_xyz_sparse_mat, psb_d_base_sparse_mat
|
||
|
class(psb_d_xyz_sparse_mat), intent(inout) :: a
|
||
15 years ago
|
class(psb_d_base_sparse_mat), intent(inout) :: b
|
||
13 years ago
|
integer(psb_ipk_), intent(out) :: info
|
||
10 years ago
|
end subroutine psb_d_mv_xyz_to_fmt
|
||
15 years ago
|
end interface
|
||
|
|
||
10 years ago
|
!> \memberof psb_d_xyz_sparse_mat
|
||
12 years ago
|
!! \see psb_d_base_mat_mod::psb_d_base_mv_from_fmt
|
||
15 years ago
|
interface
|
||
10 years ago
|
subroutine psb_d_mv_xyz_from_fmt(a,b,info)
|
||
|
import :: psb_ipk_, psb_d_xyz_sparse_mat, psb_d_base_sparse_mat
|
||
|
class(psb_d_xyz_sparse_mat), intent(inout) :: a
|
||
15 years ago
|
class(psb_d_base_sparse_mat), intent(inout) :: b
|
||
13 years ago
|
integer(psb_ipk_), intent(out) :: info
|
||
10 years ago
|
end subroutine psb_d_mv_xyz_from_fmt
|
||
15 years ago
|
end interface
|
||
|
|
||
10 years ago
|
!> \memberof psb_d_xyz_sparse_mat
|
||
12 years ago
|
!! \see psb_d_base_mat_mod::psb_d_base_cp_from
|
||
15 years ago
|
interface
|
||
10 years ago
|
subroutine psb_d_xyz_cp_from(a,b)
|
||
|
import :: psb_ipk_, psb_d_xyz_sparse_mat, psb_dpk_
|
||
|
class(psb_d_xyz_sparse_mat), intent(inout) :: a
|
||
|
type(psb_d_xyz_sparse_mat), intent(in) :: b
|
||
|
end subroutine psb_d_xyz_cp_from
|
||
15 years ago
|
end interface
|
||
|
|
||
10 years ago
|
!> \memberof psb_d_xyz_sparse_mat
|
||
12 years ago
|
!! \see psb_d_base_mat_mod::psb_d_base_mv_from
|
||
15 years ago
|
interface
|
||
10 years ago
|
subroutine psb_d_xyz_mv_from(a,b)
|
||
|
import :: psb_ipk_, psb_d_xyz_sparse_mat, psb_dpk_
|
||
|
class(psb_d_xyz_sparse_mat), intent(inout) :: a
|
||
|
type(psb_d_xyz_sparse_mat), intent(inout) :: b
|
||
|
end subroutine psb_d_xyz_mv_from
|
||
15 years ago
|
end interface
|
||
|
|
||
|
|
||
10 years ago
|
!> \memberof psb_d_xyz_sparse_mat
|
||
12 years ago
|
!! \see psb_d_base_mat_mod::psb_d_base_csput
|
||
15 years ago
|
interface
|
||
10 years ago
|
subroutine psb_d_xyz_csput_a(nz,ia,ja,val,a,imin,imax,jmin,jmax,info,gtl)
|
||
|
import :: psb_ipk_, psb_d_xyz_sparse_mat, psb_dpk_
|
||
|
class(psb_d_xyz_sparse_mat), intent(inout) :: a
|
||
16 years ago
|
real(psb_dpk_), intent(in) :: val(:)
|
||
13 years ago
|
integer(psb_ipk_), intent(in) :: nz,ia(:), ja(:),&
|
||
15 years ago
|
& imin,imax,jmin,jmax
|
||
13 years ago
|
integer(psb_ipk_), intent(out) :: info
|
||
|
integer(psb_ipk_), intent(in), optional :: gtl(:)
|
||
10 years ago
|
end subroutine psb_d_xyz_csput_a
|
||
16 years ago
|
end interface
|
||
15 years ago
|
|
||
10 years ago
|
!> \memberof psb_d_xyz_sparse_mat
|
||
12 years ago
|
!! \see psb_base_mat_mod::psb_base_csgetptn
|
||
15 years ago
|
interface
|
||
10 years ago
|
subroutine psb_d_xyz_csgetptn(imin,imax,a,nz,ia,ja,info,&
|
||
15 years ago
|
& jmin,jmax,iren,append,nzin,rscale,cscale)
|
||
10 years ago
|
import :: psb_ipk_, psb_d_xyz_sparse_mat, psb_dpk_
|
||
|
class(psb_d_xyz_sparse_mat), intent(in) :: a
|
||
13 years ago
|
integer(psb_ipk_), intent(in) :: imin,imax
|
||
|
integer(psb_ipk_), intent(out) :: nz
|
||
|
integer(psb_ipk_), allocatable, intent(inout) :: ia(:), ja(:)
|
||
|
integer(psb_ipk_),intent(out) :: info
|
||
15 years ago
|
logical, intent(in), optional :: append
|
||
13 years ago
|
integer(psb_ipk_), intent(in), optional :: iren(:)
|
||
|
integer(psb_ipk_), intent(in), optional :: jmin,jmax, nzin
|
||
15 years ago
|
logical, intent(in), optional :: rscale,cscale
|
||
10 years ago
|
end subroutine psb_d_xyz_csgetptn
|
||
15 years ago
|
end interface
|
||
15 years ago
|
|
||
10 years ago
|
!> \memberof psb_d_xyz_sparse_mat
|
||
12 years ago
|
!! \see psb_d_base_mat_mod::psb_d_base_csgetrow
|
||
16 years ago
|
interface
|
||
10 years ago
|
subroutine psb_d_xyz_csgetrow(imin,imax,a,nz,ia,ja,val,info,&
|
||
16 years ago
|
& jmin,jmax,iren,append,nzin,rscale,cscale)
|
||
10 years ago
|
import :: psb_ipk_, psb_d_xyz_sparse_mat, psb_dpk_
|
||
|
class(psb_d_xyz_sparse_mat), intent(in) :: a
|
||
13 years ago
|
integer(psb_ipk_), intent(in) :: imin,imax
|
||
|
integer(psb_ipk_), intent(out) :: nz
|
||
|
integer(psb_ipk_), allocatable, intent(inout) :: ia(:), ja(:)
|
||
16 years ago
|
real(psb_dpk_), allocatable, intent(inout) :: val(:)
|
||
13 years ago
|
integer(psb_ipk_),intent(out) :: info
|
||
16 years ago
|
logical, intent(in), optional :: append
|
||
13 years ago
|
integer(psb_ipk_), intent(in), optional :: iren(:)
|
||
|
integer(psb_ipk_), intent(in), optional :: jmin,jmax, nzin
|
||
16 years ago
|
logical, intent(in), optional :: rscale,cscale
|
||
10 years ago
|
end subroutine psb_d_xyz_csgetrow
|
||
16 years ago
|
end interface
|
||
|
|
||
10 years ago
|
!> \memberof psb_d_xyz_sparse_mat
|
||
12 years ago
|
!! \see psb_d_base_mat_mod::psb_d_base_csgetblk
|
||
15 years ago
|
interface
|
||
10 years ago
|
subroutine psb_d_xyz_csgetblk(imin,imax,a,b,info,&
|
||
15 years ago
|
& jmin,jmax,iren,append,rscale,cscale)
|
||
10 years ago
|
import :: psb_ipk_, psb_d_xyz_sparse_mat, psb_dpk_, psb_d_coo_sparse_mat
|
||
|
class(psb_d_xyz_sparse_mat), intent(in) :: a
|
||
15 years ago
|
class(psb_d_coo_sparse_mat), intent(inout) :: b
|
||
13 years ago
|
integer(psb_ipk_), intent(in) :: imin,imax
|
||
|
integer(psb_ipk_),intent(out) :: info
|
||
15 years ago
|
logical, intent(in), optional :: append
|
||
13 years ago
|
integer(psb_ipk_), intent(in), optional :: iren(:)
|
||
|
integer(psb_ipk_), intent(in), optional :: jmin,jmax
|
||
15 years ago
|
logical, intent(in), optional :: rscale,cscale
|
||
10 years ago
|
end subroutine psb_d_xyz_csgetblk
|
||
15 years ago
|
end interface
|
||
|
|
||
10 years ago
|
!> \memberof psb_d_xyz_sparse_mat
|
||
12 years ago
|
!! \see psb_d_base_mat_mod::psb_d_base_cssv
|
||
15 years ago
|
interface
|
||
10 years ago
|
subroutine psb_d_xyz_cssv(alpha,a,x,beta,y,info,trans)
|
||
|
import :: psb_ipk_, psb_d_xyz_sparse_mat, psb_dpk_
|
||
|
class(psb_d_xyz_sparse_mat), intent(in) :: a
|
||
16 years ago
|
real(psb_dpk_), intent(in) :: alpha, beta, x(:)
|
||
|
real(psb_dpk_), intent(inout) :: y(:)
|
||
13 years ago
|
integer(psb_ipk_), intent(out) :: info
|
||
16 years ago
|
character, optional, intent(in) :: trans
|
||
10 years ago
|
end subroutine psb_d_xyz_cssv
|
||
12 years ago
|
end interface
|
||
10 years ago
|
!> \memberof psb_d_xyz_sparse_mat
|
||
12 years ago
|
!! \see psb_d_base_mat_mod::psb_d_base_cssm
|
||
|
interface
|
||
10 years ago
|
subroutine psb_d_xyz_cssm(alpha,a,x,beta,y,info,trans)
|
||
|
import :: psb_ipk_, psb_d_xyz_sparse_mat, psb_dpk_
|
||
|
class(psb_d_xyz_sparse_mat), intent(in) :: a
|
||
16 years ago
|
real(psb_dpk_), intent(in) :: alpha, beta, x(:,:)
|
||
|
real(psb_dpk_), intent(inout) :: y(:,:)
|
||
13 years ago
|
integer(psb_ipk_), intent(out) :: info
|
||
16 years ago
|
character, optional, intent(in) :: trans
|
||
10 years ago
|
end subroutine psb_d_xyz_cssm
|
||
16 years ago
|
end interface
|
||
15 years ago
|
|
||
10 years ago
|
!> \memberof psb_d_xyz_sparse_mat
|
||
12 years ago
|
!! \see psb_d_base_mat_mod::psb_d_base_csmv
|
||
15 years ago
|
interface
|
||
10 years ago
|
subroutine psb_d_xyz_csmv(alpha,a,x,beta,y,info,trans)
|
||
|
import :: psb_ipk_, psb_d_xyz_sparse_mat, psb_dpk_
|
||
|
class(psb_d_xyz_sparse_mat), intent(in) :: a
|
||
16 years ago
|
real(psb_dpk_), intent(in) :: alpha, beta, x(:)
|
||
|
real(psb_dpk_), intent(inout) :: y(:)
|
||
13 years ago
|
integer(psb_ipk_), intent(out) :: info
|
||
16 years ago
|
character, optional, intent(in) :: trans
|
||
10 years ago
|
end subroutine psb_d_xyz_csmv
|
||
12 years ago
|
end interface
|
||
|
|
||
10 years ago
|
!> \memberof psb_d_xyz_sparse_mat
|
||
12 years ago
|
!! \see psb_d_base_mat_mod::psb_d_base_csmm
|
||
|
interface
|
||
10 years ago
|
subroutine psb_d_xyz_csmm(alpha,a,x,beta,y,info,trans)
|
||
|
import :: psb_ipk_, psb_d_xyz_sparse_mat, psb_dpk_
|
||
|
class(psb_d_xyz_sparse_mat), intent(in) :: a
|
||
16 years ago
|
real(psb_dpk_), intent(in) :: alpha, beta, x(:,:)
|
||
|
real(psb_dpk_), intent(inout) :: y(:,:)
|
||
13 years ago
|
integer(psb_ipk_), intent(out) :: info
|
||
16 years ago
|
character, optional, intent(in) :: trans
|
||
10 years ago
|
end subroutine psb_d_xyz_csmm
|
||
16 years ago
|
end interface
|
||
15 years ago
|
|
||
|
|
||
10 years ago
|
!> \memberof psb_d_xyz_sparse_mat
|
||
12 years ago
|
!! \see psb_d_base_mat_mod::psb_d_base_maxval
|
||
|
interface
|
||
10 years ago
|
function psb_d_xyz_maxval(a) result(res)
|
||
|
import :: psb_ipk_, psb_d_xyz_sparse_mat, psb_dpk_
|
||
|
class(psb_d_xyz_sparse_mat), intent(in) :: a
|
||
12 years ago
|
real(psb_dpk_) :: res
|
||
10 years ago
|
end function psb_d_xyz_maxval
|
||
12 years ago
|
end interface
|
||
|
|
||
10 years ago
|
!> \memberof psb_d_xyz_sparse_mat
|
||
12 years ago
|
!! \see psb_d_base_mat_mod::psb_d_base_csnmi
|
||
15 years ago
|
interface
|
||
10 years ago
|
function psb_d_xyz_csnmi(a) result(res)
|
||
|
import :: psb_ipk_, psb_d_xyz_sparse_mat, psb_dpk_
|
||
|
class(psb_d_xyz_sparse_mat), intent(in) :: a
|
||
16 years ago
|
real(psb_dpk_) :: res
|
||
10 years ago
|
end function psb_d_xyz_csnmi
|
||
15 years ago
|
end interface
|
||
|
|
||
10 years ago
|
!> \memberof psb_d_xyz_sparse_mat
|
||
12 years ago
|
!! \see psb_d_base_mat_mod::psb_d_base_csnm1
|
||
15 years ago
|
interface
|
||
10 years ago
|
function psb_d_xyz_csnm1(a) result(res)
|
||
|
import :: psb_ipk_, psb_d_xyz_sparse_mat, psb_dpk_
|
||
|
class(psb_d_xyz_sparse_mat), intent(in) :: a
|
||
15 years ago
|
real(psb_dpk_) :: res
|
||
10 years ago
|
end function psb_d_xyz_csnm1
|
||
15 years ago
|
end interface
|
||
|
|
||
10 years ago
|
!> \memberof psb_d_xyz_sparse_mat
|
||
12 years ago
|
!! \see psb_d_base_mat_mod::psb_d_base_rowsum
|
||
15 years ago
|
interface
|
||
10 years ago
|
subroutine psb_d_xyz_rowsum(d,a)
|
||
|
import :: psb_ipk_, psb_d_xyz_sparse_mat, psb_dpk_
|
||
|
class(psb_d_xyz_sparse_mat), intent(in) :: a
|
||
15 years ago
|
real(psb_dpk_), intent(out) :: d(:)
|
||
10 years ago
|
end subroutine psb_d_xyz_rowsum
|
||
15 years ago
|
end interface
|
||
|
|
||
10 years ago
|
!> \memberof psb_d_xyz_sparse_mat
|
||
12 years ago
|
!! \see psb_d_base_mat_mod::psb_d_base_arwsum
|
||
15 years ago
|
interface
|
||
10 years ago
|
subroutine psb_d_xyz_arwsum(d,a)
|
||
|
import :: psb_ipk_, psb_d_xyz_sparse_mat, psb_dpk_
|
||
|
class(psb_d_xyz_sparse_mat), intent(in) :: a
|
||
15 years ago
|
real(psb_dpk_), intent(out) :: d(:)
|
||
10 years ago
|
end subroutine psb_d_xyz_arwsum
|
||
15 years ago
|
end interface
|
||
|
|
||
10 years ago
|
!> \memberof psb_d_xyz_sparse_mat
|
||
12 years ago
|
!! \see psb_d_base_mat_mod::psb_d_base_colsum
|
||
15 years ago
|
interface
|
||
10 years ago
|
subroutine psb_d_xyz_colsum(d,a)
|
||
|
import :: psb_ipk_, psb_d_xyz_sparse_mat, psb_dpk_
|
||
|
class(psb_d_xyz_sparse_mat), intent(in) :: a
|
||
15 years ago
|
real(psb_dpk_), intent(out) :: d(:)
|
||
10 years ago
|
end subroutine psb_d_xyz_colsum
|
||
15 years ago
|
end interface
|
||
|
|
||
10 years ago
|
!> \memberof psb_d_xyz_sparse_mat
|
||
12 years ago
|
!! \see psb_d_base_mat_mod::psb_d_base_aclsum
|
||
15 years ago
|
interface
|
||
10 years ago
|
subroutine psb_d_xyz_aclsum(d,a)
|
||
|
import :: psb_ipk_, psb_d_xyz_sparse_mat, psb_dpk_
|
||
|
class(psb_d_xyz_sparse_mat), intent(in) :: a
|
||
15 years ago
|
real(psb_dpk_), intent(out) :: d(:)
|
||
10 years ago
|
end subroutine psb_d_xyz_aclsum
|
||
15 years ago
|
end interface
|
||
|
|
||
10 years ago
|
!> \memberof psb_d_xyz_sparse_mat
|
||
12 years ago
|
!! \see psb_d_base_mat_mod::psb_d_base_get_diag
|
||
15 years ago
|
interface
|
||
10 years ago
|
subroutine psb_d_xyz_get_diag(a,d,info)
|
||
|
import :: psb_ipk_, psb_d_xyz_sparse_mat, psb_dpk_
|
||
|
class(psb_d_xyz_sparse_mat), intent(in) :: a
|
||
15 years ago
|
real(psb_dpk_), intent(out) :: d(:)
|
||
13 years ago
|
integer(psb_ipk_), intent(out) :: info
|
||
10 years ago
|
end subroutine psb_d_xyz_get_diag
|
||
15 years ago
|
end interface
|
||
|
|
||
10 years ago
|
!> \memberof psb_d_xyz_sparse_mat
|
||
12 years ago
|
!! \see psb_d_base_mat_mod::psb_d_base_scal
|
||
15 years ago
|
interface
|
||
10 years ago
|
subroutine psb_d_xyz_scal(d,a,info,side)
|
||
|
import :: psb_ipk_, psb_d_xyz_sparse_mat, psb_dpk_
|
||
|
class(psb_d_xyz_sparse_mat), intent(inout) :: a
|
||
15 years ago
|
real(psb_dpk_), intent(in) :: d(:)
|
||
13 years ago
|
integer(psb_ipk_), intent(out) :: info
|
||
12 years ago
|
character, intent(in), optional :: side
|
||
10 years ago
|
end subroutine psb_d_xyz_scal
|
||
15 years ago
|
end interface
|
||
|
|
||
10 years ago
|
!> \memberof psb_d_xyz_sparse_mat
|
||
12 years ago
|
!! \see psb_d_base_mat_mod::psb_d_base_scals
|
||
15 years ago
|
interface
|
||
10 years ago
|
subroutine psb_d_xyz_scals(d,a,info)
|
||
|
import :: psb_ipk_, psb_d_xyz_sparse_mat, psb_dpk_
|
||
|
class(psb_d_xyz_sparse_mat), intent(inout) :: a
|
||
15 years ago
|
real(psb_dpk_), intent(in) :: d
|
||
13 years ago
|
integer(psb_ipk_), intent(out) :: info
|
||
10 years ago
|
end subroutine psb_d_xyz_scals
|
||
16 years ago
|
end interface
|
||
|
|
||
16 years ago
|
|
||
|
|
||
|
contains
|
||
|
|
||
15 years ago
|
! == ===================================
|
||
16 years ago
|
!
|
||
|
!
|
||
|
!
|
||
|
! Getters
|
||
|
!
|
||
|
!
|
||
|
!
|
||
|
!
|
||
|
!
|
||
15 years ago
|
! == ===================================
|
||
16 years ago
|
|
||
15 years ago
|
|
||
10 years ago
|
function d_xyz_sizeof(a) result(res)
|
||
15 years ago
|
implicit none
|
||
10 years ago
|
class(psb_d_xyz_sparse_mat), intent(in) :: a
|
||
15 years ago
|
integer(psb_long_int_k_) :: res
|
||
|
res = 8
|
||
|
res = res + psb_sizeof_dp * size(a%val)
|
||
|
res = res + psb_sizeof_int * size(a%irp)
|
||
|
res = res + psb_sizeof_int * size(a%ja)
|
||
|
|
||
10 years ago
|
end function d_xyz_sizeof
|
||
15 years ago
|
|
||
10 years ago
|
function d_xyz_get_fmt() result(res)
|
||
16 years ago
|
implicit none
|
||
|
character(len=5) :: res
|
||
10 years ago
|
res = 'XYZ'
|
||
|
end function d_xyz_get_fmt
|
||
16 years ago
|
|
||
10 years ago
|
function d_xyz_get_nzeros(a) result(res)
|
||
16 years ago
|
implicit none
|
||
10 years ago
|
class(psb_d_xyz_sparse_mat), intent(in) :: a
|
||
13 years ago
|
integer(psb_ipk_) :: res
|
||
15 years ago
|
res = a%irp(a%get_nrows()+1)-1
|
||
10 years ago
|
end function d_xyz_get_nzeros
|
||
16 years ago
|
|
||
10 years ago
|
function d_xyz_get_size(a) result(res)
|
||
16 years ago
|
implicit none
|
||
10 years ago
|
class(psb_d_xyz_sparse_mat), intent(in) :: a
|
||
13 years ago
|
integer(psb_ipk_) :: res
|
||
16 years ago
|
|
||
|
res = -1
|
||
|
|
||
|
if (allocated(a%ja)) then
|
||
12 years ago
|
res = size(a%ja)
|
||
16 years ago
|
end if
|
||
|
if (allocated(a%val)) then
|
||
|
if (res >= 0) then
|
||
|
res = min(res,size(a%val))
|
||
|
else
|
||
|
res = size(a%val)
|
||
|
end if
|
||
|
end if
|
||
|
|
||
10 years ago
|
end function d_xyz_get_size
|
||
16 years ago
|
|
||
15 years ago
|
|
||
|
|
||
10 years ago
|
function d_xyz_get_nz_row(idx,a) result(res)
|
||
15 years ago
|
|
||
15 years ago
|
implicit none
|
||
|
|
||
10 years ago
|
class(psb_d_xyz_sparse_mat), intent(in) :: a
|
||
13 years ago
|
integer(psb_ipk_), intent(in) :: idx
|
||
|
integer(psb_ipk_) :: res
|
||
15 years ago
|
|
||
|
res = 0
|
||
|
|
||
|
if ((1<=idx).and.(idx<=a%get_nrows())) then
|
||
|
res = a%irp(idx+1)-a%irp(idx)
|
||
|
end if
|
||
|
|
||
10 years ago
|
end function d_xyz_get_nz_row
|
||
15 years ago
|
|
||
|
|
||
|
|
||
15 years ago
|
! == ===================================
|
||
16 years ago
|
!
|
||
|
!
|
||
|
!
|
||
|
! Data management
|
||
|
!
|
||
|
!
|
||
|
!
|
||
|
!
|
||
|
!
|
||
15 years ago
|
! == ===================================
|
||
16 years ago
|
|
||
10 years ago
|
subroutine d_xyz_free(a)
|
||
16 years ago
|
implicit none
|
||
|
|
||
10 years ago
|
class(psb_d_xyz_sparse_mat), intent(inout) :: a
|
||
16 years ago
|
|
||
|
if (allocated(a%irp)) deallocate(a%irp)
|
||
|
if (allocated(a%ja)) deallocate(a%ja)
|
||
|
if (allocated(a%val)) deallocate(a%val)
|
||
|
call a%set_null()
|
||
12 years ago
|
call a%set_nrows(izero)
|
||
|
call a%set_ncols(izero)
|
||
16 years ago
|
|
||
|
return
|
||
|
|
||
10 years ago
|
end subroutine d_xyz_free
|
||
16 years ago
|
|
||
16 years ago
|
|
||
10 years ago
|
end module psb_d_xyz_mat_mod
|