mirror of
https://github.com/sfilippone/psblas3.git
synced 2026-10-20 04:42:08 +00:00
merge with unify_agg_build
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -167,6 +167,7 @@ module psb_c_base_mat_mod
|
||||
procedure, pass(a) :: sizeof => c_coo_sizeof
|
||||
procedure, pass(a) :: reallocate_nz => psb_c_coo_reallocate_nz
|
||||
procedure, pass(a) :: allocate_mnnz => psb_c_coo_allocate_mnnz
|
||||
procedure, pass(a) :: ensure_size => psb_c_coo_ensure_size
|
||||
procedure, pass(a) :: cp_to_coo => psb_c_cp_coo_to_coo
|
||||
procedure, pass(a) :: cp_from_coo => psb_c_cp_coo_from_coo
|
||||
procedure, pass(a) :: cp_to_fmt => psb_c_cp_coo_to_fmt
|
||||
@@ -191,6 +192,7 @@ module psb_c_base_mat_mod
|
||||
procedure, pass(a) :: fix => psb_c_fix_coo
|
||||
procedure, pass(a) :: trim => psb_c_coo_trim
|
||||
procedure, pass(a) :: clean_zeros => psb_c_coo_clean_zeros
|
||||
procedure, pass(a) :: clean_negidx => psb_c_coo_clean_negidx
|
||||
procedure, pass(a) :: print => psb_c_coo_print
|
||||
procedure, pass(a) :: free => c_coo_free
|
||||
procedure, pass(a) :: mold => psb_c_coo_mold
|
||||
@@ -360,6 +362,7 @@ module psb_c_base_mat_mod
|
||||
procedure, pass(a) :: sizeof => lc_coo_sizeof
|
||||
procedure, pass(a) :: reallocate_nz => psb_lc_coo_reallocate_nz
|
||||
procedure, pass(a) :: allocate_mnnz => psb_lc_coo_allocate_mnnz
|
||||
procedure, pass(a) :: ensure_size => psb_lc_coo_ensure_size
|
||||
procedure, pass(a) :: cp_to_coo => psb_lc_cp_coo_to_coo
|
||||
procedure, pass(a) :: cp_from_coo => psb_lc_cp_coo_from_coo
|
||||
procedure, pass(a) :: cp_to_fmt => psb_lc_cp_coo_to_fmt
|
||||
@@ -380,6 +383,7 @@ module psb_c_base_mat_mod
|
||||
procedure, pass(a) :: fix => psb_lc_fix_coo
|
||||
procedure, pass(a) :: trim => psb_lc_coo_trim
|
||||
procedure, pass(a) :: clean_zeros => psb_lc_coo_clean_zeros
|
||||
procedure, pass(a) :: clean_negidx => psb_lc_coo_clean_negidx
|
||||
procedure, pass(a) :: print => psb_lc_coo_print
|
||||
procedure, pass(a) :: free => lc_coo_free
|
||||
procedure, pass(a) :: mold => psb_lc_coo_mold
|
||||
@@ -1678,6 +1682,17 @@ module psb_c_base_mat_mod
|
||||
class(psb_c_coo_sparse_mat), intent(inout) :: a
|
||||
end subroutine psb_c_coo_reallocate_nz
|
||||
end interface
|
||||
!
|
||||
!>
|
||||
!! \memberof psb_c_coo_sparse_mat
|
||||
!
|
||||
interface
|
||||
subroutine psb_c_coo_ensure_size(nz,a)
|
||||
import
|
||||
integer(psb_ipk_), intent(in) :: nz
|
||||
class(psb_c_coo_sparse_mat), intent(inout) :: a
|
||||
end subroutine psb_c_coo_ensure_size
|
||||
end interface
|
||||
|
||||
!
|
||||
!>
|
||||
@@ -1715,6 +1730,46 @@ module psb_c_base_mat_mod
|
||||
end subroutine psb_c_coo_clean_zeros
|
||||
end interface
|
||||
|
||||
!
|
||||
!>
|
||||
!! \memberof psb_c_coo_sparse_mat
|
||||
!! \brief Take out any entries with negative row or column index
|
||||
!! May happen when converting local/global numbering
|
||||
!! \param info return code
|
||||
!!
|
||||
!
|
||||
interface
|
||||
subroutine psb_c_coo_clean_negidx(a,info)
|
||||
import
|
||||
class(psb_c_coo_sparse_mat), intent(inout) :: a
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
end subroutine psb_c_coo_clean_negidx
|
||||
end interface
|
||||
|
||||
!
|
||||
!> Funtion: coo_clean_negidx_inner
|
||||
!! \brief Take out any entries with negative row or column index
|
||||
!! Used internally by coo_clean_negidx
|
||||
!! \param nzin Number of entries on input to be handled
|
||||
!! \param ia(:) Row indices
|
||||
!! \param ja(:) Col indices
|
||||
!! \param val(:) Coefficients
|
||||
!! \param nzout Number of entries after sorting/duplicate handling
|
||||
!! \param info return code
|
||||
!!
|
||||
!
|
||||
interface psb_coo_clean_negidx_inner
|
||||
subroutine psb_c_coo_clean_negidx_inner(nzin,ia,ja,val,nzout,info)
|
||||
import
|
||||
integer(psb_ipk_), intent(in) :: nzin
|
||||
integer(psb_ipk_), intent(inout) :: ia(:), ja(:)
|
||||
complex(psb_spk_), intent(inout) :: val(:)
|
||||
integer(psb_ipk_), intent(out) :: nzout
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
end subroutine psb_c_coo_clean_negidx_inner
|
||||
end interface psb_coo_clean_negidx_inner
|
||||
|
||||
|
||||
!
|
||||
!>
|
||||
!! \memberof psb_c_coo_sparse_mat
|
||||
@@ -1759,9 +1814,9 @@ module psb_c_base_mat_mod
|
||||
import
|
||||
integer(psb_ipk_), intent(in) :: iout
|
||||
class(psb_c_coo_sparse_mat), intent(in) :: a
|
||||
integer(psb_ipk_), intent(in), optional :: iv(:)
|
||||
integer(psb_lpk_), intent(in), optional :: iv(:)
|
||||
character(len=*), optional :: head
|
||||
integer(psb_ipk_), intent(in), optional :: ivr(:), ivc(:)
|
||||
integer(psb_lpk_), intent(in), optional :: ivr(:), ivc(:)
|
||||
end subroutine psb_c_coo_print
|
||||
end interface
|
||||
|
||||
@@ -3279,6 +3334,17 @@ module psb_c_base_mat_mod
|
||||
class(psb_lc_coo_sparse_mat), intent(inout) :: a
|
||||
end subroutine psb_lc_coo_reallocate_nz
|
||||
end interface
|
||||
!
|
||||
!>
|
||||
!! \memberof psb_lc_coo_sparse_mat
|
||||
!
|
||||
interface
|
||||
subroutine psb_lc_coo_ensure_size(nz,a)
|
||||
import
|
||||
integer(psb_lpk_), intent(in) :: nz
|
||||
class(psb_lc_coo_sparse_mat), intent(inout) :: a
|
||||
end subroutine psb_lc_coo_ensure_size
|
||||
end interface
|
||||
|
||||
!
|
||||
!>
|
||||
@@ -3316,6 +3382,46 @@ module psb_c_base_mat_mod
|
||||
end subroutine psb_lc_coo_clean_zeros
|
||||
end interface
|
||||
|
||||
!
|
||||
!>
|
||||
!! \memberof psb_lc_coo_sparse_mat
|
||||
!! \brief Take out any entries with negative row or column index
|
||||
!! May happen when converting local/global numbering
|
||||
!! \param info return code
|
||||
!!
|
||||
!
|
||||
interface
|
||||
subroutine psb_lc_coo_clean_negidx(a,info)
|
||||
import
|
||||
class(psb_lc_coo_sparse_mat), intent(inout) :: a
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
end subroutine psb_lc_coo_clean_negidx
|
||||
end interface
|
||||
|
||||
#if defined(IPK4) && defined(LPK8)
|
||||
!
|
||||
!> Funtion: coo_clean_negidx_inner
|
||||
!! \brief Take out any entries with negative row or column index
|
||||
!! Used internally by coo_clean_negidx
|
||||
!! \param nzin Number of entries on input to be handled
|
||||
!! \param ia(:) Row indices
|
||||
!! \param ja(:) Col indices
|
||||
!! \param val(:) Coefficients
|
||||
!! \param nzout Number of entries after sorting/duplicate handling
|
||||
!! \param info return code
|
||||
!!
|
||||
!
|
||||
interface psb_coo_clean_negidx_inner
|
||||
subroutine psb_lc_coo_clean_negidx_inner(nzin,ia,ja,val,nzout,info)
|
||||
import
|
||||
integer(psb_lpk_), intent(in) :: nzin
|
||||
integer(psb_lpk_), intent(inout) :: ia(:), ja(:)
|
||||
complex(psb_spk_), intent(inout) :: val(:)
|
||||
integer(psb_lpk_), intent(out) :: nzout
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
end subroutine psb_lc_coo_clean_negidx_inner
|
||||
end interface psb_coo_clean_negidx_inner
|
||||
#endif
|
||||
!
|
||||
!>
|
||||
!! \memberof psb_lc_coo_sparse_mat
|
||||
@@ -3674,6 +3780,8 @@ module psb_c_base_mat_mod
|
||||
end subroutine psb_lc_coo_scals
|
||||
end interface
|
||||
|
||||
public :: psb_c_get_print_frmt, psb_lc_get_print_frmt
|
||||
|
||||
!>
|
||||
!! \memberof psb_lc_coo_sparse_mat
|
||||
!! \see psb_lc_base_mat_mod::psb_lc_base_scalplusidentity
|
||||
@@ -3729,6 +3837,56 @@ module psb_c_base_mat_mod
|
||||
|
||||
contains
|
||||
|
||||
function psb_c_get_print_frmt(nr,nc,nz,iv,ivr,ivc) result(frmt)
|
||||
|
||||
implicit none
|
||||
character(len=80) :: frmt
|
||||
integer(psb_ipk_), intent(in) :: nr, nc, nz
|
||||
integer(psb_lpk_), intent(in), optional :: iv(:)
|
||||
integer(psb_lpk_), intent(in), optional :: ivr(:), ivc(:)
|
||||
!
|
||||
character(len=*), parameter :: datatype='complex'
|
||||
integer(psb_lpk_) :: nmx
|
||||
integer(psb_ipk_) :: ni
|
||||
nmx = max(nr,nc,ione)
|
||||
if (present(iv)) nmx = max(nmx,maxval(abs(iv(1:nc))))
|
||||
if (present(ivr)) nmx = max(nmx,maxval(abs(ivr(1:nr))))
|
||||
if (present(ivc)) nmx = max(nmx,maxval(abs(ivc(1:nc))))
|
||||
ni = floor(log10(1.0*nmx)) + 2
|
||||
|
||||
if (datatype=='complex') then
|
||||
write(frmt,'(a,i3.3,a,i3.3,a)') '(2(i',ni,',1x),2(es26.18,1x),2(i',ni,',1x))'
|
||||
else
|
||||
write(frmt,'(a,i3.3,a,i3.3,a)') '(2(i',ni,',1x),es26.18,1x,2(i',ni,',1x))'
|
||||
end if
|
||||
|
||||
end function psb_c_get_print_frmt
|
||||
|
||||
function psb_lc_get_print_frmt(nr,nc,nz,iv,ivr,ivc) result(frmt)
|
||||
|
||||
implicit none
|
||||
character(len=80) :: frmt
|
||||
integer(psb_lpk_), intent(in) :: nr, nc, nz
|
||||
integer(psb_lpk_), intent(in), optional :: iv(:)
|
||||
integer(psb_lpk_), intent(in), optional :: ivr(:), ivc(:)
|
||||
!
|
||||
character(len=*), parameter :: datatype='complex'
|
||||
integer(psb_lpk_) :: nmx
|
||||
integer(psb_lpk_) :: ni
|
||||
nmx = max(nr,nc,lone)
|
||||
if (present(iv)) nmx = max(nmx,maxval(abs(iv(1:nc))))
|
||||
if (present(ivr)) nmx = max(nmx,maxval(abs(ivr(1:nr))))
|
||||
if (present(ivc)) nmx = max(nmx,maxval(abs(ivc(1:nc))))
|
||||
ni = floor(log10(1.0*nmx)) + 2
|
||||
|
||||
if (datatype=='complex') then
|
||||
write(frmt,'(a,i3.3,a,i3.3,a)') '(2(i',ni,',1x),2(es26.18,1x),2(i',ni,',1x))'
|
||||
else
|
||||
write(frmt,'(a,i3.3,a,i3.3,a)') '(2(i',ni,',1x),es26.18,1x,2(i',ni,',1x))'
|
||||
end if
|
||||
|
||||
end function psb_lc_get_print_frmt
|
||||
|
||||
|
||||
! == ==================================
|
||||
!
|
||||
|
||||
@@ -219,9 +219,9 @@ module psb_c_csc_mat_mod
|
||||
import
|
||||
integer(psb_ipk_), intent(in) :: iout
|
||||
class(psb_c_csc_sparse_mat), intent(in) :: a
|
||||
integer(psb_ipk_), intent(in), optional :: iv(:)
|
||||
integer(psb_lpk_), intent(in), optional :: iv(:)
|
||||
character(len=*), optional :: head
|
||||
integer(psb_ipk_), intent(in), optional :: ivr(:), ivc(:)
|
||||
integer(psb_lpk_), intent(in), optional :: ivr(:), ivc(:)
|
||||
end subroutine psb_c_csc_print
|
||||
end interface
|
||||
|
||||
|
||||
@@ -169,9 +169,9 @@ module psb_c_csr_mat_mod
|
||||
import
|
||||
integer(psb_ipk_), intent(in) :: iout
|
||||
class(psb_c_csr_sparse_mat), intent(in) :: a
|
||||
integer(psb_ipk_), intent(in), optional :: iv(:)
|
||||
integer(psb_lpk_), intent(in), optional :: iv(:)
|
||||
character(len=*), optional :: head
|
||||
integer(psb_ipk_), intent(in), optional :: ivr(:), ivc(:)
|
||||
integer(psb_lpk_), intent(in), optional :: ivr(:), ivc(:)
|
||||
end subroutine psb_c_csr_print
|
||||
end interface
|
||||
!
|
||||
|
||||
@@ -145,8 +145,9 @@ module psb_c_mat_mod
|
||||
procedure, pass(a) :: tril => psb_c_tril
|
||||
procedure, pass(a) :: triu => psb_c_triu
|
||||
procedure, pass(a) :: m_csclip => psb_c_csclip
|
||||
procedure, pass(a) :: m_csclip_ip => psb_c_csclip_ip
|
||||
procedure, pass(a) :: b_csclip => psb_c_b_csclip
|
||||
generic, public :: csclip => b_csclip, m_csclip
|
||||
generic, public :: csclip => b_csclip, m_csclip, m_csclip_ip
|
||||
procedure, pass(a) :: clean_zeros => psb_c_clean_zeros
|
||||
procedure, pass(a) :: reall => psb_c_reallocate_nz
|
||||
procedure, pass(a) :: get_neigh => psb_c_get_neigh
|
||||
@@ -342,8 +343,9 @@ module psb_c_mat_mod
|
||||
procedure, pass(a) :: tril => psb_lc_tril
|
||||
procedure, pass(a) :: triu => psb_lc_triu
|
||||
procedure, pass(a) :: m_csclip => psb_lc_csclip
|
||||
procedure, pass(a) :: m_csclip_ip => psb_lc_csclip_ip
|
||||
procedure, pass(a) :: b_csclip => psb_lc_b_csclip
|
||||
generic, public :: csclip => b_csclip, m_csclip
|
||||
generic, public :: csclip => b_csclip, m_csclip, m_csclip_ip
|
||||
procedure, pass(a) :: clean_zeros => psb_lc_clean_zeros
|
||||
procedure, pass(a) :: reall => psb_lc_reallocate_nz
|
||||
procedure, pass(a) :: get_neigh => psb_lc_get_neigh
|
||||
@@ -573,9 +575,9 @@ module psb_c_mat_mod
|
||||
import :: psb_ipk_, psb_lpk_, psb_cspmat_type
|
||||
integer(psb_ipk_), intent(in) :: iout
|
||||
class(psb_cspmat_type), intent(in) :: a
|
||||
integer(psb_ipk_), intent(in), optional :: iv(:)
|
||||
integer(psb_lpk_), intent(in), optional :: iv(:)
|
||||
character(len=*), optional :: head
|
||||
integer(psb_ipk_), intent(in), optional :: ivr(:), ivc(:)
|
||||
integer(psb_lpk_), intent(in), optional :: ivr(:), ivc(:)
|
||||
end subroutine psb_c_sparse_print
|
||||
end interface
|
||||
|
||||
@@ -584,9 +586,9 @@ module psb_c_mat_mod
|
||||
import :: psb_ipk_, psb_lpk_, psb_cspmat_type
|
||||
character(len=*), intent(in) :: fname
|
||||
class(psb_cspmat_type), intent(in) :: a
|
||||
integer(psb_ipk_), intent(in), optional :: iv(:)
|
||||
integer(psb_lpk_), intent(in), optional :: iv(:)
|
||||
character(len=*), optional :: head
|
||||
integer(psb_ipk_), intent(in), optional :: ivr(:), ivc(:)
|
||||
integer(psb_lpk_), intent(in), optional :: ivr(:), ivc(:)
|
||||
end subroutine psb_c_n_sparse_print
|
||||
end interface
|
||||
|
||||
@@ -745,6 +747,17 @@ module psb_c_mat_mod
|
||||
end subroutine psb_c_csclip
|
||||
end interface
|
||||
|
||||
interface
|
||||
subroutine psb_c_csclip_ip(a,info,&
|
||||
& imin,imax,jmin,jmax,rscale,cscale)
|
||||
import :: psb_ipk_, psb_lpk_, psb_cspmat_type, psb_spk_
|
||||
class(psb_cspmat_type), intent(inout) :: a
|
||||
integer(psb_ipk_),intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: imin,imax,jmin,jmax
|
||||
logical, intent(in), optional :: rscale,cscale
|
||||
end subroutine psb_c_csclip_ip
|
||||
end interface
|
||||
|
||||
interface
|
||||
subroutine psb_c_b_csclip(a,b,info,&
|
||||
& imin,imax,jmin,jmax,rscale,cscale)
|
||||
@@ -1514,6 +1527,17 @@ module psb_c_mat_mod
|
||||
end subroutine psb_lc_csclip
|
||||
end interface
|
||||
|
||||
interface
|
||||
subroutine psb_lc_csclip_ip(a,info,&
|
||||
& imin,imax,jmin,jmax,rscale,cscale)
|
||||
import :: psb_ipk_, psb_lpk_, psb_lcspmat_type, psb_spk_
|
||||
class(psb_lcspmat_type), intent(inout) :: a
|
||||
integer(psb_ipk_),intent(out) :: info
|
||||
integer(psb_lpk_), intent(in), optional :: imin,imax,jmin,jmax
|
||||
logical, intent(in), optional :: rscale,cscale
|
||||
end subroutine psb_lc_csclip_ip
|
||||
end interface
|
||||
|
||||
interface
|
||||
subroutine psb_lc_b_csclip(a,b,info,&
|
||||
& imin,imax,jmin,jmax,rscale,cscale)
|
||||
|
||||
@@ -292,9 +292,9 @@ contains
|
||||
use psb_c_mat_mod, only : psb_cspmat_type
|
||||
integer(psb_ipk_), intent(in) :: iout
|
||||
type(psb_cspmat_type), intent(in) :: a
|
||||
integer(psb_ipk_), intent(in), optional :: iv(:)
|
||||
integer(psb_lpk_), intent(in), optional :: iv(:)
|
||||
character(len=*), optional :: head
|
||||
integer(psb_ipk_), intent(in), optional :: ivr(:),ivc(:)
|
||||
integer(psb_lpk_), intent(in), optional :: ivr(:),ivc(:)
|
||||
|
||||
call a%print(iout,iv,head,ivr,ivc)
|
||||
|
||||
@@ -304,9 +304,9 @@ contains
|
||||
use psb_c_mat_mod, only : psb_cspmat_type
|
||||
character(len=*), intent(in) :: fname
|
||||
type(psb_cspmat_type), intent(in) :: a
|
||||
integer(psb_ipk_), intent(in), optional :: iv(:)
|
||||
integer(psb_lpk_), intent(in), optional :: iv(:)
|
||||
character(len=*), optional :: head
|
||||
integer(psb_ipk_), intent(in), optional :: ivr(:),ivc(:)
|
||||
integer(psb_lpk_), intent(in), optional :: ivr(:),ivc(:)
|
||||
|
||||
call a%print(fname,iv,head,ivr,ivc)
|
||||
|
||||
|
||||
@@ -167,6 +167,7 @@ module psb_d_base_mat_mod
|
||||
procedure, pass(a) :: sizeof => d_coo_sizeof
|
||||
procedure, pass(a) :: reallocate_nz => psb_d_coo_reallocate_nz
|
||||
procedure, pass(a) :: allocate_mnnz => psb_d_coo_allocate_mnnz
|
||||
procedure, pass(a) :: ensure_size => psb_d_coo_ensure_size
|
||||
procedure, pass(a) :: cp_to_coo => psb_d_cp_coo_to_coo
|
||||
procedure, pass(a) :: cp_from_coo => psb_d_cp_coo_from_coo
|
||||
procedure, pass(a) :: cp_to_fmt => psb_d_cp_coo_to_fmt
|
||||
@@ -191,6 +192,7 @@ module psb_d_base_mat_mod
|
||||
procedure, pass(a) :: fix => psb_d_fix_coo
|
||||
procedure, pass(a) :: trim => psb_d_coo_trim
|
||||
procedure, pass(a) :: clean_zeros => psb_d_coo_clean_zeros
|
||||
procedure, pass(a) :: clean_negidx => psb_d_coo_clean_negidx
|
||||
procedure, pass(a) :: print => psb_d_coo_print
|
||||
procedure, pass(a) :: free => d_coo_free
|
||||
procedure, pass(a) :: mold => psb_d_coo_mold
|
||||
@@ -360,6 +362,7 @@ module psb_d_base_mat_mod
|
||||
procedure, pass(a) :: sizeof => ld_coo_sizeof
|
||||
procedure, pass(a) :: reallocate_nz => psb_ld_coo_reallocate_nz
|
||||
procedure, pass(a) :: allocate_mnnz => psb_ld_coo_allocate_mnnz
|
||||
procedure, pass(a) :: ensure_size => psb_ld_coo_ensure_size
|
||||
procedure, pass(a) :: cp_to_coo => psb_ld_cp_coo_to_coo
|
||||
procedure, pass(a) :: cp_from_coo => psb_ld_cp_coo_from_coo
|
||||
procedure, pass(a) :: cp_to_fmt => psb_ld_cp_coo_to_fmt
|
||||
@@ -380,6 +383,7 @@ module psb_d_base_mat_mod
|
||||
procedure, pass(a) :: fix => psb_ld_fix_coo
|
||||
procedure, pass(a) :: trim => psb_ld_coo_trim
|
||||
procedure, pass(a) :: clean_zeros => psb_ld_coo_clean_zeros
|
||||
procedure, pass(a) :: clean_negidx => psb_ld_coo_clean_negidx
|
||||
procedure, pass(a) :: print => psb_ld_coo_print
|
||||
procedure, pass(a) :: free => ld_coo_free
|
||||
procedure, pass(a) :: mold => psb_ld_coo_mold
|
||||
@@ -1678,6 +1682,17 @@ module psb_d_base_mat_mod
|
||||
class(psb_d_coo_sparse_mat), intent(inout) :: a
|
||||
end subroutine psb_d_coo_reallocate_nz
|
||||
end interface
|
||||
!
|
||||
!>
|
||||
!! \memberof psb_d_coo_sparse_mat
|
||||
!
|
||||
interface
|
||||
subroutine psb_d_coo_ensure_size(nz,a)
|
||||
import
|
||||
integer(psb_ipk_), intent(in) :: nz
|
||||
class(psb_d_coo_sparse_mat), intent(inout) :: a
|
||||
end subroutine psb_d_coo_ensure_size
|
||||
end interface
|
||||
|
||||
!
|
||||
!>
|
||||
@@ -1715,6 +1730,46 @@ module psb_d_base_mat_mod
|
||||
end subroutine psb_d_coo_clean_zeros
|
||||
end interface
|
||||
|
||||
!
|
||||
!>
|
||||
!! \memberof psb_d_coo_sparse_mat
|
||||
!! \brief Take out any entries with negative row or column index
|
||||
!! May happen when converting local/global numbering
|
||||
!! \param info return code
|
||||
!!
|
||||
!
|
||||
interface
|
||||
subroutine psb_d_coo_clean_negidx(a,info)
|
||||
import
|
||||
class(psb_d_coo_sparse_mat), intent(inout) :: a
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
end subroutine psb_d_coo_clean_negidx
|
||||
end interface
|
||||
|
||||
!
|
||||
!> Funtion: coo_clean_negidx_inner
|
||||
!! \brief Take out any entries with negative row or column index
|
||||
!! Used internally by coo_clean_negidx
|
||||
!! \param nzin Number of entries on input to be handled
|
||||
!! \param ia(:) Row indices
|
||||
!! \param ja(:) Col indices
|
||||
!! \param val(:) Coefficients
|
||||
!! \param nzout Number of entries after sorting/duplicate handling
|
||||
!! \param info return code
|
||||
!!
|
||||
!
|
||||
interface psb_coo_clean_negidx_inner
|
||||
subroutine psb_d_coo_clean_negidx_inner(nzin,ia,ja,val,nzout,info)
|
||||
import
|
||||
integer(psb_ipk_), intent(in) :: nzin
|
||||
integer(psb_ipk_), intent(inout) :: ia(:), ja(:)
|
||||
real(psb_dpk_), intent(inout) :: val(:)
|
||||
integer(psb_ipk_), intent(out) :: nzout
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
end subroutine psb_d_coo_clean_negidx_inner
|
||||
end interface psb_coo_clean_negidx_inner
|
||||
|
||||
|
||||
!
|
||||
!>
|
||||
!! \memberof psb_d_coo_sparse_mat
|
||||
@@ -1759,9 +1814,9 @@ module psb_d_base_mat_mod
|
||||
import
|
||||
integer(psb_ipk_), intent(in) :: iout
|
||||
class(psb_d_coo_sparse_mat), intent(in) :: a
|
||||
integer(psb_ipk_), intent(in), optional :: iv(:)
|
||||
integer(psb_lpk_), intent(in), optional :: iv(:)
|
||||
character(len=*), optional :: head
|
||||
integer(psb_ipk_), intent(in), optional :: ivr(:), ivc(:)
|
||||
integer(psb_lpk_), intent(in), optional :: ivr(:), ivc(:)
|
||||
end subroutine psb_d_coo_print
|
||||
end interface
|
||||
|
||||
@@ -3279,6 +3334,17 @@ module psb_d_base_mat_mod
|
||||
class(psb_ld_coo_sparse_mat), intent(inout) :: a
|
||||
end subroutine psb_ld_coo_reallocate_nz
|
||||
end interface
|
||||
!
|
||||
!>
|
||||
!! \memberof psb_ld_coo_sparse_mat
|
||||
!
|
||||
interface
|
||||
subroutine psb_ld_coo_ensure_size(nz,a)
|
||||
import
|
||||
integer(psb_lpk_), intent(in) :: nz
|
||||
class(psb_ld_coo_sparse_mat), intent(inout) :: a
|
||||
end subroutine psb_ld_coo_ensure_size
|
||||
end interface
|
||||
|
||||
!
|
||||
!>
|
||||
@@ -3316,6 +3382,46 @@ module psb_d_base_mat_mod
|
||||
end subroutine psb_ld_coo_clean_zeros
|
||||
end interface
|
||||
|
||||
!
|
||||
!>
|
||||
!! \memberof psb_ld_coo_sparse_mat
|
||||
!! \brief Take out any entries with negative row or column index
|
||||
!! May happen when converting local/global numbering
|
||||
!! \param info return code
|
||||
!!
|
||||
!
|
||||
interface
|
||||
subroutine psb_ld_coo_clean_negidx(a,info)
|
||||
import
|
||||
class(psb_ld_coo_sparse_mat), intent(inout) :: a
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
end subroutine psb_ld_coo_clean_negidx
|
||||
end interface
|
||||
|
||||
#if defined(IPK4) && defined(LPK8)
|
||||
!
|
||||
!> Funtion: coo_clean_negidx_inner
|
||||
!! \brief Take out any entries with negative row or column index
|
||||
!! Used internally by coo_clean_negidx
|
||||
!! \param nzin Number of entries on input to be handled
|
||||
!! \param ia(:) Row indices
|
||||
!! \param ja(:) Col indices
|
||||
!! \param val(:) Coefficients
|
||||
!! \param nzout Number of entries after sorting/duplicate handling
|
||||
!! \param info return code
|
||||
!!
|
||||
!
|
||||
interface psb_coo_clean_negidx_inner
|
||||
subroutine psb_ld_coo_clean_negidx_inner(nzin,ia,ja,val,nzout,info)
|
||||
import
|
||||
integer(psb_lpk_), intent(in) :: nzin
|
||||
integer(psb_lpk_), intent(inout) :: ia(:), ja(:)
|
||||
real(psb_dpk_), intent(inout) :: val(:)
|
||||
integer(psb_lpk_), intent(out) :: nzout
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
end subroutine psb_ld_coo_clean_negidx_inner
|
||||
end interface psb_coo_clean_negidx_inner
|
||||
#endif
|
||||
!
|
||||
!>
|
||||
!! \memberof psb_ld_coo_sparse_mat
|
||||
@@ -3674,6 +3780,8 @@ module psb_d_base_mat_mod
|
||||
end subroutine psb_ld_coo_scals
|
||||
end interface
|
||||
|
||||
public :: psb_d_get_print_frmt, psb_ld_get_print_frmt
|
||||
|
||||
!>
|
||||
!! \memberof psb_ld_coo_sparse_mat
|
||||
!! \see psb_ld_base_mat_mod::psb_ld_base_scalplusidentity
|
||||
@@ -3729,6 +3837,56 @@ module psb_d_base_mat_mod
|
||||
|
||||
contains
|
||||
|
||||
function psb_d_get_print_frmt(nr,nc,nz,iv,ivr,ivc) result(frmt)
|
||||
|
||||
implicit none
|
||||
character(len=80) :: frmt
|
||||
integer(psb_ipk_), intent(in) :: nr, nc, nz
|
||||
integer(psb_lpk_), intent(in), optional :: iv(:)
|
||||
integer(psb_lpk_), intent(in), optional :: ivr(:), ivc(:)
|
||||
!
|
||||
character(len=*), parameter :: datatype='real'
|
||||
integer(psb_lpk_) :: nmx
|
||||
integer(psb_ipk_) :: ni
|
||||
nmx = max(nr,nc,ione)
|
||||
if (present(iv)) nmx = max(nmx,maxval(abs(iv(1:nc))))
|
||||
if (present(ivr)) nmx = max(nmx,maxval(abs(ivr(1:nr))))
|
||||
if (present(ivc)) nmx = max(nmx,maxval(abs(ivc(1:nc))))
|
||||
ni = floor(log10(1.0*nmx)) + 2
|
||||
|
||||
if (datatype=='complex') then
|
||||
write(frmt,'(a,i3.3,a,i3.3,a)') '(2(i',ni,',1x),2(es26.18,1x),2(i',ni,',1x))'
|
||||
else
|
||||
write(frmt,'(a,i3.3,a,i3.3,a)') '(2(i',ni,',1x),es26.18,1x,2(i',ni,',1x))'
|
||||
end if
|
||||
|
||||
end function psb_d_get_print_frmt
|
||||
|
||||
function psb_ld_get_print_frmt(nr,nc,nz,iv,ivr,ivc) result(frmt)
|
||||
|
||||
implicit none
|
||||
character(len=80) :: frmt
|
||||
integer(psb_lpk_), intent(in) :: nr, nc, nz
|
||||
integer(psb_lpk_), intent(in), optional :: iv(:)
|
||||
integer(psb_lpk_), intent(in), optional :: ivr(:), ivc(:)
|
||||
!
|
||||
character(len=*), parameter :: datatype='real'
|
||||
integer(psb_lpk_) :: nmx
|
||||
integer(psb_lpk_) :: ni
|
||||
nmx = max(nr,nc,lone)
|
||||
if (present(iv)) nmx = max(nmx,maxval(abs(iv(1:nc))))
|
||||
if (present(ivr)) nmx = max(nmx,maxval(abs(ivr(1:nr))))
|
||||
if (present(ivc)) nmx = max(nmx,maxval(abs(ivc(1:nc))))
|
||||
ni = floor(log10(1.0*nmx)) + 2
|
||||
|
||||
if (datatype=='complex') then
|
||||
write(frmt,'(a,i3.3,a,i3.3,a)') '(2(i',ni,',1x),2(es26.18,1x),2(i',ni,',1x))'
|
||||
else
|
||||
write(frmt,'(a,i3.3,a,i3.3,a)') '(2(i',ni,',1x),es26.18,1x,2(i',ni,',1x))'
|
||||
end if
|
||||
|
||||
end function psb_ld_get_print_frmt
|
||||
|
||||
|
||||
! == ==================================
|
||||
!
|
||||
|
||||
@@ -219,9 +219,9 @@ module psb_d_csc_mat_mod
|
||||
import
|
||||
integer(psb_ipk_), intent(in) :: iout
|
||||
class(psb_d_csc_sparse_mat), intent(in) :: a
|
||||
integer(psb_ipk_), intent(in), optional :: iv(:)
|
||||
integer(psb_lpk_), intent(in), optional :: iv(:)
|
||||
character(len=*), optional :: head
|
||||
integer(psb_ipk_), intent(in), optional :: ivr(:), ivc(:)
|
||||
integer(psb_lpk_), intent(in), optional :: ivr(:), ivc(:)
|
||||
end subroutine psb_d_csc_print
|
||||
end interface
|
||||
|
||||
|
||||
@@ -169,9 +169,9 @@ module psb_d_csr_mat_mod
|
||||
import
|
||||
integer(psb_ipk_), intent(in) :: iout
|
||||
class(psb_d_csr_sparse_mat), intent(in) :: a
|
||||
integer(psb_ipk_), intent(in), optional :: iv(:)
|
||||
integer(psb_lpk_), intent(in), optional :: iv(:)
|
||||
character(len=*), optional :: head
|
||||
integer(psb_ipk_), intent(in), optional :: ivr(:), ivc(:)
|
||||
integer(psb_lpk_), intent(in), optional :: ivr(:), ivc(:)
|
||||
end subroutine psb_d_csr_print
|
||||
end interface
|
||||
!
|
||||
|
||||
@@ -145,8 +145,9 @@ module psb_d_mat_mod
|
||||
procedure, pass(a) :: tril => psb_d_tril
|
||||
procedure, pass(a) :: triu => psb_d_triu
|
||||
procedure, pass(a) :: m_csclip => psb_d_csclip
|
||||
procedure, pass(a) :: m_csclip_ip => psb_d_csclip_ip
|
||||
procedure, pass(a) :: b_csclip => psb_d_b_csclip
|
||||
generic, public :: csclip => b_csclip, m_csclip
|
||||
generic, public :: csclip => b_csclip, m_csclip, m_csclip_ip
|
||||
procedure, pass(a) :: clean_zeros => psb_d_clean_zeros
|
||||
procedure, pass(a) :: reall => psb_d_reallocate_nz
|
||||
procedure, pass(a) :: get_neigh => psb_d_get_neigh
|
||||
@@ -342,8 +343,9 @@ module psb_d_mat_mod
|
||||
procedure, pass(a) :: tril => psb_ld_tril
|
||||
procedure, pass(a) :: triu => psb_ld_triu
|
||||
procedure, pass(a) :: m_csclip => psb_ld_csclip
|
||||
procedure, pass(a) :: m_csclip_ip => psb_ld_csclip_ip
|
||||
procedure, pass(a) :: b_csclip => psb_ld_b_csclip
|
||||
generic, public :: csclip => b_csclip, m_csclip
|
||||
generic, public :: csclip => b_csclip, m_csclip, m_csclip_ip
|
||||
procedure, pass(a) :: clean_zeros => psb_ld_clean_zeros
|
||||
procedure, pass(a) :: reall => psb_ld_reallocate_nz
|
||||
procedure, pass(a) :: get_neigh => psb_ld_get_neigh
|
||||
@@ -573,9 +575,9 @@ module psb_d_mat_mod
|
||||
import :: psb_ipk_, psb_lpk_, psb_dspmat_type
|
||||
integer(psb_ipk_), intent(in) :: iout
|
||||
class(psb_dspmat_type), intent(in) :: a
|
||||
integer(psb_ipk_), intent(in), optional :: iv(:)
|
||||
integer(psb_lpk_), intent(in), optional :: iv(:)
|
||||
character(len=*), optional :: head
|
||||
integer(psb_ipk_), intent(in), optional :: ivr(:), ivc(:)
|
||||
integer(psb_lpk_), intent(in), optional :: ivr(:), ivc(:)
|
||||
end subroutine psb_d_sparse_print
|
||||
end interface
|
||||
|
||||
@@ -584,9 +586,9 @@ module psb_d_mat_mod
|
||||
import :: psb_ipk_, psb_lpk_, psb_dspmat_type
|
||||
character(len=*), intent(in) :: fname
|
||||
class(psb_dspmat_type), intent(in) :: a
|
||||
integer(psb_ipk_), intent(in), optional :: iv(:)
|
||||
integer(psb_lpk_), intent(in), optional :: iv(:)
|
||||
character(len=*), optional :: head
|
||||
integer(psb_ipk_), intent(in), optional :: ivr(:), ivc(:)
|
||||
integer(psb_lpk_), intent(in), optional :: ivr(:), ivc(:)
|
||||
end subroutine psb_d_n_sparse_print
|
||||
end interface
|
||||
|
||||
@@ -745,6 +747,17 @@ module psb_d_mat_mod
|
||||
end subroutine psb_d_csclip
|
||||
end interface
|
||||
|
||||
interface
|
||||
subroutine psb_d_csclip_ip(a,info,&
|
||||
& imin,imax,jmin,jmax,rscale,cscale)
|
||||
import :: psb_ipk_, psb_lpk_, psb_dspmat_type, psb_dpk_
|
||||
class(psb_dspmat_type), intent(inout) :: a
|
||||
integer(psb_ipk_),intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: imin,imax,jmin,jmax
|
||||
logical, intent(in), optional :: rscale,cscale
|
||||
end subroutine psb_d_csclip_ip
|
||||
end interface
|
||||
|
||||
interface
|
||||
subroutine psb_d_b_csclip(a,b,info,&
|
||||
& imin,imax,jmin,jmax,rscale,cscale)
|
||||
@@ -1514,6 +1527,17 @@ module psb_d_mat_mod
|
||||
end subroutine psb_ld_csclip
|
||||
end interface
|
||||
|
||||
interface
|
||||
subroutine psb_ld_csclip_ip(a,info,&
|
||||
& imin,imax,jmin,jmax,rscale,cscale)
|
||||
import :: psb_ipk_, psb_lpk_, psb_ldspmat_type, psb_dpk_
|
||||
class(psb_ldspmat_type), intent(inout) :: a
|
||||
integer(psb_ipk_),intent(out) :: info
|
||||
integer(psb_lpk_), intent(in), optional :: imin,imax,jmin,jmax
|
||||
logical, intent(in), optional :: rscale,cscale
|
||||
end subroutine psb_ld_csclip_ip
|
||||
end interface
|
||||
|
||||
interface
|
||||
subroutine psb_ld_b_csclip(a,b,info,&
|
||||
& imin,imax,jmin,jmax,rscale,cscale)
|
||||
|
||||
@@ -292,9 +292,9 @@ contains
|
||||
use psb_d_mat_mod, only : psb_dspmat_type
|
||||
integer(psb_ipk_), intent(in) :: iout
|
||||
type(psb_dspmat_type), intent(in) :: a
|
||||
integer(psb_ipk_), intent(in), optional :: iv(:)
|
||||
integer(psb_lpk_), intent(in), optional :: iv(:)
|
||||
character(len=*), optional :: head
|
||||
integer(psb_ipk_), intent(in), optional :: ivr(:),ivc(:)
|
||||
integer(psb_lpk_), intent(in), optional :: ivr(:),ivc(:)
|
||||
|
||||
call a%print(iout,iv,head,ivr,ivc)
|
||||
|
||||
@@ -304,9 +304,9 @@ contains
|
||||
use psb_d_mat_mod, only : psb_dspmat_type
|
||||
character(len=*), intent(in) :: fname
|
||||
type(psb_dspmat_type), intent(in) :: a
|
||||
integer(psb_ipk_), intent(in), optional :: iv(:)
|
||||
integer(psb_lpk_), intent(in), optional :: iv(:)
|
||||
character(len=*), optional :: head
|
||||
integer(psb_ipk_), intent(in), optional :: ivr(:),ivc(:)
|
||||
integer(psb_lpk_), intent(in), optional :: ivr(:),ivc(:)
|
||||
|
||||
call a%print(fname,iv,head,ivr,ivc)
|
||||
|
||||
|
||||
@@ -167,6 +167,7 @@ module psb_s_base_mat_mod
|
||||
procedure, pass(a) :: sizeof => s_coo_sizeof
|
||||
procedure, pass(a) :: reallocate_nz => psb_s_coo_reallocate_nz
|
||||
procedure, pass(a) :: allocate_mnnz => psb_s_coo_allocate_mnnz
|
||||
procedure, pass(a) :: ensure_size => psb_s_coo_ensure_size
|
||||
procedure, pass(a) :: cp_to_coo => psb_s_cp_coo_to_coo
|
||||
procedure, pass(a) :: cp_from_coo => psb_s_cp_coo_from_coo
|
||||
procedure, pass(a) :: cp_to_fmt => psb_s_cp_coo_to_fmt
|
||||
@@ -191,6 +192,7 @@ module psb_s_base_mat_mod
|
||||
procedure, pass(a) :: fix => psb_s_fix_coo
|
||||
procedure, pass(a) :: trim => psb_s_coo_trim
|
||||
procedure, pass(a) :: clean_zeros => psb_s_coo_clean_zeros
|
||||
procedure, pass(a) :: clean_negidx => psb_s_coo_clean_negidx
|
||||
procedure, pass(a) :: print => psb_s_coo_print
|
||||
procedure, pass(a) :: free => s_coo_free
|
||||
procedure, pass(a) :: mold => psb_s_coo_mold
|
||||
@@ -360,6 +362,7 @@ module psb_s_base_mat_mod
|
||||
procedure, pass(a) :: sizeof => ls_coo_sizeof
|
||||
procedure, pass(a) :: reallocate_nz => psb_ls_coo_reallocate_nz
|
||||
procedure, pass(a) :: allocate_mnnz => psb_ls_coo_allocate_mnnz
|
||||
procedure, pass(a) :: ensure_size => psb_ls_coo_ensure_size
|
||||
procedure, pass(a) :: cp_to_coo => psb_ls_cp_coo_to_coo
|
||||
procedure, pass(a) :: cp_from_coo => psb_ls_cp_coo_from_coo
|
||||
procedure, pass(a) :: cp_to_fmt => psb_ls_cp_coo_to_fmt
|
||||
@@ -380,6 +383,7 @@ module psb_s_base_mat_mod
|
||||
procedure, pass(a) :: fix => psb_ls_fix_coo
|
||||
procedure, pass(a) :: trim => psb_ls_coo_trim
|
||||
procedure, pass(a) :: clean_zeros => psb_ls_coo_clean_zeros
|
||||
procedure, pass(a) :: clean_negidx => psb_ls_coo_clean_negidx
|
||||
procedure, pass(a) :: print => psb_ls_coo_print
|
||||
procedure, pass(a) :: free => ls_coo_free
|
||||
procedure, pass(a) :: mold => psb_ls_coo_mold
|
||||
@@ -1678,6 +1682,17 @@ module psb_s_base_mat_mod
|
||||
class(psb_s_coo_sparse_mat), intent(inout) :: a
|
||||
end subroutine psb_s_coo_reallocate_nz
|
||||
end interface
|
||||
!
|
||||
!>
|
||||
!! \memberof psb_s_coo_sparse_mat
|
||||
!
|
||||
interface
|
||||
subroutine psb_s_coo_ensure_size(nz,a)
|
||||
import
|
||||
integer(psb_ipk_), intent(in) :: nz
|
||||
class(psb_s_coo_sparse_mat), intent(inout) :: a
|
||||
end subroutine psb_s_coo_ensure_size
|
||||
end interface
|
||||
|
||||
!
|
||||
!>
|
||||
@@ -1715,6 +1730,46 @@ module psb_s_base_mat_mod
|
||||
end subroutine psb_s_coo_clean_zeros
|
||||
end interface
|
||||
|
||||
!
|
||||
!>
|
||||
!! \memberof psb_s_coo_sparse_mat
|
||||
!! \brief Take out any entries with negative row or column index
|
||||
!! May happen when converting local/global numbering
|
||||
!! \param info return code
|
||||
!!
|
||||
!
|
||||
interface
|
||||
subroutine psb_s_coo_clean_negidx(a,info)
|
||||
import
|
||||
class(psb_s_coo_sparse_mat), intent(inout) :: a
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
end subroutine psb_s_coo_clean_negidx
|
||||
end interface
|
||||
|
||||
!
|
||||
!> Funtion: coo_clean_negidx_inner
|
||||
!! \brief Take out any entries with negative row or column index
|
||||
!! Used internally by coo_clean_negidx
|
||||
!! \param nzin Number of entries on input to be handled
|
||||
!! \param ia(:) Row indices
|
||||
!! \param ja(:) Col indices
|
||||
!! \param val(:) Coefficients
|
||||
!! \param nzout Number of entries after sorting/duplicate handling
|
||||
!! \param info return code
|
||||
!!
|
||||
!
|
||||
interface psb_coo_clean_negidx_inner
|
||||
subroutine psb_s_coo_clean_negidx_inner(nzin,ia,ja,val,nzout,info)
|
||||
import
|
||||
integer(psb_ipk_), intent(in) :: nzin
|
||||
integer(psb_ipk_), intent(inout) :: ia(:), ja(:)
|
||||
real(psb_spk_), intent(inout) :: val(:)
|
||||
integer(psb_ipk_), intent(out) :: nzout
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
end subroutine psb_s_coo_clean_negidx_inner
|
||||
end interface psb_coo_clean_negidx_inner
|
||||
|
||||
|
||||
!
|
||||
!>
|
||||
!! \memberof psb_s_coo_sparse_mat
|
||||
@@ -1759,9 +1814,9 @@ module psb_s_base_mat_mod
|
||||
import
|
||||
integer(psb_ipk_), intent(in) :: iout
|
||||
class(psb_s_coo_sparse_mat), intent(in) :: a
|
||||
integer(psb_ipk_), intent(in), optional :: iv(:)
|
||||
integer(psb_lpk_), intent(in), optional :: iv(:)
|
||||
character(len=*), optional :: head
|
||||
integer(psb_ipk_), intent(in), optional :: ivr(:), ivc(:)
|
||||
integer(psb_lpk_), intent(in), optional :: ivr(:), ivc(:)
|
||||
end subroutine psb_s_coo_print
|
||||
end interface
|
||||
|
||||
@@ -3279,6 +3334,17 @@ module psb_s_base_mat_mod
|
||||
class(psb_ls_coo_sparse_mat), intent(inout) :: a
|
||||
end subroutine psb_ls_coo_reallocate_nz
|
||||
end interface
|
||||
!
|
||||
!>
|
||||
!! \memberof psb_ls_coo_sparse_mat
|
||||
!
|
||||
interface
|
||||
subroutine psb_ls_coo_ensure_size(nz,a)
|
||||
import
|
||||
integer(psb_lpk_), intent(in) :: nz
|
||||
class(psb_ls_coo_sparse_mat), intent(inout) :: a
|
||||
end subroutine psb_ls_coo_ensure_size
|
||||
end interface
|
||||
|
||||
!
|
||||
!>
|
||||
@@ -3316,6 +3382,46 @@ module psb_s_base_mat_mod
|
||||
end subroutine psb_ls_coo_clean_zeros
|
||||
end interface
|
||||
|
||||
!
|
||||
!>
|
||||
!! \memberof psb_ls_coo_sparse_mat
|
||||
!! \brief Take out any entries with negative row or column index
|
||||
!! May happen when converting local/global numbering
|
||||
!! \param info return code
|
||||
!!
|
||||
!
|
||||
interface
|
||||
subroutine psb_ls_coo_clean_negidx(a,info)
|
||||
import
|
||||
class(psb_ls_coo_sparse_mat), intent(inout) :: a
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
end subroutine psb_ls_coo_clean_negidx
|
||||
end interface
|
||||
|
||||
#if defined(IPK4) && defined(LPK8)
|
||||
!
|
||||
!> Funtion: coo_clean_negidx_inner
|
||||
!! \brief Take out any entries with negative row or column index
|
||||
!! Used internally by coo_clean_negidx
|
||||
!! \param nzin Number of entries on input to be handled
|
||||
!! \param ia(:) Row indices
|
||||
!! \param ja(:) Col indices
|
||||
!! \param val(:) Coefficients
|
||||
!! \param nzout Number of entries after sorting/duplicate handling
|
||||
!! \param info return code
|
||||
!!
|
||||
!
|
||||
interface psb_coo_clean_negidx_inner
|
||||
subroutine psb_ls_coo_clean_negidx_inner(nzin,ia,ja,val,nzout,info)
|
||||
import
|
||||
integer(psb_lpk_), intent(in) :: nzin
|
||||
integer(psb_lpk_), intent(inout) :: ia(:), ja(:)
|
||||
real(psb_spk_), intent(inout) :: val(:)
|
||||
integer(psb_lpk_), intent(out) :: nzout
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
end subroutine psb_ls_coo_clean_negidx_inner
|
||||
end interface psb_coo_clean_negidx_inner
|
||||
#endif
|
||||
!
|
||||
!>
|
||||
!! \memberof psb_ls_coo_sparse_mat
|
||||
@@ -3674,6 +3780,8 @@ module psb_s_base_mat_mod
|
||||
end subroutine psb_ls_coo_scals
|
||||
end interface
|
||||
|
||||
public :: psb_s_get_print_frmt, psb_ls_get_print_frmt
|
||||
|
||||
!>
|
||||
!! \memberof psb_ls_coo_sparse_mat
|
||||
!! \see psb_ls_base_mat_mod::psb_ls_base_scalplusidentity
|
||||
@@ -3729,6 +3837,56 @@ module psb_s_base_mat_mod
|
||||
|
||||
contains
|
||||
|
||||
function psb_s_get_print_frmt(nr,nc,nz,iv,ivr,ivc) result(frmt)
|
||||
|
||||
implicit none
|
||||
character(len=80) :: frmt
|
||||
integer(psb_ipk_), intent(in) :: nr, nc, nz
|
||||
integer(psb_lpk_), intent(in), optional :: iv(:)
|
||||
integer(psb_lpk_), intent(in), optional :: ivr(:), ivc(:)
|
||||
!
|
||||
character(len=*), parameter :: datatype='real'
|
||||
integer(psb_lpk_) :: nmx
|
||||
integer(psb_ipk_) :: ni
|
||||
nmx = max(nr,nc,ione)
|
||||
if (present(iv)) nmx = max(nmx,maxval(abs(iv(1:nc))))
|
||||
if (present(ivr)) nmx = max(nmx,maxval(abs(ivr(1:nr))))
|
||||
if (present(ivc)) nmx = max(nmx,maxval(abs(ivc(1:nc))))
|
||||
ni = floor(log10(1.0*nmx)) + 2
|
||||
|
||||
if (datatype=='complex') then
|
||||
write(frmt,'(a,i3.3,a,i3.3,a)') '(2(i',ni,',1x),2(es26.18,1x),2(i',ni,',1x))'
|
||||
else
|
||||
write(frmt,'(a,i3.3,a,i3.3,a)') '(2(i',ni,',1x),es26.18,1x,2(i',ni,',1x))'
|
||||
end if
|
||||
|
||||
end function psb_s_get_print_frmt
|
||||
|
||||
function psb_ls_get_print_frmt(nr,nc,nz,iv,ivr,ivc) result(frmt)
|
||||
|
||||
implicit none
|
||||
character(len=80) :: frmt
|
||||
integer(psb_lpk_), intent(in) :: nr, nc, nz
|
||||
integer(psb_lpk_), intent(in), optional :: iv(:)
|
||||
integer(psb_lpk_), intent(in), optional :: ivr(:), ivc(:)
|
||||
!
|
||||
character(len=*), parameter :: datatype='real'
|
||||
integer(psb_lpk_) :: nmx
|
||||
integer(psb_lpk_) :: ni
|
||||
nmx = max(nr,nc,lone)
|
||||
if (present(iv)) nmx = max(nmx,maxval(abs(iv(1:nc))))
|
||||
if (present(ivr)) nmx = max(nmx,maxval(abs(ivr(1:nr))))
|
||||
if (present(ivc)) nmx = max(nmx,maxval(abs(ivc(1:nc))))
|
||||
ni = floor(log10(1.0*nmx)) + 2
|
||||
|
||||
if (datatype=='complex') then
|
||||
write(frmt,'(a,i3.3,a,i3.3,a)') '(2(i',ni,',1x),2(es26.18,1x),2(i',ni,',1x))'
|
||||
else
|
||||
write(frmt,'(a,i3.3,a,i3.3,a)') '(2(i',ni,',1x),es26.18,1x,2(i',ni,',1x))'
|
||||
end if
|
||||
|
||||
end function psb_ls_get_print_frmt
|
||||
|
||||
|
||||
! == ==================================
|
||||
!
|
||||
|
||||
@@ -219,9 +219,9 @@ module psb_s_csc_mat_mod
|
||||
import
|
||||
integer(psb_ipk_), intent(in) :: iout
|
||||
class(psb_s_csc_sparse_mat), intent(in) :: a
|
||||
integer(psb_ipk_), intent(in), optional :: iv(:)
|
||||
integer(psb_lpk_), intent(in), optional :: iv(:)
|
||||
character(len=*), optional :: head
|
||||
integer(psb_ipk_), intent(in), optional :: ivr(:), ivc(:)
|
||||
integer(psb_lpk_), intent(in), optional :: ivr(:), ivc(:)
|
||||
end subroutine psb_s_csc_print
|
||||
end interface
|
||||
|
||||
|
||||
@@ -169,9 +169,9 @@ module psb_s_csr_mat_mod
|
||||
import
|
||||
integer(psb_ipk_), intent(in) :: iout
|
||||
class(psb_s_csr_sparse_mat), intent(in) :: a
|
||||
integer(psb_ipk_), intent(in), optional :: iv(:)
|
||||
integer(psb_lpk_), intent(in), optional :: iv(:)
|
||||
character(len=*), optional :: head
|
||||
integer(psb_ipk_), intent(in), optional :: ivr(:), ivc(:)
|
||||
integer(psb_lpk_), intent(in), optional :: ivr(:), ivc(:)
|
||||
end subroutine psb_s_csr_print
|
||||
end interface
|
||||
!
|
||||
|
||||
@@ -145,8 +145,9 @@ module psb_s_mat_mod
|
||||
procedure, pass(a) :: tril => psb_s_tril
|
||||
procedure, pass(a) :: triu => psb_s_triu
|
||||
procedure, pass(a) :: m_csclip => psb_s_csclip
|
||||
procedure, pass(a) :: m_csclip_ip => psb_s_csclip_ip
|
||||
procedure, pass(a) :: b_csclip => psb_s_b_csclip
|
||||
generic, public :: csclip => b_csclip, m_csclip
|
||||
generic, public :: csclip => b_csclip, m_csclip, m_csclip_ip
|
||||
procedure, pass(a) :: clean_zeros => psb_s_clean_zeros
|
||||
procedure, pass(a) :: reall => psb_s_reallocate_nz
|
||||
procedure, pass(a) :: get_neigh => psb_s_get_neigh
|
||||
@@ -342,8 +343,9 @@ module psb_s_mat_mod
|
||||
procedure, pass(a) :: tril => psb_ls_tril
|
||||
procedure, pass(a) :: triu => psb_ls_triu
|
||||
procedure, pass(a) :: m_csclip => psb_ls_csclip
|
||||
procedure, pass(a) :: m_csclip_ip => psb_ls_csclip_ip
|
||||
procedure, pass(a) :: b_csclip => psb_ls_b_csclip
|
||||
generic, public :: csclip => b_csclip, m_csclip
|
||||
generic, public :: csclip => b_csclip, m_csclip, m_csclip_ip
|
||||
procedure, pass(a) :: clean_zeros => psb_ls_clean_zeros
|
||||
procedure, pass(a) :: reall => psb_ls_reallocate_nz
|
||||
procedure, pass(a) :: get_neigh => psb_ls_get_neigh
|
||||
@@ -573,9 +575,9 @@ module psb_s_mat_mod
|
||||
import :: psb_ipk_, psb_lpk_, psb_sspmat_type
|
||||
integer(psb_ipk_), intent(in) :: iout
|
||||
class(psb_sspmat_type), intent(in) :: a
|
||||
integer(psb_ipk_), intent(in), optional :: iv(:)
|
||||
integer(psb_lpk_), intent(in), optional :: iv(:)
|
||||
character(len=*), optional :: head
|
||||
integer(psb_ipk_), intent(in), optional :: ivr(:), ivc(:)
|
||||
integer(psb_lpk_), intent(in), optional :: ivr(:), ivc(:)
|
||||
end subroutine psb_s_sparse_print
|
||||
end interface
|
||||
|
||||
@@ -584,9 +586,9 @@ module psb_s_mat_mod
|
||||
import :: psb_ipk_, psb_lpk_, psb_sspmat_type
|
||||
character(len=*), intent(in) :: fname
|
||||
class(psb_sspmat_type), intent(in) :: a
|
||||
integer(psb_ipk_), intent(in), optional :: iv(:)
|
||||
integer(psb_lpk_), intent(in), optional :: iv(:)
|
||||
character(len=*), optional :: head
|
||||
integer(psb_ipk_), intent(in), optional :: ivr(:), ivc(:)
|
||||
integer(psb_lpk_), intent(in), optional :: ivr(:), ivc(:)
|
||||
end subroutine psb_s_n_sparse_print
|
||||
end interface
|
||||
|
||||
@@ -745,6 +747,17 @@ module psb_s_mat_mod
|
||||
end subroutine psb_s_csclip
|
||||
end interface
|
||||
|
||||
interface
|
||||
subroutine psb_s_csclip_ip(a,info,&
|
||||
& imin,imax,jmin,jmax,rscale,cscale)
|
||||
import :: psb_ipk_, psb_lpk_, psb_sspmat_type, psb_spk_
|
||||
class(psb_sspmat_type), intent(inout) :: a
|
||||
integer(psb_ipk_),intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: imin,imax,jmin,jmax
|
||||
logical, intent(in), optional :: rscale,cscale
|
||||
end subroutine psb_s_csclip_ip
|
||||
end interface
|
||||
|
||||
interface
|
||||
subroutine psb_s_b_csclip(a,b,info,&
|
||||
& imin,imax,jmin,jmax,rscale,cscale)
|
||||
@@ -1514,6 +1527,17 @@ module psb_s_mat_mod
|
||||
end subroutine psb_ls_csclip
|
||||
end interface
|
||||
|
||||
interface
|
||||
subroutine psb_ls_csclip_ip(a,info,&
|
||||
& imin,imax,jmin,jmax,rscale,cscale)
|
||||
import :: psb_ipk_, psb_lpk_, psb_lsspmat_type, psb_spk_
|
||||
class(psb_lsspmat_type), intent(inout) :: a
|
||||
integer(psb_ipk_),intent(out) :: info
|
||||
integer(psb_lpk_), intent(in), optional :: imin,imax,jmin,jmax
|
||||
logical, intent(in), optional :: rscale,cscale
|
||||
end subroutine psb_ls_csclip_ip
|
||||
end interface
|
||||
|
||||
interface
|
||||
subroutine psb_ls_b_csclip(a,b,info,&
|
||||
& imin,imax,jmin,jmax,rscale,cscale)
|
||||
|
||||
@@ -292,9 +292,9 @@ contains
|
||||
use psb_s_mat_mod, only : psb_sspmat_type
|
||||
integer(psb_ipk_), intent(in) :: iout
|
||||
type(psb_sspmat_type), intent(in) :: a
|
||||
integer(psb_ipk_), intent(in), optional :: iv(:)
|
||||
integer(psb_lpk_), intent(in), optional :: iv(:)
|
||||
character(len=*), optional :: head
|
||||
integer(psb_ipk_), intent(in), optional :: ivr(:),ivc(:)
|
||||
integer(psb_lpk_), intent(in), optional :: ivr(:),ivc(:)
|
||||
|
||||
call a%print(iout,iv,head,ivr,ivc)
|
||||
|
||||
@@ -304,9 +304,9 @@ contains
|
||||
use psb_s_mat_mod, only : psb_sspmat_type
|
||||
character(len=*), intent(in) :: fname
|
||||
type(psb_sspmat_type), intent(in) :: a
|
||||
integer(psb_ipk_), intent(in), optional :: iv(:)
|
||||
integer(psb_lpk_), intent(in), optional :: iv(:)
|
||||
character(len=*), optional :: head
|
||||
integer(psb_ipk_), intent(in), optional :: ivr(:),ivc(:)
|
||||
integer(psb_lpk_), intent(in), optional :: ivr(:),ivc(:)
|
||||
|
||||
call a%print(fname,iv,head,ivr,ivc)
|
||||
|
||||
|
||||
@@ -167,6 +167,7 @@ module psb_z_base_mat_mod
|
||||
procedure, pass(a) :: sizeof => z_coo_sizeof
|
||||
procedure, pass(a) :: reallocate_nz => psb_z_coo_reallocate_nz
|
||||
procedure, pass(a) :: allocate_mnnz => psb_z_coo_allocate_mnnz
|
||||
procedure, pass(a) :: ensure_size => psb_z_coo_ensure_size
|
||||
procedure, pass(a) :: cp_to_coo => psb_z_cp_coo_to_coo
|
||||
procedure, pass(a) :: cp_from_coo => psb_z_cp_coo_from_coo
|
||||
procedure, pass(a) :: cp_to_fmt => psb_z_cp_coo_to_fmt
|
||||
@@ -191,6 +192,7 @@ module psb_z_base_mat_mod
|
||||
procedure, pass(a) :: fix => psb_z_fix_coo
|
||||
procedure, pass(a) :: trim => psb_z_coo_trim
|
||||
procedure, pass(a) :: clean_zeros => psb_z_coo_clean_zeros
|
||||
procedure, pass(a) :: clean_negidx => psb_z_coo_clean_negidx
|
||||
procedure, pass(a) :: print => psb_z_coo_print
|
||||
procedure, pass(a) :: free => z_coo_free
|
||||
procedure, pass(a) :: mold => psb_z_coo_mold
|
||||
@@ -360,6 +362,7 @@ module psb_z_base_mat_mod
|
||||
procedure, pass(a) :: sizeof => lz_coo_sizeof
|
||||
procedure, pass(a) :: reallocate_nz => psb_lz_coo_reallocate_nz
|
||||
procedure, pass(a) :: allocate_mnnz => psb_lz_coo_allocate_mnnz
|
||||
procedure, pass(a) :: ensure_size => psb_lz_coo_ensure_size
|
||||
procedure, pass(a) :: cp_to_coo => psb_lz_cp_coo_to_coo
|
||||
procedure, pass(a) :: cp_from_coo => psb_lz_cp_coo_from_coo
|
||||
procedure, pass(a) :: cp_to_fmt => psb_lz_cp_coo_to_fmt
|
||||
@@ -380,6 +383,7 @@ module psb_z_base_mat_mod
|
||||
procedure, pass(a) :: fix => psb_lz_fix_coo
|
||||
procedure, pass(a) :: trim => psb_lz_coo_trim
|
||||
procedure, pass(a) :: clean_zeros => psb_lz_coo_clean_zeros
|
||||
procedure, pass(a) :: clean_negidx => psb_lz_coo_clean_negidx
|
||||
procedure, pass(a) :: print => psb_lz_coo_print
|
||||
procedure, pass(a) :: free => lz_coo_free
|
||||
procedure, pass(a) :: mold => psb_lz_coo_mold
|
||||
@@ -1678,6 +1682,17 @@ module psb_z_base_mat_mod
|
||||
class(psb_z_coo_sparse_mat), intent(inout) :: a
|
||||
end subroutine psb_z_coo_reallocate_nz
|
||||
end interface
|
||||
!
|
||||
!>
|
||||
!! \memberof psb_z_coo_sparse_mat
|
||||
!
|
||||
interface
|
||||
subroutine psb_z_coo_ensure_size(nz,a)
|
||||
import
|
||||
integer(psb_ipk_), intent(in) :: nz
|
||||
class(psb_z_coo_sparse_mat), intent(inout) :: a
|
||||
end subroutine psb_z_coo_ensure_size
|
||||
end interface
|
||||
|
||||
!
|
||||
!>
|
||||
@@ -1715,6 +1730,46 @@ module psb_z_base_mat_mod
|
||||
end subroutine psb_z_coo_clean_zeros
|
||||
end interface
|
||||
|
||||
!
|
||||
!>
|
||||
!! \memberof psb_z_coo_sparse_mat
|
||||
!! \brief Take out any entries with negative row or column index
|
||||
!! May happen when converting local/global numbering
|
||||
!! \param info return code
|
||||
!!
|
||||
!
|
||||
interface
|
||||
subroutine psb_z_coo_clean_negidx(a,info)
|
||||
import
|
||||
class(psb_z_coo_sparse_mat), intent(inout) :: a
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
end subroutine psb_z_coo_clean_negidx
|
||||
end interface
|
||||
|
||||
!
|
||||
!> Funtion: coo_clean_negidx_inner
|
||||
!! \brief Take out any entries with negative row or column index
|
||||
!! Used internally by coo_clean_negidx
|
||||
!! \param nzin Number of entries on input to be handled
|
||||
!! \param ia(:) Row indices
|
||||
!! \param ja(:) Col indices
|
||||
!! \param val(:) Coefficients
|
||||
!! \param nzout Number of entries after sorting/duplicate handling
|
||||
!! \param info return code
|
||||
!!
|
||||
!
|
||||
interface psb_coo_clean_negidx_inner
|
||||
subroutine psb_z_coo_clean_negidx_inner(nzin,ia,ja,val,nzout,info)
|
||||
import
|
||||
integer(psb_ipk_), intent(in) :: nzin
|
||||
integer(psb_ipk_), intent(inout) :: ia(:), ja(:)
|
||||
complex(psb_dpk_), intent(inout) :: val(:)
|
||||
integer(psb_ipk_), intent(out) :: nzout
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
end subroutine psb_z_coo_clean_negidx_inner
|
||||
end interface psb_coo_clean_negidx_inner
|
||||
|
||||
|
||||
!
|
||||
!>
|
||||
!! \memberof psb_z_coo_sparse_mat
|
||||
@@ -1759,9 +1814,9 @@ module psb_z_base_mat_mod
|
||||
import
|
||||
integer(psb_ipk_), intent(in) :: iout
|
||||
class(psb_z_coo_sparse_mat), intent(in) :: a
|
||||
integer(psb_ipk_), intent(in), optional :: iv(:)
|
||||
integer(psb_lpk_), intent(in), optional :: iv(:)
|
||||
character(len=*), optional :: head
|
||||
integer(psb_ipk_), intent(in), optional :: ivr(:), ivc(:)
|
||||
integer(psb_lpk_), intent(in), optional :: ivr(:), ivc(:)
|
||||
end subroutine psb_z_coo_print
|
||||
end interface
|
||||
|
||||
@@ -3279,6 +3334,17 @@ module psb_z_base_mat_mod
|
||||
class(psb_lz_coo_sparse_mat), intent(inout) :: a
|
||||
end subroutine psb_lz_coo_reallocate_nz
|
||||
end interface
|
||||
!
|
||||
!>
|
||||
!! \memberof psb_lz_coo_sparse_mat
|
||||
!
|
||||
interface
|
||||
subroutine psb_lz_coo_ensure_size(nz,a)
|
||||
import
|
||||
integer(psb_lpk_), intent(in) :: nz
|
||||
class(psb_lz_coo_sparse_mat), intent(inout) :: a
|
||||
end subroutine psb_lz_coo_ensure_size
|
||||
end interface
|
||||
|
||||
!
|
||||
!>
|
||||
@@ -3316,6 +3382,46 @@ module psb_z_base_mat_mod
|
||||
end subroutine psb_lz_coo_clean_zeros
|
||||
end interface
|
||||
|
||||
!
|
||||
!>
|
||||
!! \memberof psb_lz_coo_sparse_mat
|
||||
!! \brief Take out any entries with negative row or column index
|
||||
!! May happen when converting local/global numbering
|
||||
!! \param info return code
|
||||
!!
|
||||
!
|
||||
interface
|
||||
subroutine psb_lz_coo_clean_negidx(a,info)
|
||||
import
|
||||
class(psb_lz_coo_sparse_mat), intent(inout) :: a
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
end subroutine psb_lz_coo_clean_negidx
|
||||
end interface
|
||||
|
||||
#if defined(IPK4) && defined(LPK8)
|
||||
!
|
||||
!> Funtion: coo_clean_negidx_inner
|
||||
!! \brief Take out any entries with negative row or column index
|
||||
!! Used internally by coo_clean_negidx
|
||||
!! \param nzin Number of entries on input to be handled
|
||||
!! \param ia(:) Row indices
|
||||
!! \param ja(:) Col indices
|
||||
!! \param val(:) Coefficients
|
||||
!! \param nzout Number of entries after sorting/duplicate handling
|
||||
!! \param info return code
|
||||
!!
|
||||
!
|
||||
interface psb_coo_clean_negidx_inner
|
||||
subroutine psb_lz_coo_clean_negidx_inner(nzin,ia,ja,val,nzout,info)
|
||||
import
|
||||
integer(psb_lpk_), intent(in) :: nzin
|
||||
integer(psb_lpk_), intent(inout) :: ia(:), ja(:)
|
||||
complex(psb_dpk_), intent(inout) :: val(:)
|
||||
integer(psb_lpk_), intent(out) :: nzout
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
end subroutine psb_lz_coo_clean_negidx_inner
|
||||
end interface psb_coo_clean_negidx_inner
|
||||
#endif
|
||||
!
|
||||
!>
|
||||
!! \memberof psb_lz_coo_sparse_mat
|
||||
@@ -3674,6 +3780,8 @@ module psb_z_base_mat_mod
|
||||
end subroutine psb_lz_coo_scals
|
||||
end interface
|
||||
|
||||
public :: psb_z_get_print_frmt, psb_lz_get_print_frmt
|
||||
|
||||
!>
|
||||
!! \memberof psb_lz_coo_sparse_mat
|
||||
!! \see psb_lz_base_mat_mod::psb_lz_base_scalplusidentity
|
||||
@@ -3729,6 +3837,56 @@ module psb_z_base_mat_mod
|
||||
|
||||
contains
|
||||
|
||||
function psb_z_get_print_frmt(nr,nc,nz,iv,ivr,ivc) result(frmt)
|
||||
|
||||
implicit none
|
||||
character(len=80) :: frmt
|
||||
integer(psb_ipk_), intent(in) :: nr, nc, nz
|
||||
integer(psb_lpk_), intent(in), optional :: iv(:)
|
||||
integer(psb_lpk_), intent(in), optional :: ivr(:), ivc(:)
|
||||
!
|
||||
character(len=*), parameter :: datatype='complex'
|
||||
integer(psb_lpk_) :: nmx
|
||||
integer(psb_ipk_) :: ni
|
||||
nmx = max(nr,nc,ione)
|
||||
if (present(iv)) nmx = max(nmx,maxval(abs(iv(1:nc))))
|
||||
if (present(ivr)) nmx = max(nmx,maxval(abs(ivr(1:nr))))
|
||||
if (present(ivc)) nmx = max(nmx,maxval(abs(ivc(1:nc))))
|
||||
ni = floor(log10(1.0*nmx)) + 2
|
||||
|
||||
if (datatype=='complex') then
|
||||
write(frmt,'(a,i3.3,a,i3.3,a)') '(2(i',ni,',1x),2(es26.18,1x),2(i',ni,',1x))'
|
||||
else
|
||||
write(frmt,'(a,i3.3,a,i3.3,a)') '(2(i',ni,',1x),es26.18,1x,2(i',ni,',1x))'
|
||||
end if
|
||||
|
||||
end function psb_z_get_print_frmt
|
||||
|
||||
function psb_lz_get_print_frmt(nr,nc,nz,iv,ivr,ivc) result(frmt)
|
||||
|
||||
implicit none
|
||||
character(len=80) :: frmt
|
||||
integer(psb_lpk_), intent(in) :: nr, nc, nz
|
||||
integer(psb_lpk_), intent(in), optional :: iv(:)
|
||||
integer(psb_lpk_), intent(in), optional :: ivr(:), ivc(:)
|
||||
!
|
||||
character(len=*), parameter :: datatype='complex'
|
||||
integer(psb_lpk_) :: nmx
|
||||
integer(psb_lpk_) :: ni
|
||||
nmx = max(nr,nc,lone)
|
||||
if (present(iv)) nmx = max(nmx,maxval(abs(iv(1:nc))))
|
||||
if (present(ivr)) nmx = max(nmx,maxval(abs(ivr(1:nr))))
|
||||
if (present(ivc)) nmx = max(nmx,maxval(abs(ivc(1:nc))))
|
||||
ni = floor(log10(1.0*nmx)) + 2
|
||||
|
||||
if (datatype=='complex') then
|
||||
write(frmt,'(a,i3.3,a,i3.3,a)') '(2(i',ni,',1x),2(es26.18,1x),2(i',ni,',1x))'
|
||||
else
|
||||
write(frmt,'(a,i3.3,a,i3.3,a)') '(2(i',ni,',1x),es26.18,1x,2(i',ni,',1x))'
|
||||
end if
|
||||
|
||||
end function psb_lz_get_print_frmt
|
||||
|
||||
|
||||
! == ==================================
|
||||
!
|
||||
|
||||
@@ -219,9 +219,9 @@ module psb_z_csc_mat_mod
|
||||
import
|
||||
integer(psb_ipk_), intent(in) :: iout
|
||||
class(psb_z_csc_sparse_mat), intent(in) :: a
|
||||
integer(psb_ipk_), intent(in), optional :: iv(:)
|
||||
integer(psb_lpk_), intent(in), optional :: iv(:)
|
||||
character(len=*), optional :: head
|
||||
integer(psb_ipk_), intent(in), optional :: ivr(:), ivc(:)
|
||||
integer(psb_lpk_), intent(in), optional :: ivr(:), ivc(:)
|
||||
end subroutine psb_z_csc_print
|
||||
end interface
|
||||
|
||||
|
||||
@@ -169,9 +169,9 @@ module psb_z_csr_mat_mod
|
||||
import
|
||||
integer(psb_ipk_), intent(in) :: iout
|
||||
class(psb_z_csr_sparse_mat), intent(in) :: a
|
||||
integer(psb_ipk_), intent(in), optional :: iv(:)
|
||||
integer(psb_lpk_), intent(in), optional :: iv(:)
|
||||
character(len=*), optional :: head
|
||||
integer(psb_ipk_), intent(in), optional :: ivr(:), ivc(:)
|
||||
integer(psb_lpk_), intent(in), optional :: ivr(:), ivc(:)
|
||||
end subroutine psb_z_csr_print
|
||||
end interface
|
||||
!
|
||||
|
||||
@@ -145,8 +145,9 @@ module psb_z_mat_mod
|
||||
procedure, pass(a) :: tril => psb_z_tril
|
||||
procedure, pass(a) :: triu => psb_z_triu
|
||||
procedure, pass(a) :: m_csclip => psb_z_csclip
|
||||
procedure, pass(a) :: m_csclip_ip => psb_z_csclip_ip
|
||||
procedure, pass(a) :: b_csclip => psb_z_b_csclip
|
||||
generic, public :: csclip => b_csclip, m_csclip
|
||||
generic, public :: csclip => b_csclip, m_csclip, m_csclip_ip
|
||||
procedure, pass(a) :: clean_zeros => psb_z_clean_zeros
|
||||
procedure, pass(a) :: reall => psb_z_reallocate_nz
|
||||
procedure, pass(a) :: get_neigh => psb_z_get_neigh
|
||||
@@ -342,8 +343,9 @@ module psb_z_mat_mod
|
||||
procedure, pass(a) :: tril => psb_lz_tril
|
||||
procedure, pass(a) :: triu => psb_lz_triu
|
||||
procedure, pass(a) :: m_csclip => psb_lz_csclip
|
||||
procedure, pass(a) :: m_csclip_ip => psb_lz_csclip_ip
|
||||
procedure, pass(a) :: b_csclip => psb_lz_b_csclip
|
||||
generic, public :: csclip => b_csclip, m_csclip
|
||||
generic, public :: csclip => b_csclip, m_csclip, m_csclip_ip
|
||||
procedure, pass(a) :: clean_zeros => psb_lz_clean_zeros
|
||||
procedure, pass(a) :: reall => psb_lz_reallocate_nz
|
||||
procedure, pass(a) :: get_neigh => psb_lz_get_neigh
|
||||
@@ -573,9 +575,9 @@ module psb_z_mat_mod
|
||||
import :: psb_ipk_, psb_lpk_, psb_zspmat_type
|
||||
integer(psb_ipk_), intent(in) :: iout
|
||||
class(psb_zspmat_type), intent(in) :: a
|
||||
integer(psb_ipk_), intent(in), optional :: iv(:)
|
||||
integer(psb_lpk_), intent(in), optional :: iv(:)
|
||||
character(len=*), optional :: head
|
||||
integer(psb_ipk_), intent(in), optional :: ivr(:), ivc(:)
|
||||
integer(psb_lpk_), intent(in), optional :: ivr(:), ivc(:)
|
||||
end subroutine psb_z_sparse_print
|
||||
end interface
|
||||
|
||||
@@ -584,9 +586,9 @@ module psb_z_mat_mod
|
||||
import :: psb_ipk_, psb_lpk_, psb_zspmat_type
|
||||
character(len=*), intent(in) :: fname
|
||||
class(psb_zspmat_type), intent(in) :: a
|
||||
integer(psb_ipk_), intent(in), optional :: iv(:)
|
||||
integer(psb_lpk_), intent(in), optional :: iv(:)
|
||||
character(len=*), optional :: head
|
||||
integer(psb_ipk_), intent(in), optional :: ivr(:), ivc(:)
|
||||
integer(psb_lpk_), intent(in), optional :: ivr(:), ivc(:)
|
||||
end subroutine psb_z_n_sparse_print
|
||||
end interface
|
||||
|
||||
@@ -745,6 +747,17 @@ module psb_z_mat_mod
|
||||
end subroutine psb_z_csclip
|
||||
end interface
|
||||
|
||||
interface
|
||||
subroutine psb_z_csclip_ip(a,info,&
|
||||
& imin,imax,jmin,jmax,rscale,cscale)
|
||||
import :: psb_ipk_, psb_lpk_, psb_zspmat_type, psb_dpk_
|
||||
class(psb_zspmat_type), intent(inout) :: a
|
||||
integer(psb_ipk_),intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: imin,imax,jmin,jmax
|
||||
logical, intent(in), optional :: rscale,cscale
|
||||
end subroutine psb_z_csclip_ip
|
||||
end interface
|
||||
|
||||
interface
|
||||
subroutine psb_z_b_csclip(a,b,info,&
|
||||
& imin,imax,jmin,jmax,rscale,cscale)
|
||||
@@ -1514,6 +1527,17 @@ module psb_z_mat_mod
|
||||
end subroutine psb_lz_csclip
|
||||
end interface
|
||||
|
||||
interface
|
||||
subroutine psb_lz_csclip_ip(a,info,&
|
||||
& imin,imax,jmin,jmax,rscale,cscale)
|
||||
import :: psb_ipk_, psb_lpk_, psb_lzspmat_type, psb_dpk_
|
||||
class(psb_lzspmat_type), intent(inout) :: a
|
||||
integer(psb_ipk_),intent(out) :: info
|
||||
integer(psb_lpk_), intent(in), optional :: imin,imax,jmin,jmax
|
||||
logical, intent(in), optional :: rscale,cscale
|
||||
end subroutine psb_lz_csclip_ip
|
||||
end interface
|
||||
|
||||
interface
|
||||
subroutine psb_lz_b_csclip(a,b,info,&
|
||||
& imin,imax,jmin,jmax,rscale,cscale)
|
||||
|
||||
@@ -292,9 +292,9 @@ contains
|
||||
use psb_z_mat_mod, only : psb_zspmat_type
|
||||
integer(psb_ipk_), intent(in) :: iout
|
||||
type(psb_zspmat_type), intent(in) :: a
|
||||
integer(psb_ipk_), intent(in), optional :: iv(:)
|
||||
integer(psb_lpk_), intent(in), optional :: iv(:)
|
||||
character(len=*), optional :: head
|
||||
integer(psb_ipk_), intent(in), optional :: ivr(:),ivc(:)
|
||||
integer(psb_lpk_), intent(in), optional :: ivr(:),ivc(:)
|
||||
|
||||
call a%print(iout,iv,head,ivr,ivc)
|
||||
|
||||
@@ -304,9 +304,9 @@ contains
|
||||
use psb_z_mat_mod, only : psb_zspmat_type
|
||||
character(len=*), intent(in) :: fname
|
||||
type(psb_zspmat_type), intent(in) :: a
|
||||
integer(psb_ipk_), intent(in), optional :: iv(:)
|
||||
integer(psb_lpk_), intent(in), optional :: iv(:)
|
||||
character(len=*), optional :: head
|
||||
integer(psb_ipk_), intent(in), optional :: ivr(:),ivc(:)
|
||||
integer(psb_lpk_), intent(in), optional :: ivr(:),ivc(:)
|
||||
|
||||
call a%print(fname,iv,head,ivr,ivc)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user