mirror of
https://github.com/sfilippone/psblas3.git
synced 2026-10-20 04:42:08 +00:00
Change mat%print interface, and refactor.
This commit is contained in:
@@ -483,17 +483,15 @@ subroutine psb_c_coo_print(iout,a,iv,head,ivr,ivc)
|
||||
|
||||
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(:)
|
||||
|
||||
integer(psb_ipk_) :: err_act
|
||||
character(len=20) :: name='c_coo_print'
|
||||
logical, parameter :: debug=.false.
|
||||
|
||||
character(len=*), parameter :: datatype='complex'
|
||||
character(len=80) :: frmtv
|
||||
integer(psb_ipk_) :: i,j, nmx, ni, nr, nc, nz
|
||||
character(len=80) :: frmt
|
||||
integer(psb_ipk_) :: i,j, ni, nr, nc, nz
|
||||
|
||||
write(iout,'(a)') '%%MatrixMarket matrix coordinate complex general'
|
||||
if (present(head)) write(iout,'(a,a)') '% ',head
|
||||
@@ -505,38 +503,29 @@ subroutine psb_c_coo_print(iout,a,iv,head,ivr,ivc)
|
||||
nr = a%get_nrows()
|
||||
nc = a%get_ncols()
|
||||
nz = a%get_nzeros()
|
||||
nmx = max(nr,nc,1)
|
||||
if (present(iv)) nmx = max(nmx,maxval(abs(iv)))
|
||||
if (present(ivr)) nmx = max(nmx,maxval(abs(ivr)))
|
||||
if (present(ivc)) nmx = max(nmx,maxval(abs(ivc)))
|
||||
ni = floor(log10(1.0*nmx)) + 1
|
||||
|
||||
if (datatype=='real') then
|
||||
write(frmtv,'(a,i3.3,a,i3.3,a)') '(2(i',ni,',1x),es26.18,1x,2(i',ni,',1x))'
|
||||
else
|
||||
write(frmtv,'(a,i3.3,a,i3.3,a)') '(2(i',ni,',1x),2(es26.18,1x),2(i',ni,',1x))'
|
||||
end if
|
||||
frmt = psb_c_get_print_frmt(nr,nc,nz,iv,ivr,ivc)
|
||||
|
||||
write(iout,*) nr, nc, nz
|
||||
if(present(iv)) then
|
||||
do j=1,a%get_nzeros()
|
||||
write(iout,frmtv) iv(a%ia(j)),iv(a%ja(j)),a%val(j)
|
||||
write(iout,frmt) iv(a%ia(j)),iv(a%ja(j)),a%val(j)
|
||||
enddo
|
||||
else
|
||||
if (present(ivr).and..not.present(ivc)) then
|
||||
do j=1,a%get_nzeros()
|
||||
write(iout,frmtv) ivr(a%ia(j)),a%ja(j),a%val(j)
|
||||
write(iout,frmt) ivr(a%ia(j)),a%ja(j),a%val(j)
|
||||
enddo
|
||||
else if (present(ivr).and.present(ivc)) then
|
||||
do j=1,a%get_nzeros()
|
||||
write(iout,frmtv) ivr(a%ia(j)),ivc(a%ja(j)),a%val(j)
|
||||
write(iout,frmt) ivr(a%ia(j)),ivc(a%ja(j)),a%val(j)
|
||||
enddo
|
||||
else if (.not.present(ivr).and.present(ivc)) then
|
||||
do j=1,a%get_nzeros()
|
||||
write(iout,frmtv) a%ia(j),ivc(a%ja(j)),a%val(j)
|
||||
write(iout,frmt) a%ia(j),ivc(a%ja(j)),a%val(j)
|
||||
enddo
|
||||
else if (.not.present(ivr).and..not.present(ivc)) then
|
||||
do j=1,a%get_nzeros()
|
||||
write(iout,frmtv) a%ia(j),a%ja(j),a%val(j)
|
||||
write(iout,frmt) a%ia(j),a%ja(j),a%val(j)
|
||||
enddo
|
||||
endif
|
||||
endif
|
||||
@@ -4871,9 +4860,8 @@ subroutine psb_lc_coo_print(iout,a,iv,head,ivr,ivc)
|
||||
character(len=20) :: name='lc_coo_print'
|
||||
logical, parameter :: debug=.false.
|
||||
|
||||
character(len=*), parameter :: datatype='complex'
|
||||
character(len=80) :: frmtv
|
||||
integer(psb_lpk_) :: i,j, nmx, ni, nr, nc, nz
|
||||
character(len=80) :: frmt
|
||||
integer(psb_lpk_) :: i,j, ni, nr, nc, nz
|
||||
|
||||
write(iout,'(a)') '%%MatrixMarket matrix coordinate complex general'
|
||||
if (present(head)) write(iout,'(a,a)') '% ',head
|
||||
@@ -4885,38 +4873,29 @@ subroutine psb_lc_coo_print(iout,a,iv,head,ivr,ivc)
|
||||
nr = a%get_nrows()
|
||||
nc = a%get_ncols()
|
||||
nz = a%get_nzeros()
|
||||
nmx = max(nr,nc,1)
|
||||
if (present(iv)) nmx = max(nmx,maxval(abs(iv)))
|
||||
if (present(ivr)) nmx = max(nmx,maxval(abs(ivr)))
|
||||
if (present(ivc)) nmx = max(nmx,maxval(abs(ivc)))
|
||||
ni = floor(log10(1.0*nmx)) + 1
|
||||
|
||||
if (datatype=='real') then
|
||||
write(frmtv,'(a,i3.3,a,i3.3,a)') '(2(i',ni,',1x),es26.18,1x,2(i',ni,',1x))'
|
||||
else
|
||||
write(frmtv,'(a,i3.3,a,i3.3,a)') '(2(i',ni,',1x),2(es26.18,1x),2(i',ni,',1x))'
|
||||
end if
|
||||
frmt = psb_lc_get_print_frmt(nr,nc,nz,iv,ivr,ivc)
|
||||
|
||||
write(iout,*) nr, nc, nz
|
||||
if(present(iv)) then
|
||||
do j=1,a%get_nzeros()
|
||||
write(iout,frmtv) iv(a%ia(j)),iv(a%ja(j)),a%val(j)
|
||||
write(iout,frmt) iv(a%ia(j)),iv(a%ja(j)),a%val(j)
|
||||
enddo
|
||||
else
|
||||
if (present(ivr).and..not.present(ivc)) then
|
||||
do j=1,a%get_nzeros()
|
||||
write(iout,frmtv) ivr(a%ia(j)),a%ja(j),a%val(j)
|
||||
write(iout,frmt) ivr(a%ia(j)),a%ja(j),a%val(j)
|
||||
enddo
|
||||
else if (present(ivr).and.present(ivc)) then
|
||||
do j=1,a%get_nzeros()
|
||||
write(iout,frmtv) ivr(a%ia(j)),ivc(a%ja(j)),a%val(j)
|
||||
write(iout,frmt) ivr(a%ia(j)),ivc(a%ja(j)),a%val(j)
|
||||
enddo
|
||||
else if (.not.present(ivr).and.present(ivc)) then
|
||||
do j=1,a%get_nzeros()
|
||||
write(iout,frmtv) a%ia(j),ivc(a%ja(j)),a%val(j)
|
||||
write(iout,frmt) a%ia(j),ivc(a%ja(j)),a%val(j)
|
||||
enddo
|
||||
else if (.not.present(ivr).and..not.present(ivc)) then
|
||||
do j=1,a%get_nzeros()
|
||||
write(iout,frmtv) a%ia(j),a%ja(j),a%val(j)
|
||||
write(iout,frmt) a%ia(j),a%ja(j),a%val(j)
|
||||
enddo
|
||||
endif
|
||||
endif
|
||||
|
||||
@@ -2706,18 +2706,16 @@ subroutine psb_c_csc_print(iout,a,iv,head,ivr,ivc)
|
||||
|
||||
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(:)
|
||||
|
||||
integer(psb_ipk_) :: err_act
|
||||
integer(psb_ipk_) :: ierr(5)
|
||||
character(len=20) :: name='c_csc_print'
|
||||
logical, parameter :: debug=.false.
|
||||
|
||||
character(len=*), parameter :: datatype='complex'
|
||||
character(len=80) :: frmtv
|
||||
integer(psb_ipk_) :: i,j, nmx, ni, nr, nc, nz
|
||||
character(len=80) :: frmt
|
||||
integer(psb_ipk_) :: i,j, ni, nr, nc, nz
|
||||
|
||||
|
||||
write(iout,'(a)') '%%MatrixMarket matrix coordinate complex general'
|
||||
@@ -2730,47 +2728,37 @@ subroutine psb_c_csc_print(iout,a,iv,head,ivr,ivc)
|
||||
nr = a%get_nrows()
|
||||
nc = a%get_ncols()
|
||||
nz = a%get_nzeros()
|
||||
nmx = max(nr,nc,1)
|
||||
if (present(iv)) nmx = max(nmx,maxval(abs(iv)))
|
||||
if (present(ivr)) nmx = max(nmx,maxval(abs(ivr)))
|
||||
if (present(ivc)) nmx = max(nmx,maxval(abs(ivc)))
|
||||
ni = floor(log10(1.0*nmx)) + 1
|
||||
|
||||
if (datatype=='real') then
|
||||
write(frmtv,'(a,i3.3,a,i3.3,a)') '(2(i',ni,',1x),es26.18,1x,2(i',ni,',1x))'
|
||||
else
|
||||
write(frmtv,'(a,i3.3,a,i3.3,a)') '(2(i',ni,',1x),2(es26.18,1x),2(i',ni,',1x))'
|
||||
end if
|
||||
frmt = psb_c_get_print_frmt(nr,nc,nz,iv,ivr,ivc)
|
||||
write(iout,*) nr, nc, nz
|
||||
if(present(iv)) then
|
||||
do i=1, nc
|
||||
do j=a%icp(i),a%icp(i+1)-1
|
||||
write(iout,frmtv) iv(a%ia(j)),iv(i),a%val(j)
|
||||
write(iout,frmt) iv(a%ia(j)),iv(i),a%val(j)
|
||||
end do
|
||||
enddo
|
||||
else
|
||||
if (present(ivr).and..not.present(ivc)) then
|
||||
do i=1, nc
|
||||
do j=a%icp(i),a%icp(i+1)-1
|
||||
write(iout,frmtv) ivr(a%ia(j)),i,a%val(j)
|
||||
write(iout,frmt) ivr(a%ia(j)),i,a%val(j)
|
||||
end do
|
||||
enddo
|
||||
else if (present(ivr).and.present(ivc)) then
|
||||
do i=1, nc
|
||||
do j=a%icp(i),a%icp(i+1)-1
|
||||
write(iout,frmtv) ivr(a%ia(j)),ivc(i),a%val(j)
|
||||
write(iout,frmt) ivr(a%ia(j)),ivc(i),a%val(j)
|
||||
end do
|
||||
enddo
|
||||
else if (.not.present(ivr).and.present(ivc)) then
|
||||
do i=1, nc
|
||||
do j=a%icp(i),a%icp(i+1)-1
|
||||
write(iout,frmtv) (a%ia(j)),ivc(i),a%val(j)
|
||||
write(iout,frmt) (a%ia(j)),ivc(i),a%val(j)
|
||||
end do
|
||||
enddo
|
||||
else if (.not.present(ivr).and..not.present(ivc)) then
|
||||
do i=1, nc
|
||||
do j=a%icp(i),a%icp(i+1)-1
|
||||
write(iout,frmtv) (a%ia(j)),(i),a%val(j)
|
||||
write(iout,frmt) (a%ia(j)),(i),a%val(j)
|
||||
end do
|
||||
enddo
|
||||
endif
|
||||
@@ -4561,13 +4549,10 @@ subroutine psb_lc_csc_print(iout,a,iv,head,ivr,ivc)
|
||||
integer(psb_lpk_), intent(in), optional :: ivr(:), ivc(:)
|
||||
|
||||
integer(psb_ipk_) :: err_act
|
||||
integer(psb_ipk_) :: ierr(5)
|
||||
character(len=20) :: name='lc_csc_print'
|
||||
logical, parameter :: debug=.false.
|
||||
|
||||
character(len=*), parameter :: datatype='complex'
|
||||
character(len=80) :: frmtv
|
||||
integer(psb_ipk_) :: i,j, nmx, ni, nr, nc, nz
|
||||
character(len=80) :: frmt
|
||||
integer(psb_lpk_) :: i,j, ni, nr, nc, nz
|
||||
|
||||
|
||||
write(iout,'(a)') '%%MatrixMarket matrix coordinate complex general'
|
||||
@@ -4580,47 +4565,38 @@ subroutine psb_lc_csc_print(iout,a,iv,head,ivr,ivc)
|
||||
nr = a%get_nrows()
|
||||
nc = a%get_ncols()
|
||||
nz = a%get_nzeros()
|
||||
nmx = max(nr,nc,1)
|
||||
if (present(iv)) nmx = max(nmx,maxval(abs(iv)))
|
||||
if (present(ivr)) nmx = max(nmx,maxval(abs(ivr)))
|
||||
if (present(ivc)) nmx = max(nmx,maxval(abs(ivc)))
|
||||
ni = floor(log10(1.0*nmx)) + 1
|
||||
|
||||
if (datatype=='real') then
|
||||
write(frmtv,'(a,i3.3,a,i3.3,a)') '(2(i',ni,',1x),es26.18,1x,2(i',ni,',1x))'
|
||||
else
|
||||
write(frmtv,'(a,i3.3,a,i3.3,a)') '(2(i',ni,',1x),2(es26.18,1x),2(i',ni,',1x))'
|
||||
end if
|
||||
frmt = psb_lc_get_print_frmt(nr,nc,nz,iv,ivr,ivc)
|
||||
|
||||
write(iout,*) nr, nc, nz
|
||||
if(present(iv)) then
|
||||
do i=1, nc
|
||||
do j=a%icp(i),a%icp(i+1)-1
|
||||
write(iout,frmtv) iv(a%ia(j)),iv(i),a%val(j)
|
||||
write(iout,frmt) iv(a%ia(j)),iv(i),a%val(j)
|
||||
end do
|
||||
enddo
|
||||
else
|
||||
if (present(ivr).and..not.present(ivc)) then
|
||||
do i=1, nc
|
||||
do j=a%icp(i),a%icp(i+1)-1
|
||||
write(iout,frmtv) ivr(a%ia(j)),i,a%val(j)
|
||||
write(iout,frmt) ivr(a%ia(j)),i,a%val(j)
|
||||
end do
|
||||
enddo
|
||||
else if (present(ivr).and.present(ivc)) then
|
||||
do i=1, nc
|
||||
do j=a%icp(i),a%icp(i+1)-1
|
||||
write(iout,frmtv) ivr(a%ia(j)),ivc(i),a%val(j)
|
||||
write(iout,frmt) ivr(a%ia(j)),ivc(i),a%val(j)
|
||||
end do
|
||||
enddo
|
||||
else if (.not.present(ivr).and.present(ivc)) then
|
||||
do i=1, nc
|
||||
do j=a%icp(i),a%icp(i+1)-1
|
||||
write(iout,frmtv) (a%ia(j)),ivc(i),a%val(j)
|
||||
write(iout,frmt) (a%ia(j)),ivc(i),a%val(j)
|
||||
end do
|
||||
enddo
|
||||
else if (.not.present(ivr).and..not.present(ivc)) then
|
||||
do i=1, nc
|
||||
do j=a%icp(i),a%icp(i+1)-1
|
||||
write(iout,frmtv) (a%ia(j)),(i),a%val(j)
|
||||
write(iout,frmt) (a%ia(j)),(i),a%val(j)
|
||||
end do
|
||||
enddo
|
||||
endif
|
||||
|
||||
@@ -2750,21 +2750,21 @@ end subroutine psb_c_csr_trim
|
||||
|
||||
subroutine psb_c_csr_print(iout,a,iv,head,ivr,ivc)
|
||||
use psb_string_mod
|
||||
use psb_c_base_mat_mod
|
||||
use psb_c_csr_mat_mod, psb_protect_name => psb_c_csr_print
|
||||
implicit none
|
||||
|
||||
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(:)
|
||||
|
||||
integer(psb_ipk_) :: err_act
|
||||
character(len=20) :: name='c_csr_print'
|
||||
logical, parameter :: debug=.false.
|
||||
character(len=*), parameter :: datatype='complex'
|
||||
character(len=80) :: frmtv
|
||||
integer(psb_ipk_) :: irs,ics,i,j, nmx, ni, nr, nc, nz
|
||||
character(len=80) :: frmt
|
||||
integer(psb_ipk_) :: irs,ics,i,j, ni, nr, nc, nz
|
||||
|
||||
|
||||
write(iout,'(a)') '%%MatrixMarket matrix coordinate complex general'
|
||||
@@ -2777,47 +2777,38 @@ subroutine psb_c_csr_print(iout,a,iv,head,ivr,ivc)
|
||||
nr = a%get_nrows()
|
||||
nc = a%get_ncols()
|
||||
nz = a%get_nzeros()
|
||||
nmx = max(nr,nc,1)
|
||||
if (present(iv)) nmx = max(nmx,maxval(abs(iv)))
|
||||
if (present(ivr)) nmx = max(nmx,maxval(abs(ivr)))
|
||||
if (present(ivc)) nmx = max(nmx,maxval(abs(ivc)))
|
||||
ni = floor(log10(1.0*nmx)) + 1
|
||||
frmt = psb_c_get_print_frmt(nr,nc,nz,iv,ivr,ivc)
|
||||
|
||||
if (datatype=='real') then
|
||||
write(frmtv,'(a,i3.3,a,i3.3,a)') '(2(i',ni,',1x),es26.18,1x,2(i',ni,',1x))'
|
||||
else
|
||||
write(frmtv,'(a,i3.3,a,i3.3,a)') '(2(i',ni,',1x),2(es26.18,1x),2(i',ni,',1x))'
|
||||
end if
|
||||
write(iout,*) nr, nc, nz
|
||||
if(present(iv)) then
|
||||
do i=1, nr
|
||||
do j=a%irp(i),a%irp(i+1)-1
|
||||
write(iout,frmtv) iv(i),iv(a%ja(j)),a%val(j)
|
||||
write(iout,frmt) iv(i),iv(a%ja(j)),a%val(j)
|
||||
end do
|
||||
enddo
|
||||
else
|
||||
if (present(ivr).and..not.present(ivc)) then
|
||||
do i=1, nr
|
||||
do j=a%irp(i),a%irp(i+1)-1
|
||||
write(iout,frmtv) ivr(i),(a%ja(j)),a%val(j)
|
||||
write(iout,frmt) ivr(i),(a%ja(j)),a%val(j)
|
||||
end do
|
||||
enddo
|
||||
else if (present(ivr).and.present(ivc)) then
|
||||
do i=1, nr
|
||||
do j=a%irp(i),a%irp(i+1)-1
|
||||
write(iout,frmtv) ivr(i),ivc(a%ja(j)),a%val(j)
|
||||
write(iout,frmt) ivr(i),ivc(a%ja(j)),a%val(j)
|
||||
end do
|
||||
enddo
|
||||
else if (.not.present(ivr).and.present(ivc)) then
|
||||
do i=1, nr
|
||||
do j=a%irp(i),a%irp(i+1)-1
|
||||
write(iout,frmtv) (i),ivc(a%ja(j)),a%val(j)
|
||||
write(iout,frmt) (i),ivc(a%ja(j)),a%val(j)
|
||||
end do
|
||||
enddo
|
||||
else if (.not.present(ivr).and..not.present(ivc)) then
|
||||
do i=1, nr
|
||||
do j=a%irp(i),a%irp(i+1)-1
|
||||
write(iout,frmtv) (i),(a%ja(j)),a%val(j)
|
||||
write(iout,frmt) (i),(a%ja(j)),a%val(j)
|
||||
end do
|
||||
enddo
|
||||
endif
|
||||
@@ -4886,9 +4877,8 @@ subroutine psb_lc_csr_print(iout,a,iv,head,ivr,ivc)
|
||||
integer(psb_ipk_) :: err_act
|
||||
character(len=20) :: name='lc_csr_print'
|
||||
logical, parameter :: debug=.false.
|
||||
character(len=*), parameter :: datatype='complex'
|
||||
character(len=80) :: frmtv
|
||||
integer(psb_lpk_) :: irs,ics,i,j, nmx, ni, nr, nc, nz
|
||||
character(len=80) :: frmt
|
||||
integer(psb_lpk_) :: irs,ics,i,j, ni, nr, nc, nz
|
||||
|
||||
|
||||
write(iout,'(a)') '%%MatrixMarket matrix coordinate complex general'
|
||||
@@ -4901,47 +4891,38 @@ subroutine psb_lc_csr_print(iout,a,iv,head,ivr,ivc)
|
||||
nr = a%get_nrows()
|
||||
nc = a%get_ncols()
|
||||
nz = a%get_nzeros()
|
||||
nmx = max(nr,nc,1)
|
||||
if (present(iv)) nmx = max(nmx,maxval(abs(iv)))
|
||||
if (present(ivr)) nmx = max(nmx,maxval(abs(ivr)))
|
||||
if (present(ivc)) nmx = max(nmx,maxval(abs(ivc)))
|
||||
ni = floor(log10(1.0*nmx)) + 1
|
||||
|
||||
if (datatype=='real') then
|
||||
write(frmtv,'(a,i3.3,a,i3.3,a)') '(2(i',ni,',1x),es26.18,1x,2(i',ni,',1x))'
|
||||
else
|
||||
write(frmtv,'(a,i3.3,a,i3.3,a)') '(2(i',ni,',1x),2(es26.18,1x),2(i',ni,',1x))'
|
||||
end if
|
||||
frmt = psb_lc_get_print_frmt(nr,nc,nz,iv,ivr,ivc)
|
||||
|
||||
write(iout,*) nr, nc, nz
|
||||
if(present(iv)) then
|
||||
do i=1, nr
|
||||
do j=a%irp(i),a%irp(i+1)-1
|
||||
write(iout,frmtv) iv(i),iv(a%ja(j)),a%val(j)
|
||||
write(iout,frmt) iv(i),iv(a%ja(j)),a%val(j)
|
||||
end do
|
||||
enddo
|
||||
else
|
||||
if (present(ivr).and..not.present(ivc)) then
|
||||
do i=1, nr
|
||||
do j=a%irp(i),a%irp(i+1)-1
|
||||
write(iout,frmtv) ivr(i),(a%ja(j)),a%val(j)
|
||||
write(iout,frmt) ivr(i),(a%ja(j)),a%val(j)
|
||||
end do
|
||||
enddo
|
||||
else if (present(ivr).and.present(ivc)) then
|
||||
do i=1, nr
|
||||
do j=a%irp(i),a%irp(i+1)-1
|
||||
write(iout,frmtv) ivr(i),ivc(a%ja(j)),a%val(j)
|
||||
write(iout,frmt) ivr(i),ivc(a%ja(j)),a%val(j)
|
||||
end do
|
||||
enddo
|
||||
else if (.not.present(ivr).and.present(ivc)) then
|
||||
do i=1, nr
|
||||
do j=a%irp(i),a%irp(i+1)-1
|
||||
write(iout,frmtv) (i),ivc(a%ja(j)),a%val(j)
|
||||
write(iout,frmt) (i),ivc(a%ja(j)),a%val(j)
|
||||
end do
|
||||
enddo
|
||||
else if (.not.present(ivr).and..not.present(ivc)) then
|
||||
do i=1, nr
|
||||
do j=a%irp(i),a%irp(i+1)-1
|
||||
write(iout,frmtv) (i),(a%ja(j)),a%val(j)
|
||||
write(iout,frmt) (i),(a%ja(j)),a%val(j)
|
||||
end do
|
||||
enddo
|
||||
endif
|
||||
|
||||
@@ -466,9 +466,9 @@ subroutine psb_c_sparse_print(iout,a,iv,head,ivr,ivc)
|
||||
|
||||
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(:)
|
||||
|
||||
integer(psb_ipk_) :: err_act, info
|
||||
character(len=20) :: name='sparse_print'
|
||||
@@ -500,9 +500,9 @@ subroutine psb_c_n_sparse_print(fname,a,iv,head,ivr,ivc)
|
||||
|
||||
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(:)
|
||||
|
||||
integer(psb_ipk_) :: err_act, info, iout
|
||||
logical :: isopen
|
||||
|
||||
@@ -483,17 +483,15 @@ subroutine psb_d_coo_print(iout,a,iv,head,ivr,ivc)
|
||||
|
||||
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(:)
|
||||
|
||||
integer(psb_ipk_) :: err_act
|
||||
character(len=20) :: name='d_coo_print'
|
||||
logical, parameter :: debug=.false.
|
||||
|
||||
character(len=*), parameter :: datatype='real'
|
||||
character(len=80) :: frmtv
|
||||
integer(psb_ipk_) :: i,j, nmx, ni, nr, nc, nz
|
||||
character(len=80) :: frmt
|
||||
integer(psb_ipk_) :: i,j, ni, nr, nc, nz
|
||||
|
||||
write(iout,'(a)') '%%MatrixMarket matrix coordinate real general'
|
||||
if (present(head)) write(iout,'(a,a)') '% ',head
|
||||
@@ -505,38 +503,29 @@ subroutine psb_d_coo_print(iout,a,iv,head,ivr,ivc)
|
||||
nr = a%get_nrows()
|
||||
nc = a%get_ncols()
|
||||
nz = a%get_nzeros()
|
||||
nmx = max(nr,nc,1)
|
||||
if (present(iv)) nmx = max(nmx,maxval(abs(iv)))
|
||||
if (present(ivr)) nmx = max(nmx,maxval(abs(ivr)))
|
||||
if (present(ivc)) nmx = max(nmx,maxval(abs(ivc)))
|
||||
ni = floor(log10(1.0*nmx)) + 1
|
||||
|
||||
if (datatype=='real') then
|
||||
write(frmtv,'(a,i3.3,a,i3.3,a)') '(2(i',ni,',1x),es26.18,1x,2(i',ni,',1x))'
|
||||
else
|
||||
write(frmtv,'(a,i3.3,a,i3.3,a)') '(2(i',ni,',1x),2(es26.18,1x),2(i',ni,',1x))'
|
||||
end if
|
||||
frmt = psb_d_get_print_frmt(nr,nc,nz,iv,ivr,ivc)
|
||||
|
||||
write(iout,*) nr, nc, nz
|
||||
if(present(iv)) then
|
||||
do j=1,a%get_nzeros()
|
||||
write(iout,frmtv) iv(a%ia(j)),iv(a%ja(j)),a%val(j)
|
||||
write(iout,frmt) iv(a%ia(j)),iv(a%ja(j)),a%val(j)
|
||||
enddo
|
||||
else
|
||||
if (present(ivr).and..not.present(ivc)) then
|
||||
do j=1,a%get_nzeros()
|
||||
write(iout,frmtv) ivr(a%ia(j)),a%ja(j),a%val(j)
|
||||
write(iout,frmt) ivr(a%ia(j)),a%ja(j),a%val(j)
|
||||
enddo
|
||||
else if (present(ivr).and.present(ivc)) then
|
||||
do j=1,a%get_nzeros()
|
||||
write(iout,frmtv) ivr(a%ia(j)),ivc(a%ja(j)),a%val(j)
|
||||
write(iout,frmt) ivr(a%ia(j)),ivc(a%ja(j)),a%val(j)
|
||||
enddo
|
||||
else if (.not.present(ivr).and.present(ivc)) then
|
||||
do j=1,a%get_nzeros()
|
||||
write(iout,frmtv) a%ia(j),ivc(a%ja(j)),a%val(j)
|
||||
write(iout,frmt) a%ia(j),ivc(a%ja(j)),a%val(j)
|
||||
enddo
|
||||
else if (.not.present(ivr).and..not.present(ivc)) then
|
||||
do j=1,a%get_nzeros()
|
||||
write(iout,frmtv) a%ia(j),a%ja(j),a%val(j)
|
||||
write(iout,frmt) a%ia(j),a%ja(j),a%val(j)
|
||||
enddo
|
||||
endif
|
||||
endif
|
||||
@@ -4871,9 +4860,8 @@ subroutine psb_ld_coo_print(iout,a,iv,head,ivr,ivc)
|
||||
character(len=20) :: name='ld_coo_print'
|
||||
logical, parameter :: debug=.false.
|
||||
|
||||
character(len=*), parameter :: datatype='real'
|
||||
character(len=80) :: frmtv
|
||||
integer(psb_lpk_) :: i,j, nmx, ni, nr, nc, nz
|
||||
character(len=80) :: frmt
|
||||
integer(psb_lpk_) :: i,j, ni, nr, nc, nz
|
||||
|
||||
write(iout,'(a)') '%%MatrixMarket matrix coordinate real general'
|
||||
if (present(head)) write(iout,'(a,a)') '% ',head
|
||||
@@ -4885,38 +4873,29 @@ subroutine psb_ld_coo_print(iout,a,iv,head,ivr,ivc)
|
||||
nr = a%get_nrows()
|
||||
nc = a%get_ncols()
|
||||
nz = a%get_nzeros()
|
||||
nmx = max(nr,nc,1)
|
||||
if (present(iv)) nmx = max(nmx,maxval(abs(iv)))
|
||||
if (present(ivr)) nmx = max(nmx,maxval(abs(ivr)))
|
||||
if (present(ivc)) nmx = max(nmx,maxval(abs(ivc)))
|
||||
ni = floor(log10(1.0*nmx)) + 1
|
||||
|
||||
if (datatype=='real') then
|
||||
write(frmtv,'(a,i3.3,a,i3.3,a)') '(2(i',ni,',1x),es26.18,1x,2(i',ni,',1x))'
|
||||
else
|
||||
write(frmtv,'(a,i3.3,a,i3.3,a)') '(2(i',ni,',1x),2(es26.18,1x),2(i',ni,',1x))'
|
||||
end if
|
||||
frmt = psb_ld_get_print_frmt(nr,nc,nz,iv,ivr,ivc)
|
||||
|
||||
write(iout,*) nr, nc, nz
|
||||
if(present(iv)) then
|
||||
do j=1,a%get_nzeros()
|
||||
write(iout,frmtv) iv(a%ia(j)),iv(a%ja(j)),a%val(j)
|
||||
write(iout,frmt) iv(a%ia(j)),iv(a%ja(j)),a%val(j)
|
||||
enddo
|
||||
else
|
||||
if (present(ivr).and..not.present(ivc)) then
|
||||
do j=1,a%get_nzeros()
|
||||
write(iout,frmtv) ivr(a%ia(j)),a%ja(j),a%val(j)
|
||||
write(iout,frmt) ivr(a%ia(j)),a%ja(j),a%val(j)
|
||||
enddo
|
||||
else if (present(ivr).and.present(ivc)) then
|
||||
do j=1,a%get_nzeros()
|
||||
write(iout,frmtv) ivr(a%ia(j)),ivc(a%ja(j)),a%val(j)
|
||||
write(iout,frmt) ivr(a%ia(j)),ivc(a%ja(j)),a%val(j)
|
||||
enddo
|
||||
else if (.not.present(ivr).and.present(ivc)) then
|
||||
do j=1,a%get_nzeros()
|
||||
write(iout,frmtv) a%ia(j),ivc(a%ja(j)),a%val(j)
|
||||
write(iout,frmt) a%ia(j),ivc(a%ja(j)),a%val(j)
|
||||
enddo
|
||||
else if (.not.present(ivr).and..not.present(ivc)) then
|
||||
do j=1,a%get_nzeros()
|
||||
write(iout,frmtv) a%ia(j),a%ja(j),a%val(j)
|
||||
write(iout,frmt) a%ia(j),a%ja(j),a%val(j)
|
||||
enddo
|
||||
endif
|
||||
endif
|
||||
|
||||
@@ -2706,18 +2706,16 @@ subroutine psb_d_csc_print(iout,a,iv,head,ivr,ivc)
|
||||
|
||||
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(:)
|
||||
|
||||
integer(psb_ipk_) :: err_act
|
||||
integer(psb_ipk_) :: ierr(5)
|
||||
character(len=20) :: name='d_csc_print'
|
||||
logical, parameter :: debug=.false.
|
||||
|
||||
character(len=*), parameter :: datatype='real'
|
||||
character(len=80) :: frmtv
|
||||
integer(psb_ipk_) :: i,j, nmx, ni, nr, nc, nz
|
||||
character(len=80) :: frmt
|
||||
integer(psb_ipk_) :: i,j, ni, nr, nc, nz
|
||||
|
||||
|
||||
write(iout,'(a)') '%%MatrixMarket matrix coordinate real general'
|
||||
@@ -2730,47 +2728,37 @@ subroutine psb_d_csc_print(iout,a,iv,head,ivr,ivc)
|
||||
nr = a%get_nrows()
|
||||
nc = a%get_ncols()
|
||||
nz = a%get_nzeros()
|
||||
nmx = max(nr,nc,1)
|
||||
if (present(iv)) nmx = max(nmx,maxval(abs(iv)))
|
||||
if (present(ivr)) nmx = max(nmx,maxval(abs(ivr)))
|
||||
if (present(ivc)) nmx = max(nmx,maxval(abs(ivc)))
|
||||
ni = floor(log10(1.0*nmx)) + 1
|
||||
|
||||
if (datatype=='real') then
|
||||
write(frmtv,'(a,i3.3,a,i3.3,a)') '(2(i',ni,',1x),es26.18,1x,2(i',ni,',1x))'
|
||||
else
|
||||
write(frmtv,'(a,i3.3,a,i3.3,a)') '(2(i',ni,',1x),2(es26.18,1x),2(i',ni,',1x))'
|
||||
end if
|
||||
frmt = psb_d_get_print_frmt(nr,nc,nz,iv,ivr,ivc)
|
||||
write(iout,*) nr, nc, nz
|
||||
if(present(iv)) then
|
||||
do i=1, nc
|
||||
do j=a%icp(i),a%icp(i+1)-1
|
||||
write(iout,frmtv) iv(a%ia(j)),iv(i),a%val(j)
|
||||
write(iout,frmt) iv(a%ia(j)),iv(i),a%val(j)
|
||||
end do
|
||||
enddo
|
||||
else
|
||||
if (present(ivr).and..not.present(ivc)) then
|
||||
do i=1, nc
|
||||
do j=a%icp(i),a%icp(i+1)-1
|
||||
write(iout,frmtv) ivr(a%ia(j)),i,a%val(j)
|
||||
write(iout,frmt) ivr(a%ia(j)),i,a%val(j)
|
||||
end do
|
||||
enddo
|
||||
else if (present(ivr).and.present(ivc)) then
|
||||
do i=1, nc
|
||||
do j=a%icp(i),a%icp(i+1)-1
|
||||
write(iout,frmtv) ivr(a%ia(j)),ivc(i),a%val(j)
|
||||
write(iout,frmt) ivr(a%ia(j)),ivc(i),a%val(j)
|
||||
end do
|
||||
enddo
|
||||
else if (.not.present(ivr).and.present(ivc)) then
|
||||
do i=1, nc
|
||||
do j=a%icp(i),a%icp(i+1)-1
|
||||
write(iout,frmtv) (a%ia(j)),ivc(i),a%val(j)
|
||||
write(iout,frmt) (a%ia(j)),ivc(i),a%val(j)
|
||||
end do
|
||||
enddo
|
||||
else if (.not.present(ivr).and..not.present(ivc)) then
|
||||
do i=1, nc
|
||||
do j=a%icp(i),a%icp(i+1)-1
|
||||
write(iout,frmtv) (a%ia(j)),(i),a%val(j)
|
||||
write(iout,frmt) (a%ia(j)),(i),a%val(j)
|
||||
end do
|
||||
enddo
|
||||
endif
|
||||
@@ -4561,13 +4549,10 @@ subroutine psb_ld_csc_print(iout,a,iv,head,ivr,ivc)
|
||||
integer(psb_lpk_), intent(in), optional :: ivr(:), ivc(:)
|
||||
|
||||
integer(psb_ipk_) :: err_act
|
||||
integer(psb_ipk_) :: ierr(5)
|
||||
character(len=20) :: name='ld_csc_print'
|
||||
logical, parameter :: debug=.false.
|
||||
|
||||
character(len=*), parameter :: datatype='real'
|
||||
character(len=80) :: frmtv
|
||||
integer(psb_ipk_) :: i,j, nmx, ni, nr, nc, nz
|
||||
character(len=80) :: frmt
|
||||
integer(psb_lpk_) :: i,j, ni, nr, nc, nz
|
||||
|
||||
|
||||
write(iout,'(a)') '%%MatrixMarket matrix coordinate real general'
|
||||
@@ -4580,47 +4565,38 @@ subroutine psb_ld_csc_print(iout,a,iv,head,ivr,ivc)
|
||||
nr = a%get_nrows()
|
||||
nc = a%get_ncols()
|
||||
nz = a%get_nzeros()
|
||||
nmx = max(nr,nc,1)
|
||||
if (present(iv)) nmx = max(nmx,maxval(abs(iv)))
|
||||
if (present(ivr)) nmx = max(nmx,maxval(abs(ivr)))
|
||||
if (present(ivc)) nmx = max(nmx,maxval(abs(ivc)))
|
||||
ni = floor(log10(1.0*nmx)) + 1
|
||||
|
||||
if (datatype=='real') then
|
||||
write(frmtv,'(a,i3.3,a,i3.3,a)') '(2(i',ni,',1x),es26.18,1x,2(i',ni,',1x))'
|
||||
else
|
||||
write(frmtv,'(a,i3.3,a,i3.3,a)') '(2(i',ni,',1x),2(es26.18,1x),2(i',ni,',1x))'
|
||||
end if
|
||||
frmt = psb_ld_get_print_frmt(nr,nc,nz,iv,ivr,ivc)
|
||||
|
||||
write(iout,*) nr, nc, nz
|
||||
if(present(iv)) then
|
||||
do i=1, nc
|
||||
do j=a%icp(i),a%icp(i+1)-1
|
||||
write(iout,frmtv) iv(a%ia(j)),iv(i),a%val(j)
|
||||
write(iout,frmt) iv(a%ia(j)),iv(i),a%val(j)
|
||||
end do
|
||||
enddo
|
||||
else
|
||||
if (present(ivr).and..not.present(ivc)) then
|
||||
do i=1, nc
|
||||
do j=a%icp(i),a%icp(i+1)-1
|
||||
write(iout,frmtv) ivr(a%ia(j)),i,a%val(j)
|
||||
write(iout,frmt) ivr(a%ia(j)),i,a%val(j)
|
||||
end do
|
||||
enddo
|
||||
else if (present(ivr).and.present(ivc)) then
|
||||
do i=1, nc
|
||||
do j=a%icp(i),a%icp(i+1)-1
|
||||
write(iout,frmtv) ivr(a%ia(j)),ivc(i),a%val(j)
|
||||
write(iout,frmt) ivr(a%ia(j)),ivc(i),a%val(j)
|
||||
end do
|
||||
enddo
|
||||
else if (.not.present(ivr).and.present(ivc)) then
|
||||
do i=1, nc
|
||||
do j=a%icp(i),a%icp(i+1)-1
|
||||
write(iout,frmtv) (a%ia(j)),ivc(i),a%val(j)
|
||||
write(iout,frmt) (a%ia(j)),ivc(i),a%val(j)
|
||||
end do
|
||||
enddo
|
||||
else if (.not.present(ivr).and..not.present(ivc)) then
|
||||
do i=1, nc
|
||||
do j=a%icp(i),a%icp(i+1)-1
|
||||
write(iout,frmtv) (a%ia(j)),(i),a%val(j)
|
||||
write(iout,frmt) (a%ia(j)),(i),a%val(j)
|
||||
end do
|
||||
enddo
|
||||
endif
|
||||
|
||||
@@ -2750,21 +2750,21 @@ end subroutine psb_d_csr_trim
|
||||
|
||||
subroutine psb_d_csr_print(iout,a,iv,head,ivr,ivc)
|
||||
use psb_string_mod
|
||||
use psb_d_base_mat_mod
|
||||
use psb_d_csr_mat_mod, psb_protect_name => psb_d_csr_print
|
||||
implicit none
|
||||
|
||||
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(:)
|
||||
|
||||
integer(psb_ipk_) :: err_act
|
||||
character(len=20) :: name='d_csr_print'
|
||||
logical, parameter :: debug=.false.
|
||||
character(len=*), parameter :: datatype='real'
|
||||
character(len=80) :: frmtv
|
||||
integer(psb_ipk_) :: irs,ics,i,j, nmx, ni, nr, nc, nz
|
||||
character(len=80) :: frmt
|
||||
integer(psb_ipk_) :: irs,ics,i,j, ni, nr, nc, nz
|
||||
|
||||
|
||||
write(iout,'(a)') '%%MatrixMarket matrix coordinate real general'
|
||||
@@ -2777,47 +2777,38 @@ subroutine psb_d_csr_print(iout,a,iv,head,ivr,ivc)
|
||||
nr = a%get_nrows()
|
||||
nc = a%get_ncols()
|
||||
nz = a%get_nzeros()
|
||||
nmx = max(nr,nc,1)
|
||||
if (present(iv)) nmx = max(nmx,maxval(abs(iv)))
|
||||
if (present(ivr)) nmx = max(nmx,maxval(abs(ivr)))
|
||||
if (present(ivc)) nmx = max(nmx,maxval(abs(ivc)))
|
||||
ni = floor(log10(1.0*nmx)) + 1
|
||||
frmt = psb_d_get_print_frmt(nr,nc,nz,iv,ivr,ivc)
|
||||
|
||||
if (datatype=='real') then
|
||||
write(frmtv,'(a,i3.3,a,i3.3,a)') '(2(i',ni,',1x),es26.18,1x,2(i',ni,',1x))'
|
||||
else
|
||||
write(frmtv,'(a,i3.3,a,i3.3,a)') '(2(i',ni,',1x),2(es26.18,1x),2(i',ni,',1x))'
|
||||
end if
|
||||
write(iout,*) nr, nc, nz
|
||||
if(present(iv)) then
|
||||
do i=1, nr
|
||||
do j=a%irp(i),a%irp(i+1)-1
|
||||
write(iout,frmtv) iv(i),iv(a%ja(j)),a%val(j)
|
||||
write(iout,frmt) iv(i),iv(a%ja(j)),a%val(j)
|
||||
end do
|
||||
enddo
|
||||
else
|
||||
if (present(ivr).and..not.present(ivc)) then
|
||||
do i=1, nr
|
||||
do j=a%irp(i),a%irp(i+1)-1
|
||||
write(iout,frmtv) ivr(i),(a%ja(j)),a%val(j)
|
||||
write(iout,frmt) ivr(i),(a%ja(j)),a%val(j)
|
||||
end do
|
||||
enddo
|
||||
else if (present(ivr).and.present(ivc)) then
|
||||
do i=1, nr
|
||||
do j=a%irp(i),a%irp(i+1)-1
|
||||
write(iout,frmtv) ivr(i),ivc(a%ja(j)),a%val(j)
|
||||
write(iout,frmt) ivr(i),ivc(a%ja(j)),a%val(j)
|
||||
end do
|
||||
enddo
|
||||
else if (.not.present(ivr).and.present(ivc)) then
|
||||
do i=1, nr
|
||||
do j=a%irp(i),a%irp(i+1)-1
|
||||
write(iout,frmtv) (i),ivc(a%ja(j)),a%val(j)
|
||||
write(iout,frmt) (i),ivc(a%ja(j)),a%val(j)
|
||||
end do
|
||||
enddo
|
||||
else if (.not.present(ivr).and..not.present(ivc)) then
|
||||
do i=1, nr
|
||||
do j=a%irp(i),a%irp(i+1)-1
|
||||
write(iout,frmtv) (i),(a%ja(j)),a%val(j)
|
||||
write(iout,frmt) (i),(a%ja(j)),a%val(j)
|
||||
end do
|
||||
enddo
|
||||
endif
|
||||
@@ -4886,9 +4877,8 @@ subroutine psb_ld_csr_print(iout,a,iv,head,ivr,ivc)
|
||||
integer(psb_ipk_) :: err_act
|
||||
character(len=20) :: name='ld_csr_print'
|
||||
logical, parameter :: debug=.false.
|
||||
character(len=*), parameter :: datatype='real'
|
||||
character(len=80) :: frmtv
|
||||
integer(psb_lpk_) :: irs,ics,i,j, nmx, ni, nr, nc, nz
|
||||
character(len=80) :: frmt
|
||||
integer(psb_lpk_) :: irs,ics,i,j, ni, nr, nc, nz
|
||||
|
||||
|
||||
write(iout,'(a)') '%%MatrixMarket matrix coordinate real general'
|
||||
@@ -4901,47 +4891,38 @@ subroutine psb_ld_csr_print(iout,a,iv,head,ivr,ivc)
|
||||
nr = a%get_nrows()
|
||||
nc = a%get_ncols()
|
||||
nz = a%get_nzeros()
|
||||
nmx = max(nr,nc,1)
|
||||
if (present(iv)) nmx = max(nmx,maxval(abs(iv)))
|
||||
if (present(ivr)) nmx = max(nmx,maxval(abs(ivr)))
|
||||
if (present(ivc)) nmx = max(nmx,maxval(abs(ivc)))
|
||||
ni = floor(log10(1.0*nmx)) + 1
|
||||
|
||||
if (datatype=='real') then
|
||||
write(frmtv,'(a,i3.3,a,i3.3,a)') '(2(i',ni,',1x),es26.18,1x,2(i',ni,',1x))'
|
||||
else
|
||||
write(frmtv,'(a,i3.3,a,i3.3,a)') '(2(i',ni,',1x),2(es26.18,1x),2(i',ni,',1x))'
|
||||
end if
|
||||
frmt = psb_ld_get_print_frmt(nr,nc,nz,iv,ivr,ivc)
|
||||
|
||||
write(iout,*) nr, nc, nz
|
||||
if(present(iv)) then
|
||||
do i=1, nr
|
||||
do j=a%irp(i),a%irp(i+1)-1
|
||||
write(iout,frmtv) iv(i),iv(a%ja(j)),a%val(j)
|
||||
write(iout,frmt) iv(i),iv(a%ja(j)),a%val(j)
|
||||
end do
|
||||
enddo
|
||||
else
|
||||
if (present(ivr).and..not.present(ivc)) then
|
||||
do i=1, nr
|
||||
do j=a%irp(i),a%irp(i+1)-1
|
||||
write(iout,frmtv) ivr(i),(a%ja(j)),a%val(j)
|
||||
write(iout,frmt) ivr(i),(a%ja(j)),a%val(j)
|
||||
end do
|
||||
enddo
|
||||
else if (present(ivr).and.present(ivc)) then
|
||||
do i=1, nr
|
||||
do j=a%irp(i),a%irp(i+1)-1
|
||||
write(iout,frmtv) ivr(i),ivc(a%ja(j)),a%val(j)
|
||||
write(iout,frmt) ivr(i),ivc(a%ja(j)),a%val(j)
|
||||
end do
|
||||
enddo
|
||||
else if (.not.present(ivr).and.present(ivc)) then
|
||||
do i=1, nr
|
||||
do j=a%irp(i),a%irp(i+1)-1
|
||||
write(iout,frmtv) (i),ivc(a%ja(j)),a%val(j)
|
||||
write(iout,frmt) (i),ivc(a%ja(j)),a%val(j)
|
||||
end do
|
||||
enddo
|
||||
else if (.not.present(ivr).and..not.present(ivc)) then
|
||||
do i=1, nr
|
||||
do j=a%irp(i),a%irp(i+1)-1
|
||||
write(iout,frmtv) (i),(a%ja(j)),a%val(j)
|
||||
write(iout,frmt) (i),(a%ja(j)),a%val(j)
|
||||
end do
|
||||
enddo
|
||||
endif
|
||||
|
||||
@@ -466,9 +466,9 @@ subroutine psb_d_sparse_print(iout,a,iv,head,ivr,ivc)
|
||||
|
||||
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(:)
|
||||
|
||||
integer(psb_ipk_) :: err_act, info
|
||||
character(len=20) :: name='sparse_print'
|
||||
@@ -500,9 +500,9 @@ subroutine psb_d_n_sparse_print(fname,a,iv,head,ivr,ivc)
|
||||
|
||||
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(:)
|
||||
|
||||
integer(psb_ipk_) :: err_act, info, iout
|
||||
logical :: isopen
|
||||
|
||||
@@ -483,17 +483,15 @@ subroutine psb_s_coo_print(iout,a,iv,head,ivr,ivc)
|
||||
|
||||
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(:)
|
||||
|
||||
integer(psb_ipk_) :: err_act
|
||||
character(len=20) :: name='s_coo_print'
|
||||
logical, parameter :: debug=.false.
|
||||
|
||||
character(len=*), parameter :: datatype='real'
|
||||
character(len=80) :: frmtv
|
||||
integer(psb_ipk_) :: i,j, nmx, ni, nr, nc, nz
|
||||
character(len=80) :: frmt
|
||||
integer(psb_ipk_) :: i,j, ni, nr, nc, nz
|
||||
|
||||
write(iout,'(a)') '%%MatrixMarket matrix coordinate real general'
|
||||
if (present(head)) write(iout,'(a,a)') '% ',head
|
||||
@@ -505,38 +503,29 @@ subroutine psb_s_coo_print(iout,a,iv,head,ivr,ivc)
|
||||
nr = a%get_nrows()
|
||||
nc = a%get_ncols()
|
||||
nz = a%get_nzeros()
|
||||
nmx = max(nr,nc,1)
|
||||
if (present(iv)) nmx = max(nmx,maxval(abs(iv)))
|
||||
if (present(ivr)) nmx = max(nmx,maxval(abs(ivr)))
|
||||
if (present(ivc)) nmx = max(nmx,maxval(abs(ivc)))
|
||||
ni = floor(log10(1.0*nmx)) + 1
|
||||
|
||||
if (datatype=='real') then
|
||||
write(frmtv,'(a,i3.3,a,i3.3,a)') '(2(i',ni,',1x),es26.18,1x,2(i',ni,',1x))'
|
||||
else
|
||||
write(frmtv,'(a,i3.3,a,i3.3,a)') '(2(i',ni,',1x),2(es26.18,1x),2(i',ni,',1x))'
|
||||
end if
|
||||
frmt = psb_s_get_print_frmt(nr,nc,nz,iv,ivr,ivc)
|
||||
|
||||
write(iout,*) nr, nc, nz
|
||||
if(present(iv)) then
|
||||
do j=1,a%get_nzeros()
|
||||
write(iout,frmtv) iv(a%ia(j)),iv(a%ja(j)),a%val(j)
|
||||
write(iout,frmt) iv(a%ia(j)),iv(a%ja(j)),a%val(j)
|
||||
enddo
|
||||
else
|
||||
if (present(ivr).and..not.present(ivc)) then
|
||||
do j=1,a%get_nzeros()
|
||||
write(iout,frmtv) ivr(a%ia(j)),a%ja(j),a%val(j)
|
||||
write(iout,frmt) ivr(a%ia(j)),a%ja(j),a%val(j)
|
||||
enddo
|
||||
else if (present(ivr).and.present(ivc)) then
|
||||
do j=1,a%get_nzeros()
|
||||
write(iout,frmtv) ivr(a%ia(j)),ivc(a%ja(j)),a%val(j)
|
||||
write(iout,frmt) ivr(a%ia(j)),ivc(a%ja(j)),a%val(j)
|
||||
enddo
|
||||
else if (.not.present(ivr).and.present(ivc)) then
|
||||
do j=1,a%get_nzeros()
|
||||
write(iout,frmtv) a%ia(j),ivc(a%ja(j)),a%val(j)
|
||||
write(iout,frmt) a%ia(j),ivc(a%ja(j)),a%val(j)
|
||||
enddo
|
||||
else if (.not.present(ivr).and..not.present(ivc)) then
|
||||
do j=1,a%get_nzeros()
|
||||
write(iout,frmtv) a%ia(j),a%ja(j),a%val(j)
|
||||
write(iout,frmt) a%ia(j),a%ja(j),a%val(j)
|
||||
enddo
|
||||
endif
|
||||
endif
|
||||
@@ -4871,9 +4860,8 @@ subroutine psb_ls_coo_print(iout,a,iv,head,ivr,ivc)
|
||||
character(len=20) :: name='ls_coo_print'
|
||||
logical, parameter :: debug=.false.
|
||||
|
||||
character(len=*), parameter :: datatype='real'
|
||||
character(len=80) :: frmtv
|
||||
integer(psb_lpk_) :: i,j, nmx, ni, nr, nc, nz
|
||||
character(len=80) :: frmt
|
||||
integer(psb_lpk_) :: i,j, ni, nr, nc, nz
|
||||
|
||||
write(iout,'(a)') '%%MatrixMarket matrix coordinate real general'
|
||||
if (present(head)) write(iout,'(a,a)') '% ',head
|
||||
@@ -4885,38 +4873,29 @@ subroutine psb_ls_coo_print(iout,a,iv,head,ivr,ivc)
|
||||
nr = a%get_nrows()
|
||||
nc = a%get_ncols()
|
||||
nz = a%get_nzeros()
|
||||
nmx = max(nr,nc,1)
|
||||
if (present(iv)) nmx = max(nmx,maxval(abs(iv)))
|
||||
if (present(ivr)) nmx = max(nmx,maxval(abs(ivr)))
|
||||
if (present(ivc)) nmx = max(nmx,maxval(abs(ivc)))
|
||||
ni = floor(log10(1.0*nmx)) + 1
|
||||
|
||||
if (datatype=='real') then
|
||||
write(frmtv,'(a,i3.3,a,i3.3,a)') '(2(i',ni,',1x),es26.18,1x,2(i',ni,',1x))'
|
||||
else
|
||||
write(frmtv,'(a,i3.3,a,i3.3,a)') '(2(i',ni,',1x),2(es26.18,1x),2(i',ni,',1x))'
|
||||
end if
|
||||
frmt = psb_ls_get_print_frmt(nr,nc,nz,iv,ivr,ivc)
|
||||
|
||||
write(iout,*) nr, nc, nz
|
||||
if(present(iv)) then
|
||||
do j=1,a%get_nzeros()
|
||||
write(iout,frmtv) iv(a%ia(j)),iv(a%ja(j)),a%val(j)
|
||||
write(iout,frmt) iv(a%ia(j)),iv(a%ja(j)),a%val(j)
|
||||
enddo
|
||||
else
|
||||
if (present(ivr).and..not.present(ivc)) then
|
||||
do j=1,a%get_nzeros()
|
||||
write(iout,frmtv) ivr(a%ia(j)),a%ja(j),a%val(j)
|
||||
write(iout,frmt) ivr(a%ia(j)),a%ja(j),a%val(j)
|
||||
enddo
|
||||
else if (present(ivr).and.present(ivc)) then
|
||||
do j=1,a%get_nzeros()
|
||||
write(iout,frmtv) ivr(a%ia(j)),ivc(a%ja(j)),a%val(j)
|
||||
write(iout,frmt) ivr(a%ia(j)),ivc(a%ja(j)),a%val(j)
|
||||
enddo
|
||||
else if (.not.present(ivr).and.present(ivc)) then
|
||||
do j=1,a%get_nzeros()
|
||||
write(iout,frmtv) a%ia(j),ivc(a%ja(j)),a%val(j)
|
||||
write(iout,frmt) a%ia(j),ivc(a%ja(j)),a%val(j)
|
||||
enddo
|
||||
else if (.not.present(ivr).and..not.present(ivc)) then
|
||||
do j=1,a%get_nzeros()
|
||||
write(iout,frmtv) a%ia(j),a%ja(j),a%val(j)
|
||||
write(iout,frmt) a%ia(j),a%ja(j),a%val(j)
|
||||
enddo
|
||||
endif
|
||||
endif
|
||||
|
||||
@@ -2706,18 +2706,16 @@ subroutine psb_s_csc_print(iout,a,iv,head,ivr,ivc)
|
||||
|
||||
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(:)
|
||||
|
||||
integer(psb_ipk_) :: err_act
|
||||
integer(psb_ipk_) :: ierr(5)
|
||||
character(len=20) :: name='s_csc_print'
|
||||
logical, parameter :: debug=.false.
|
||||
|
||||
character(len=*), parameter :: datatype='real'
|
||||
character(len=80) :: frmtv
|
||||
integer(psb_ipk_) :: i,j, nmx, ni, nr, nc, nz
|
||||
character(len=80) :: frmt
|
||||
integer(psb_ipk_) :: i,j, ni, nr, nc, nz
|
||||
|
||||
|
||||
write(iout,'(a)') '%%MatrixMarket matrix coordinate real general'
|
||||
@@ -2730,47 +2728,37 @@ subroutine psb_s_csc_print(iout,a,iv,head,ivr,ivc)
|
||||
nr = a%get_nrows()
|
||||
nc = a%get_ncols()
|
||||
nz = a%get_nzeros()
|
||||
nmx = max(nr,nc,1)
|
||||
if (present(iv)) nmx = max(nmx,maxval(abs(iv)))
|
||||
if (present(ivr)) nmx = max(nmx,maxval(abs(ivr)))
|
||||
if (present(ivc)) nmx = max(nmx,maxval(abs(ivc)))
|
||||
ni = floor(log10(1.0*nmx)) + 1
|
||||
|
||||
if (datatype=='real') then
|
||||
write(frmtv,'(a,i3.3,a,i3.3,a)') '(2(i',ni,',1x),es26.18,1x,2(i',ni,',1x))'
|
||||
else
|
||||
write(frmtv,'(a,i3.3,a,i3.3,a)') '(2(i',ni,',1x),2(es26.18,1x),2(i',ni,',1x))'
|
||||
end if
|
||||
frmt = psb_s_get_print_frmt(nr,nc,nz,iv,ivr,ivc)
|
||||
write(iout,*) nr, nc, nz
|
||||
if(present(iv)) then
|
||||
do i=1, nc
|
||||
do j=a%icp(i),a%icp(i+1)-1
|
||||
write(iout,frmtv) iv(a%ia(j)),iv(i),a%val(j)
|
||||
write(iout,frmt) iv(a%ia(j)),iv(i),a%val(j)
|
||||
end do
|
||||
enddo
|
||||
else
|
||||
if (present(ivr).and..not.present(ivc)) then
|
||||
do i=1, nc
|
||||
do j=a%icp(i),a%icp(i+1)-1
|
||||
write(iout,frmtv) ivr(a%ia(j)),i,a%val(j)
|
||||
write(iout,frmt) ivr(a%ia(j)),i,a%val(j)
|
||||
end do
|
||||
enddo
|
||||
else if (present(ivr).and.present(ivc)) then
|
||||
do i=1, nc
|
||||
do j=a%icp(i),a%icp(i+1)-1
|
||||
write(iout,frmtv) ivr(a%ia(j)),ivc(i),a%val(j)
|
||||
write(iout,frmt) ivr(a%ia(j)),ivc(i),a%val(j)
|
||||
end do
|
||||
enddo
|
||||
else if (.not.present(ivr).and.present(ivc)) then
|
||||
do i=1, nc
|
||||
do j=a%icp(i),a%icp(i+1)-1
|
||||
write(iout,frmtv) (a%ia(j)),ivc(i),a%val(j)
|
||||
write(iout,frmt) (a%ia(j)),ivc(i),a%val(j)
|
||||
end do
|
||||
enddo
|
||||
else if (.not.present(ivr).and..not.present(ivc)) then
|
||||
do i=1, nc
|
||||
do j=a%icp(i),a%icp(i+1)-1
|
||||
write(iout,frmtv) (a%ia(j)),(i),a%val(j)
|
||||
write(iout,frmt) (a%ia(j)),(i),a%val(j)
|
||||
end do
|
||||
enddo
|
||||
endif
|
||||
@@ -4561,13 +4549,10 @@ subroutine psb_ls_csc_print(iout,a,iv,head,ivr,ivc)
|
||||
integer(psb_lpk_), intent(in), optional :: ivr(:), ivc(:)
|
||||
|
||||
integer(psb_ipk_) :: err_act
|
||||
integer(psb_ipk_) :: ierr(5)
|
||||
character(len=20) :: name='ls_csc_print'
|
||||
logical, parameter :: debug=.false.
|
||||
|
||||
character(len=*), parameter :: datatype='real'
|
||||
character(len=80) :: frmtv
|
||||
integer(psb_ipk_) :: i,j, nmx, ni, nr, nc, nz
|
||||
character(len=80) :: frmt
|
||||
integer(psb_lpk_) :: i,j, ni, nr, nc, nz
|
||||
|
||||
|
||||
write(iout,'(a)') '%%MatrixMarket matrix coordinate real general'
|
||||
@@ -4580,47 +4565,38 @@ subroutine psb_ls_csc_print(iout,a,iv,head,ivr,ivc)
|
||||
nr = a%get_nrows()
|
||||
nc = a%get_ncols()
|
||||
nz = a%get_nzeros()
|
||||
nmx = max(nr,nc,1)
|
||||
if (present(iv)) nmx = max(nmx,maxval(abs(iv)))
|
||||
if (present(ivr)) nmx = max(nmx,maxval(abs(ivr)))
|
||||
if (present(ivc)) nmx = max(nmx,maxval(abs(ivc)))
|
||||
ni = floor(log10(1.0*nmx)) + 1
|
||||
|
||||
if (datatype=='real') then
|
||||
write(frmtv,'(a,i3.3,a,i3.3,a)') '(2(i',ni,',1x),es26.18,1x,2(i',ni,',1x))'
|
||||
else
|
||||
write(frmtv,'(a,i3.3,a,i3.3,a)') '(2(i',ni,',1x),2(es26.18,1x),2(i',ni,',1x))'
|
||||
end if
|
||||
frmt = psb_ls_get_print_frmt(nr,nc,nz,iv,ivr,ivc)
|
||||
|
||||
write(iout,*) nr, nc, nz
|
||||
if(present(iv)) then
|
||||
do i=1, nc
|
||||
do j=a%icp(i),a%icp(i+1)-1
|
||||
write(iout,frmtv) iv(a%ia(j)),iv(i),a%val(j)
|
||||
write(iout,frmt) iv(a%ia(j)),iv(i),a%val(j)
|
||||
end do
|
||||
enddo
|
||||
else
|
||||
if (present(ivr).and..not.present(ivc)) then
|
||||
do i=1, nc
|
||||
do j=a%icp(i),a%icp(i+1)-1
|
||||
write(iout,frmtv) ivr(a%ia(j)),i,a%val(j)
|
||||
write(iout,frmt) ivr(a%ia(j)),i,a%val(j)
|
||||
end do
|
||||
enddo
|
||||
else if (present(ivr).and.present(ivc)) then
|
||||
do i=1, nc
|
||||
do j=a%icp(i),a%icp(i+1)-1
|
||||
write(iout,frmtv) ivr(a%ia(j)),ivc(i),a%val(j)
|
||||
write(iout,frmt) ivr(a%ia(j)),ivc(i),a%val(j)
|
||||
end do
|
||||
enddo
|
||||
else if (.not.present(ivr).and.present(ivc)) then
|
||||
do i=1, nc
|
||||
do j=a%icp(i),a%icp(i+1)-1
|
||||
write(iout,frmtv) (a%ia(j)),ivc(i),a%val(j)
|
||||
write(iout,frmt) (a%ia(j)),ivc(i),a%val(j)
|
||||
end do
|
||||
enddo
|
||||
else if (.not.present(ivr).and..not.present(ivc)) then
|
||||
do i=1, nc
|
||||
do j=a%icp(i),a%icp(i+1)-1
|
||||
write(iout,frmtv) (a%ia(j)),(i),a%val(j)
|
||||
write(iout,frmt) (a%ia(j)),(i),a%val(j)
|
||||
end do
|
||||
enddo
|
||||
endif
|
||||
|
||||
@@ -2750,21 +2750,21 @@ end subroutine psb_s_csr_trim
|
||||
|
||||
subroutine psb_s_csr_print(iout,a,iv,head,ivr,ivc)
|
||||
use psb_string_mod
|
||||
use psb_s_base_mat_mod
|
||||
use psb_s_csr_mat_mod, psb_protect_name => psb_s_csr_print
|
||||
implicit none
|
||||
|
||||
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(:)
|
||||
|
||||
integer(psb_ipk_) :: err_act
|
||||
character(len=20) :: name='s_csr_print'
|
||||
logical, parameter :: debug=.false.
|
||||
character(len=*), parameter :: datatype='real'
|
||||
character(len=80) :: frmtv
|
||||
integer(psb_ipk_) :: irs,ics,i,j, nmx, ni, nr, nc, nz
|
||||
character(len=80) :: frmt
|
||||
integer(psb_ipk_) :: irs,ics,i,j, ni, nr, nc, nz
|
||||
|
||||
|
||||
write(iout,'(a)') '%%MatrixMarket matrix coordinate real general'
|
||||
@@ -2777,47 +2777,38 @@ subroutine psb_s_csr_print(iout,a,iv,head,ivr,ivc)
|
||||
nr = a%get_nrows()
|
||||
nc = a%get_ncols()
|
||||
nz = a%get_nzeros()
|
||||
nmx = max(nr,nc,1)
|
||||
if (present(iv)) nmx = max(nmx,maxval(abs(iv)))
|
||||
if (present(ivr)) nmx = max(nmx,maxval(abs(ivr)))
|
||||
if (present(ivc)) nmx = max(nmx,maxval(abs(ivc)))
|
||||
ni = floor(log10(1.0*nmx)) + 1
|
||||
frmt = psb_s_get_print_frmt(nr,nc,nz,iv,ivr,ivc)
|
||||
|
||||
if (datatype=='real') then
|
||||
write(frmtv,'(a,i3.3,a,i3.3,a)') '(2(i',ni,',1x),es26.18,1x,2(i',ni,',1x))'
|
||||
else
|
||||
write(frmtv,'(a,i3.3,a,i3.3,a)') '(2(i',ni,',1x),2(es26.18,1x),2(i',ni,',1x))'
|
||||
end if
|
||||
write(iout,*) nr, nc, nz
|
||||
if(present(iv)) then
|
||||
do i=1, nr
|
||||
do j=a%irp(i),a%irp(i+1)-1
|
||||
write(iout,frmtv) iv(i),iv(a%ja(j)),a%val(j)
|
||||
write(iout,frmt) iv(i),iv(a%ja(j)),a%val(j)
|
||||
end do
|
||||
enddo
|
||||
else
|
||||
if (present(ivr).and..not.present(ivc)) then
|
||||
do i=1, nr
|
||||
do j=a%irp(i),a%irp(i+1)-1
|
||||
write(iout,frmtv) ivr(i),(a%ja(j)),a%val(j)
|
||||
write(iout,frmt) ivr(i),(a%ja(j)),a%val(j)
|
||||
end do
|
||||
enddo
|
||||
else if (present(ivr).and.present(ivc)) then
|
||||
do i=1, nr
|
||||
do j=a%irp(i),a%irp(i+1)-1
|
||||
write(iout,frmtv) ivr(i),ivc(a%ja(j)),a%val(j)
|
||||
write(iout,frmt) ivr(i),ivc(a%ja(j)),a%val(j)
|
||||
end do
|
||||
enddo
|
||||
else if (.not.present(ivr).and.present(ivc)) then
|
||||
do i=1, nr
|
||||
do j=a%irp(i),a%irp(i+1)-1
|
||||
write(iout,frmtv) (i),ivc(a%ja(j)),a%val(j)
|
||||
write(iout,frmt) (i),ivc(a%ja(j)),a%val(j)
|
||||
end do
|
||||
enddo
|
||||
else if (.not.present(ivr).and..not.present(ivc)) then
|
||||
do i=1, nr
|
||||
do j=a%irp(i),a%irp(i+1)-1
|
||||
write(iout,frmtv) (i),(a%ja(j)),a%val(j)
|
||||
write(iout,frmt) (i),(a%ja(j)),a%val(j)
|
||||
end do
|
||||
enddo
|
||||
endif
|
||||
@@ -4886,9 +4877,8 @@ subroutine psb_ls_csr_print(iout,a,iv,head,ivr,ivc)
|
||||
integer(psb_ipk_) :: err_act
|
||||
character(len=20) :: name='ls_csr_print'
|
||||
logical, parameter :: debug=.false.
|
||||
character(len=*), parameter :: datatype='real'
|
||||
character(len=80) :: frmtv
|
||||
integer(psb_lpk_) :: irs,ics,i,j, nmx, ni, nr, nc, nz
|
||||
character(len=80) :: frmt
|
||||
integer(psb_lpk_) :: irs,ics,i,j, ni, nr, nc, nz
|
||||
|
||||
|
||||
write(iout,'(a)') '%%MatrixMarket matrix coordinate real general'
|
||||
@@ -4901,47 +4891,38 @@ subroutine psb_ls_csr_print(iout,a,iv,head,ivr,ivc)
|
||||
nr = a%get_nrows()
|
||||
nc = a%get_ncols()
|
||||
nz = a%get_nzeros()
|
||||
nmx = max(nr,nc,1)
|
||||
if (present(iv)) nmx = max(nmx,maxval(abs(iv)))
|
||||
if (present(ivr)) nmx = max(nmx,maxval(abs(ivr)))
|
||||
if (present(ivc)) nmx = max(nmx,maxval(abs(ivc)))
|
||||
ni = floor(log10(1.0*nmx)) + 1
|
||||
|
||||
if (datatype=='real') then
|
||||
write(frmtv,'(a,i3.3,a,i3.3,a)') '(2(i',ni,',1x),es26.18,1x,2(i',ni,',1x))'
|
||||
else
|
||||
write(frmtv,'(a,i3.3,a,i3.3,a)') '(2(i',ni,',1x),2(es26.18,1x),2(i',ni,',1x))'
|
||||
end if
|
||||
frmt = psb_ls_get_print_frmt(nr,nc,nz,iv,ivr,ivc)
|
||||
|
||||
write(iout,*) nr, nc, nz
|
||||
if(present(iv)) then
|
||||
do i=1, nr
|
||||
do j=a%irp(i),a%irp(i+1)-1
|
||||
write(iout,frmtv) iv(i),iv(a%ja(j)),a%val(j)
|
||||
write(iout,frmt) iv(i),iv(a%ja(j)),a%val(j)
|
||||
end do
|
||||
enddo
|
||||
else
|
||||
if (present(ivr).and..not.present(ivc)) then
|
||||
do i=1, nr
|
||||
do j=a%irp(i),a%irp(i+1)-1
|
||||
write(iout,frmtv) ivr(i),(a%ja(j)),a%val(j)
|
||||
write(iout,frmt) ivr(i),(a%ja(j)),a%val(j)
|
||||
end do
|
||||
enddo
|
||||
else if (present(ivr).and.present(ivc)) then
|
||||
do i=1, nr
|
||||
do j=a%irp(i),a%irp(i+1)-1
|
||||
write(iout,frmtv) ivr(i),ivc(a%ja(j)),a%val(j)
|
||||
write(iout,frmt) ivr(i),ivc(a%ja(j)),a%val(j)
|
||||
end do
|
||||
enddo
|
||||
else if (.not.present(ivr).and.present(ivc)) then
|
||||
do i=1, nr
|
||||
do j=a%irp(i),a%irp(i+1)-1
|
||||
write(iout,frmtv) (i),ivc(a%ja(j)),a%val(j)
|
||||
write(iout,frmt) (i),ivc(a%ja(j)),a%val(j)
|
||||
end do
|
||||
enddo
|
||||
else if (.not.present(ivr).and..not.present(ivc)) then
|
||||
do i=1, nr
|
||||
do j=a%irp(i),a%irp(i+1)-1
|
||||
write(iout,frmtv) (i),(a%ja(j)),a%val(j)
|
||||
write(iout,frmt) (i),(a%ja(j)),a%val(j)
|
||||
end do
|
||||
enddo
|
||||
endif
|
||||
|
||||
@@ -466,9 +466,9 @@ subroutine psb_s_sparse_print(iout,a,iv,head,ivr,ivc)
|
||||
|
||||
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(:)
|
||||
|
||||
integer(psb_ipk_) :: err_act, info
|
||||
character(len=20) :: name='sparse_print'
|
||||
@@ -500,9 +500,9 @@ subroutine psb_s_n_sparse_print(fname,a,iv,head,ivr,ivc)
|
||||
|
||||
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(:)
|
||||
|
||||
integer(psb_ipk_) :: err_act, info, iout
|
||||
logical :: isopen
|
||||
|
||||
@@ -483,17 +483,15 @@ subroutine psb_z_coo_print(iout,a,iv,head,ivr,ivc)
|
||||
|
||||
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(:)
|
||||
|
||||
integer(psb_ipk_) :: err_act
|
||||
character(len=20) :: name='z_coo_print'
|
||||
logical, parameter :: debug=.false.
|
||||
|
||||
character(len=*), parameter :: datatype='complex'
|
||||
character(len=80) :: frmtv
|
||||
integer(psb_ipk_) :: i,j, nmx, ni, nr, nc, nz
|
||||
character(len=80) :: frmt
|
||||
integer(psb_ipk_) :: i,j, ni, nr, nc, nz
|
||||
|
||||
write(iout,'(a)') '%%MatrixMarket matrix coordinate complex general'
|
||||
if (present(head)) write(iout,'(a,a)') '% ',head
|
||||
@@ -505,38 +503,29 @@ subroutine psb_z_coo_print(iout,a,iv,head,ivr,ivc)
|
||||
nr = a%get_nrows()
|
||||
nc = a%get_ncols()
|
||||
nz = a%get_nzeros()
|
||||
nmx = max(nr,nc,1)
|
||||
if (present(iv)) nmx = max(nmx,maxval(abs(iv)))
|
||||
if (present(ivr)) nmx = max(nmx,maxval(abs(ivr)))
|
||||
if (present(ivc)) nmx = max(nmx,maxval(abs(ivc)))
|
||||
ni = floor(log10(1.0*nmx)) + 1
|
||||
|
||||
if (datatype=='real') then
|
||||
write(frmtv,'(a,i3.3,a,i3.3,a)') '(2(i',ni,',1x),es26.18,1x,2(i',ni,',1x))'
|
||||
else
|
||||
write(frmtv,'(a,i3.3,a,i3.3,a)') '(2(i',ni,',1x),2(es26.18,1x),2(i',ni,',1x))'
|
||||
end if
|
||||
frmt = psb_z_get_print_frmt(nr,nc,nz,iv,ivr,ivc)
|
||||
|
||||
write(iout,*) nr, nc, nz
|
||||
if(present(iv)) then
|
||||
do j=1,a%get_nzeros()
|
||||
write(iout,frmtv) iv(a%ia(j)),iv(a%ja(j)),a%val(j)
|
||||
write(iout,frmt) iv(a%ia(j)),iv(a%ja(j)),a%val(j)
|
||||
enddo
|
||||
else
|
||||
if (present(ivr).and..not.present(ivc)) then
|
||||
do j=1,a%get_nzeros()
|
||||
write(iout,frmtv) ivr(a%ia(j)),a%ja(j),a%val(j)
|
||||
write(iout,frmt) ivr(a%ia(j)),a%ja(j),a%val(j)
|
||||
enddo
|
||||
else if (present(ivr).and.present(ivc)) then
|
||||
do j=1,a%get_nzeros()
|
||||
write(iout,frmtv) ivr(a%ia(j)),ivc(a%ja(j)),a%val(j)
|
||||
write(iout,frmt) ivr(a%ia(j)),ivc(a%ja(j)),a%val(j)
|
||||
enddo
|
||||
else if (.not.present(ivr).and.present(ivc)) then
|
||||
do j=1,a%get_nzeros()
|
||||
write(iout,frmtv) a%ia(j),ivc(a%ja(j)),a%val(j)
|
||||
write(iout,frmt) a%ia(j),ivc(a%ja(j)),a%val(j)
|
||||
enddo
|
||||
else if (.not.present(ivr).and..not.present(ivc)) then
|
||||
do j=1,a%get_nzeros()
|
||||
write(iout,frmtv) a%ia(j),a%ja(j),a%val(j)
|
||||
write(iout,frmt) a%ia(j),a%ja(j),a%val(j)
|
||||
enddo
|
||||
endif
|
||||
endif
|
||||
@@ -4871,9 +4860,8 @@ subroutine psb_lz_coo_print(iout,a,iv,head,ivr,ivc)
|
||||
character(len=20) :: name='lz_coo_print'
|
||||
logical, parameter :: debug=.false.
|
||||
|
||||
character(len=*), parameter :: datatype='complex'
|
||||
character(len=80) :: frmtv
|
||||
integer(psb_lpk_) :: i,j, nmx, ni, nr, nc, nz
|
||||
character(len=80) :: frmt
|
||||
integer(psb_lpk_) :: i,j, ni, nr, nc, nz
|
||||
|
||||
write(iout,'(a)') '%%MatrixMarket matrix coordinate complex general'
|
||||
if (present(head)) write(iout,'(a,a)') '% ',head
|
||||
@@ -4885,38 +4873,29 @@ subroutine psb_lz_coo_print(iout,a,iv,head,ivr,ivc)
|
||||
nr = a%get_nrows()
|
||||
nc = a%get_ncols()
|
||||
nz = a%get_nzeros()
|
||||
nmx = max(nr,nc,1)
|
||||
if (present(iv)) nmx = max(nmx,maxval(abs(iv)))
|
||||
if (present(ivr)) nmx = max(nmx,maxval(abs(ivr)))
|
||||
if (present(ivc)) nmx = max(nmx,maxval(abs(ivc)))
|
||||
ni = floor(log10(1.0*nmx)) + 1
|
||||
|
||||
if (datatype=='real') then
|
||||
write(frmtv,'(a,i3.3,a,i3.3,a)') '(2(i',ni,',1x),es26.18,1x,2(i',ni,',1x))'
|
||||
else
|
||||
write(frmtv,'(a,i3.3,a,i3.3,a)') '(2(i',ni,',1x),2(es26.18,1x),2(i',ni,',1x))'
|
||||
end if
|
||||
frmt = psb_lz_get_print_frmt(nr,nc,nz,iv,ivr,ivc)
|
||||
|
||||
write(iout,*) nr, nc, nz
|
||||
if(present(iv)) then
|
||||
do j=1,a%get_nzeros()
|
||||
write(iout,frmtv) iv(a%ia(j)),iv(a%ja(j)),a%val(j)
|
||||
write(iout,frmt) iv(a%ia(j)),iv(a%ja(j)),a%val(j)
|
||||
enddo
|
||||
else
|
||||
if (present(ivr).and..not.present(ivc)) then
|
||||
do j=1,a%get_nzeros()
|
||||
write(iout,frmtv) ivr(a%ia(j)),a%ja(j),a%val(j)
|
||||
write(iout,frmt) ivr(a%ia(j)),a%ja(j),a%val(j)
|
||||
enddo
|
||||
else if (present(ivr).and.present(ivc)) then
|
||||
do j=1,a%get_nzeros()
|
||||
write(iout,frmtv) ivr(a%ia(j)),ivc(a%ja(j)),a%val(j)
|
||||
write(iout,frmt) ivr(a%ia(j)),ivc(a%ja(j)),a%val(j)
|
||||
enddo
|
||||
else if (.not.present(ivr).and.present(ivc)) then
|
||||
do j=1,a%get_nzeros()
|
||||
write(iout,frmtv) a%ia(j),ivc(a%ja(j)),a%val(j)
|
||||
write(iout,frmt) a%ia(j),ivc(a%ja(j)),a%val(j)
|
||||
enddo
|
||||
else if (.not.present(ivr).and..not.present(ivc)) then
|
||||
do j=1,a%get_nzeros()
|
||||
write(iout,frmtv) a%ia(j),a%ja(j),a%val(j)
|
||||
write(iout,frmt) a%ia(j),a%ja(j),a%val(j)
|
||||
enddo
|
||||
endif
|
||||
endif
|
||||
|
||||
@@ -2706,18 +2706,16 @@ subroutine psb_z_csc_print(iout,a,iv,head,ivr,ivc)
|
||||
|
||||
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(:)
|
||||
|
||||
integer(psb_ipk_) :: err_act
|
||||
integer(psb_ipk_) :: ierr(5)
|
||||
character(len=20) :: name='z_csc_print'
|
||||
logical, parameter :: debug=.false.
|
||||
|
||||
character(len=*), parameter :: datatype='complex'
|
||||
character(len=80) :: frmtv
|
||||
integer(psb_ipk_) :: i,j, nmx, ni, nr, nc, nz
|
||||
character(len=80) :: frmt
|
||||
integer(psb_ipk_) :: i,j, ni, nr, nc, nz
|
||||
|
||||
|
||||
write(iout,'(a)') '%%MatrixMarket matrix coordinate complex general'
|
||||
@@ -2730,47 +2728,37 @@ subroutine psb_z_csc_print(iout,a,iv,head,ivr,ivc)
|
||||
nr = a%get_nrows()
|
||||
nc = a%get_ncols()
|
||||
nz = a%get_nzeros()
|
||||
nmx = max(nr,nc,1)
|
||||
if (present(iv)) nmx = max(nmx,maxval(abs(iv)))
|
||||
if (present(ivr)) nmx = max(nmx,maxval(abs(ivr)))
|
||||
if (present(ivc)) nmx = max(nmx,maxval(abs(ivc)))
|
||||
ni = floor(log10(1.0*nmx)) + 1
|
||||
|
||||
if (datatype=='real') then
|
||||
write(frmtv,'(a,i3.3,a,i3.3,a)') '(2(i',ni,',1x),es26.18,1x,2(i',ni,',1x))'
|
||||
else
|
||||
write(frmtv,'(a,i3.3,a,i3.3,a)') '(2(i',ni,',1x),2(es26.18,1x),2(i',ni,',1x))'
|
||||
end if
|
||||
frmt = psb_z_get_print_frmt(nr,nc,nz,iv,ivr,ivc)
|
||||
write(iout,*) nr, nc, nz
|
||||
if(present(iv)) then
|
||||
do i=1, nc
|
||||
do j=a%icp(i),a%icp(i+1)-1
|
||||
write(iout,frmtv) iv(a%ia(j)),iv(i),a%val(j)
|
||||
write(iout,frmt) iv(a%ia(j)),iv(i),a%val(j)
|
||||
end do
|
||||
enddo
|
||||
else
|
||||
if (present(ivr).and..not.present(ivc)) then
|
||||
do i=1, nc
|
||||
do j=a%icp(i),a%icp(i+1)-1
|
||||
write(iout,frmtv) ivr(a%ia(j)),i,a%val(j)
|
||||
write(iout,frmt) ivr(a%ia(j)),i,a%val(j)
|
||||
end do
|
||||
enddo
|
||||
else if (present(ivr).and.present(ivc)) then
|
||||
do i=1, nc
|
||||
do j=a%icp(i),a%icp(i+1)-1
|
||||
write(iout,frmtv) ivr(a%ia(j)),ivc(i),a%val(j)
|
||||
write(iout,frmt) ivr(a%ia(j)),ivc(i),a%val(j)
|
||||
end do
|
||||
enddo
|
||||
else if (.not.present(ivr).and.present(ivc)) then
|
||||
do i=1, nc
|
||||
do j=a%icp(i),a%icp(i+1)-1
|
||||
write(iout,frmtv) (a%ia(j)),ivc(i),a%val(j)
|
||||
write(iout,frmt) (a%ia(j)),ivc(i),a%val(j)
|
||||
end do
|
||||
enddo
|
||||
else if (.not.present(ivr).and..not.present(ivc)) then
|
||||
do i=1, nc
|
||||
do j=a%icp(i),a%icp(i+1)-1
|
||||
write(iout,frmtv) (a%ia(j)),(i),a%val(j)
|
||||
write(iout,frmt) (a%ia(j)),(i),a%val(j)
|
||||
end do
|
||||
enddo
|
||||
endif
|
||||
@@ -4561,13 +4549,10 @@ subroutine psb_lz_csc_print(iout,a,iv,head,ivr,ivc)
|
||||
integer(psb_lpk_), intent(in), optional :: ivr(:), ivc(:)
|
||||
|
||||
integer(psb_ipk_) :: err_act
|
||||
integer(psb_ipk_) :: ierr(5)
|
||||
character(len=20) :: name='lz_csc_print'
|
||||
logical, parameter :: debug=.false.
|
||||
|
||||
character(len=*), parameter :: datatype='complex'
|
||||
character(len=80) :: frmtv
|
||||
integer(psb_ipk_) :: i,j, nmx, ni, nr, nc, nz
|
||||
character(len=80) :: frmt
|
||||
integer(psb_lpk_) :: i,j, ni, nr, nc, nz
|
||||
|
||||
|
||||
write(iout,'(a)') '%%MatrixMarket matrix coordinate complex general'
|
||||
@@ -4580,47 +4565,38 @@ subroutine psb_lz_csc_print(iout,a,iv,head,ivr,ivc)
|
||||
nr = a%get_nrows()
|
||||
nc = a%get_ncols()
|
||||
nz = a%get_nzeros()
|
||||
nmx = max(nr,nc,1)
|
||||
if (present(iv)) nmx = max(nmx,maxval(abs(iv)))
|
||||
if (present(ivr)) nmx = max(nmx,maxval(abs(ivr)))
|
||||
if (present(ivc)) nmx = max(nmx,maxval(abs(ivc)))
|
||||
ni = floor(log10(1.0*nmx)) + 1
|
||||
|
||||
if (datatype=='real') then
|
||||
write(frmtv,'(a,i3.3,a,i3.3,a)') '(2(i',ni,',1x),es26.18,1x,2(i',ni,',1x))'
|
||||
else
|
||||
write(frmtv,'(a,i3.3,a,i3.3,a)') '(2(i',ni,',1x),2(es26.18,1x),2(i',ni,',1x))'
|
||||
end if
|
||||
frmt = psb_lz_get_print_frmt(nr,nc,nz,iv,ivr,ivc)
|
||||
|
||||
write(iout,*) nr, nc, nz
|
||||
if(present(iv)) then
|
||||
do i=1, nc
|
||||
do j=a%icp(i),a%icp(i+1)-1
|
||||
write(iout,frmtv) iv(a%ia(j)),iv(i),a%val(j)
|
||||
write(iout,frmt) iv(a%ia(j)),iv(i),a%val(j)
|
||||
end do
|
||||
enddo
|
||||
else
|
||||
if (present(ivr).and..not.present(ivc)) then
|
||||
do i=1, nc
|
||||
do j=a%icp(i),a%icp(i+1)-1
|
||||
write(iout,frmtv) ivr(a%ia(j)),i,a%val(j)
|
||||
write(iout,frmt) ivr(a%ia(j)),i,a%val(j)
|
||||
end do
|
||||
enddo
|
||||
else if (present(ivr).and.present(ivc)) then
|
||||
do i=1, nc
|
||||
do j=a%icp(i),a%icp(i+1)-1
|
||||
write(iout,frmtv) ivr(a%ia(j)),ivc(i),a%val(j)
|
||||
write(iout,frmt) ivr(a%ia(j)),ivc(i),a%val(j)
|
||||
end do
|
||||
enddo
|
||||
else if (.not.present(ivr).and.present(ivc)) then
|
||||
do i=1, nc
|
||||
do j=a%icp(i),a%icp(i+1)-1
|
||||
write(iout,frmtv) (a%ia(j)),ivc(i),a%val(j)
|
||||
write(iout,frmt) (a%ia(j)),ivc(i),a%val(j)
|
||||
end do
|
||||
enddo
|
||||
else if (.not.present(ivr).and..not.present(ivc)) then
|
||||
do i=1, nc
|
||||
do j=a%icp(i),a%icp(i+1)-1
|
||||
write(iout,frmtv) (a%ia(j)),(i),a%val(j)
|
||||
write(iout,frmt) (a%ia(j)),(i),a%val(j)
|
||||
end do
|
||||
enddo
|
||||
endif
|
||||
|
||||
@@ -2750,21 +2750,21 @@ end subroutine psb_z_csr_trim
|
||||
|
||||
subroutine psb_z_csr_print(iout,a,iv,head,ivr,ivc)
|
||||
use psb_string_mod
|
||||
use psb_z_base_mat_mod
|
||||
use psb_z_csr_mat_mod, psb_protect_name => psb_z_csr_print
|
||||
implicit none
|
||||
|
||||
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(:)
|
||||
|
||||
integer(psb_ipk_) :: err_act
|
||||
character(len=20) :: name='z_csr_print'
|
||||
logical, parameter :: debug=.false.
|
||||
character(len=*), parameter :: datatype='complex'
|
||||
character(len=80) :: frmtv
|
||||
integer(psb_ipk_) :: irs,ics,i,j, nmx, ni, nr, nc, nz
|
||||
character(len=80) :: frmt
|
||||
integer(psb_ipk_) :: irs,ics,i,j, ni, nr, nc, nz
|
||||
|
||||
|
||||
write(iout,'(a)') '%%MatrixMarket matrix coordinate complex general'
|
||||
@@ -2777,47 +2777,38 @@ subroutine psb_z_csr_print(iout,a,iv,head,ivr,ivc)
|
||||
nr = a%get_nrows()
|
||||
nc = a%get_ncols()
|
||||
nz = a%get_nzeros()
|
||||
nmx = max(nr,nc,1)
|
||||
if (present(iv)) nmx = max(nmx,maxval(abs(iv)))
|
||||
if (present(ivr)) nmx = max(nmx,maxval(abs(ivr)))
|
||||
if (present(ivc)) nmx = max(nmx,maxval(abs(ivc)))
|
||||
ni = floor(log10(1.0*nmx)) + 1
|
||||
frmt = psb_z_get_print_frmt(nr,nc,nz,iv,ivr,ivc)
|
||||
|
||||
if (datatype=='real') then
|
||||
write(frmtv,'(a,i3.3,a,i3.3,a)') '(2(i',ni,',1x),es26.18,1x,2(i',ni,',1x))'
|
||||
else
|
||||
write(frmtv,'(a,i3.3,a,i3.3,a)') '(2(i',ni,',1x),2(es26.18,1x),2(i',ni,',1x))'
|
||||
end if
|
||||
write(iout,*) nr, nc, nz
|
||||
if(present(iv)) then
|
||||
do i=1, nr
|
||||
do j=a%irp(i),a%irp(i+1)-1
|
||||
write(iout,frmtv) iv(i),iv(a%ja(j)),a%val(j)
|
||||
write(iout,frmt) iv(i),iv(a%ja(j)),a%val(j)
|
||||
end do
|
||||
enddo
|
||||
else
|
||||
if (present(ivr).and..not.present(ivc)) then
|
||||
do i=1, nr
|
||||
do j=a%irp(i),a%irp(i+1)-1
|
||||
write(iout,frmtv) ivr(i),(a%ja(j)),a%val(j)
|
||||
write(iout,frmt) ivr(i),(a%ja(j)),a%val(j)
|
||||
end do
|
||||
enddo
|
||||
else if (present(ivr).and.present(ivc)) then
|
||||
do i=1, nr
|
||||
do j=a%irp(i),a%irp(i+1)-1
|
||||
write(iout,frmtv) ivr(i),ivc(a%ja(j)),a%val(j)
|
||||
write(iout,frmt) ivr(i),ivc(a%ja(j)),a%val(j)
|
||||
end do
|
||||
enddo
|
||||
else if (.not.present(ivr).and.present(ivc)) then
|
||||
do i=1, nr
|
||||
do j=a%irp(i),a%irp(i+1)-1
|
||||
write(iout,frmtv) (i),ivc(a%ja(j)),a%val(j)
|
||||
write(iout,frmt) (i),ivc(a%ja(j)),a%val(j)
|
||||
end do
|
||||
enddo
|
||||
else if (.not.present(ivr).and..not.present(ivc)) then
|
||||
do i=1, nr
|
||||
do j=a%irp(i),a%irp(i+1)-1
|
||||
write(iout,frmtv) (i),(a%ja(j)),a%val(j)
|
||||
write(iout,frmt) (i),(a%ja(j)),a%val(j)
|
||||
end do
|
||||
enddo
|
||||
endif
|
||||
@@ -4886,9 +4877,8 @@ subroutine psb_lz_csr_print(iout,a,iv,head,ivr,ivc)
|
||||
integer(psb_ipk_) :: err_act
|
||||
character(len=20) :: name='lz_csr_print'
|
||||
logical, parameter :: debug=.false.
|
||||
character(len=*), parameter :: datatype='complex'
|
||||
character(len=80) :: frmtv
|
||||
integer(psb_lpk_) :: irs,ics,i,j, nmx, ni, nr, nc, nz
|
||||
character(len=80) :: frmt
|
||||
integer(psb_lpk_) :: irs,ics,i,j, ni, nr, nc, nz
|
||||
|
||||
|
||||
write(iout,'(a)') '%%MatrixMarket matrix coordinate complex general'
|
||||
@@ -4901,47 +4891,38 @@ subroutine psb_lz_csr_print(iout,a,iv,head,ivr,ivc)
|
||||
nr = a%get_nrows()
|
||||
nc = a%get_ncols()
|
||||
nz = a%get_nzeros()
|
||||
nmx = max(nr,nc,1)
|
||||
if (present(iv)) nmx = max(nmx,maxval(abs(iv)))
|
||||
if (present(ivr)) nmx = max(nmx,maxval(abs(ivr)))
|
||||
if (present(ivc)) nmx = max(nmx,maxval(abs(ivc)))
|
||||
ni = floor(log10(1.0*nmx)) + 1
|
||||
|
||||
if (datatype=='real') then
|
||||
write(frmtv,'(a,i3.3,a,i3.3,a)') '(2(i',ni,',1x),es26.18,1x,2(i',ni,',1x))'
|
||||
else
|
||||
write(frmtv,'(a,i3.3,a,i3.3,a)') '(2(i',ni,',1x),2(es26.18,1x),2(i',ni,',1x))'
|
||||
end if
|
||||
frmt = psb_lz_get_print_frmt(nr,nc,nz,iv,ivr,ivc)
|
||||
|
||||
write(iout,*) nr, nc, nz
|
||||
if(present(iv)) then
|
||||
do i=1, nr
|
||||
do j=a%irp(i),a%irp(i+1)-1
|
||||
write(iout,frmtv) iv(i),iv(a%ja(j)),a%val(j)
|
||||
write(iout,frmt) iv(i),iv(a%ja(j)),a%val(j)
|
||||
end do
|
||||
enddo
|
||||
else
|
||||
if (present(ivr).and..not.present(ivc)) then
|
||||
do i=1, nr
|
||||
do j=a%irp(i),a%irp(i+1)-1
|
||||
write(iout,frmtv) ivr(i),(a%ja(j)),a%val(j)
|
||||
write(iout,frmt) ivr(i),(a%ja(j)),a%val(j)
|
||||
end do
|
||||
enddo
|
||||
else if (present(ivr).and.present(ivc)) then
|
||||
do i=1, nr
|
||||
do j=a%irp(i),a%irp(i+1)-1
|
||||
write(iout,frmtv) ivr(i),ivc(a%ja(j)),a%val(j)
|
||||
write(iout,frmt) ivr(i),ivc(a%ja(j)),a%val(j)
|
||||
end do
|
||||
enddo
|
||||
else if (.not.present(ivr).and.present(ivc)) then
|
||||
do i=1, nr
|
||||
do j=a%irp(i),a%irp(i+1)-1
|
||||
write(iout,frmtv) (i),ivc(a%ja(j)),a%val(j)
|
||||
write(iout,frmt) (i),ivc(a%ja(j)),a%val(j)
|
||||
end do
|
||||
enddo
|
||||
else if (.not.present(ivr).and..not.present(ivc)) then
|
||||
do i=1, nr
|
||||
do j=a%irp(i),a%irp(i+1)-1
|
||||
write(iout,frmtv) (i),(a%ja(j)),a%val(j)
|
||||
write(iout,frmt) (i),(a%ja(j)),a%val(j)
|
||||
end do
|
||||
enddo
|
||||
endif
|
||||
|
||||
@@ -466,9 +466,9 @@ subroutine psb_z_sparse_print(iout,a,iv,head,ivr,ivc)
|
||||
|
||||
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(:)
|
||||
|
||||
integer(psb_ipk_) :: err_act, info
|
||||
character(len=20) :: name='sparse_print'
|
||||
@@ -500,9 +500,9 @@ subroutine psb_z_n_sparse_print(fname,a,iv,head,ivr,ivc)
|
||||
|
||||
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(:)
|
||||
|
||||
integer(psb_ipk_) :: err_act, info, iout
|
||||
logical :: isopen
|
||||
|
||||
Reference in New Issue
Block a user