From a8e020240baf6d27bd2d5f885812fc5b6df00201 Mon Sep 17 00:00:00 2001 From: Salvatore Filippone Date: Tue, 3 Dec 2013 17:15:56 +0000 Subject: [PATCH] psblas3: base/serial/impl/psb_c_base_mat_impl.F90 base/serial/impl/psb_d_base_mat_impl.F90 base/serial/impl/psb_s_base_mat_impl.F90 base/serial/impl/psb_z_base_mat_impl.F90 New inner workings of COO required fixing getblk. --- base/serial/impl/psb_c_base_mat_impl.F90 | 40 +++++++++++++++++++++++- base/serial/impl/psb_d_base_mat_impl.F90 | 40 +++++++++++++++++++++++- base/serial/impl/psb_s_base_mat_impl.F90 | 40 +++++++++++++++++++++++- base/serial/impl/psb_z_base_mat_impl.F90 | 40 +++++++++++++++++++++++- 4 files changed, 156 insertions(+), 4 deletions(-) diff --git a/base/serial/impl/psb_c_base_mat_impl.F90 b/base/serial/impl/psb_c_base_mat_impl.F90 index 3f4b0ee0..7b16cdf4 100644 --- a/base/serial/impl/psb_c_base_mat_impl.F90 +++ b/base/serial/impl/psb_c_base_mat_impl.F90 @@ -419,7 +419,8 @@ subroutine psb_c_base_csgetblk(imin,imax,a,b,info,& integer(psb_ipk_) :: err_act, nzin, nzout integer(psb_ipk_) :: ierr(5) character(len=20) :: name='csget' - logical :: append_ + integer :: jmin_, jmax_ + logical :: append_, rscale_, cscale_ logical, parameter :: debug=.false. call psb_erractionsave(err_act) @@ -435,6 +436,43 @@ subroutine psb_c_base_csgetblk(imin,imax,a,b,info,& else nzin = 0 endif + if (present(rscale)) then + rscale_=rscale + else + rscale_=.false. + end if + if (present(cscale)) then + cscale_=cscale + else + cscale_=.false. + end if + if (present(jmin)) then + jmin_ = jmin + else + jmin_ = 1 + endif + if (present(jmax)) then + jmax_ = jmax + else + jmax_ = a%get_ncols() + endif + + if (append_.and.(rscale_.or.cscale_)) then + write(psb_err_unit,*) & + & 'c_csgetblk: WARNING: dubious input: append_ and rscale_|cscale_' + end if + + if (rscale_) then + call b%set_nrows(imax-imin+1) + else + call b%set_nrows(max(min(imax,a%get_nrows()),b%get_nrows())) + end if + + if (cscale_) then + call b%set_ncols(jmax_-jmin_+1) + else + call b%set_ncols(max(min(jmax_,a%get_ncols()),b%get_ncols())) + end if call a%csget(imin,imax,nzout,b%ia,b%ja,b%val,info,& & jmin=jmin, jmax=jmax, iren=iren, append=append_, & diff --git a/base/serial/impl/psb_d_base_mat_impl.F90 b/base/serial/impl/psb_d_base_mat_impl.F90 index 707fae98..6032018d 100644 --- a/base/serial/impl/psb_d_base_mat_impl.F90 +++ b/base/serial/impl/psb_d_base_mat_impl.F90 @@ -419,7 +419,8 @@ subroutine psb_d_base_csgetblk(imin,imax,a,b,info,& integer(psb_ipk_) :: err_act, nzin, nzout integer(psb_ipk_) :: ierr(5) character(len=20) :: name='csget' - logical :: append_ + integer :: jmin_, jmax_ + logical :: append_, rscale_, cscale_ logical, parameter :: debug=.false. call psb_erractionsave(err_act) @@ -435,6 +436,43 @@ subroutine psb_d_base_csgetblk(imin,imax,a,b,info,& else nzin = 0 endif + if (present(rscale)) then + rscale_=rscale + else + rscale_=.false. + end if + if (present(cscale)) then + cscale_=cscale + else + cscale_=.false. + end if + if (present(jmin)) then + jmin_ = jmin + else + jmin_ = 1 + endif + if (present(jmax)) then + jmax_ = jmax + else + jmax_ = a%get_ncols() + endif + + if (append_.and.(rscale_.or.cscale_)) then + write(psb_err_unit,*) & + & 'd_csgetblk: WARNING: dubious input: append_ and rscale_|cscale_' + end if + + if (rscale_) then + call b%set_nrows(imax-imin+1) + else + call b%set_nrows(max(min(imax,a%get_nrows()),b%get_nrows())) + end if + + if (cscale_) then + call b%set_ncols(jmax_-jmin_+1) + else + call b%set_ncols(max(min(jmax_,a%get_ncols()),b%get_ncols())) + end if call a%csget(imin,imax,nzout,b%ia,b%ja,b%val,info,& & jmin=jmin, jmax=jmax, iren=iren, append=append_, & diff --git a/base/serial/impl/psb_s_base_mat_impl.F90 b/base/serial/impl/psb_s_base_mat_impl.F90 index d5843ddb..48cdc613 100644 --- a/base/serial/impl/psb_s_base_mat_impl.F90 +++ b/base/serial/impl/psb_s_base_mat_impl.F90 @@ -419,7 +419,8 @@ subroutine psb_s_base_csgetblk(imin,imax,a,b,info,& integer(psb_ipk_) :: err_act, nzin, nzout integer(psb_ipk_) :: ierr(5) character(len=20) :: name='csget' - logical :: append_ + integer :: jmin_, jmax_ + logical :: append_, rscale_, cscale_ logical, parameter :: debug=.false. call psb_erractionsave(err_act) @@ -435,6 +436,43 @@ subroutine psb_s_base_csgetblk(imin,imax,a,b,info,& else nzin = 0 endif + if (present(rscale)) then + rscale_=rscale + else + rscale_=.false. + end if + if (present(cscale)) then + cscale_=cscale + else + cscale_=.false. + end if + if (present(jmin)) then + jmin_ = jmin + else + jmin_ = 1 + endif + if (present(jmax)) then + jmax_ = jmax + else + jmax_ = a%get_ncols() + endif + + if (append_.and.(rscale_.or.cscale_)) then + write(psb_err_unit,*) & + & 's_csgetblk: WARNING: dubious input: append_ and rscale_|cscale_' + end if + + if (rscale_) then + call b%set_nrows(imax-imin+1) + else + call b%set_nrows(max(min(imax,a%get_nrows()),b%get_nrows())) + end if + + if (cscale_) then + call b%set_ncols(jmax_-jmin_+1) + else + call b%set_ncols(max(min(jmax_,a%get_ncols()),b%get_ncols())) + end if call a%csget(imin,imax,nzout,b%ia,b%ja,b%val,info,& & jmin=jmin, jmax=jmax, iren=iren, append=append_, & diff --git a/base/serial/impl/psb_z_base_mat_impl.F90 b/base/serial/impl/psb_z_base_mat_impl.F90 index 7a5119ed..88c178c5 100644 --- a/base/serial/impl/psb_z_base_mat_impl.F90 +++ b/base/serial/impl/psb_z_base_mat_impl.F90 @@ -419,7 +419,8 @@ subroutine psb_z_base_csgetblk(imin,imax,a,b,info,& integer(psb_ipk_) :: err_act, nzin, nzout integer(psb_ipk_) :: ierr(5) character(len=20) :: name='csget' - logical :: append_ + integer :: jmin_, jmax_ + logical :: append_, rscale_, cscale_ logical, parameter :: debug=.false. call psb_erractionsave(err_act) @@ -435,6 +436,43 @@ subroutine psb_z_base_csgetblk(imin,imax,a,b,info,& else nzin = 0 endif + if (present(rscale)) then + rscale_=rscale + else + rscale_=.false. + end if + if (present(cscale)) then + cscale_=cscale + else + cscale_=.false. + end if + if (present(jmin)) then + jmin_ = jmin + else + jmin_ = 1 + endif + if (present(jmax)) then + jmax_ = jmax + else + jmax_ = a%get_ncols() + endif + + if (append_.and.(rscale_.or.cscale_)) then + write(psb_err_unit,*) & + & 'z_csgetblk: WARNING: dubious input: append_ and rscale_|cscale_' + end if + + if (rscale_) then + call b%set_nrows(imax-imin+1) + else + call b%set_nrows(max(min(imax,a%get_nrows()),b%get_nrows())) + end if + + if (cscale_) then + call b%set_ncols(jmax_-jmin_+1) + else + call b%set_ncols(max(min(jmax_,a%get_ncols()),b%get_ncols())) + end if call a%csget(imin,imax,nzout,b%ia,b%ja,b%val,info,& & jmin=jmin, jmax=jmax, iren=iren, append=append_, &