From 4709d68502d5b159098770c1285577aecf9c59c9 Mon Sep 17 00:00:00 2001 From: Salvatore Filippone Date: Thu, 23 Oct 2014 15:33:16 +0000 Subject: [PATCH] psblas3: base/modules/psb_c_csc_mat_mod.f90 base/modules/psb_c_csr_mat_mod.f90 base/modules/psb_d_csc_mat_mod.f90 base/modules/psb_d_csr_mat_mod.f90 base/modules/psb_s_csc_mat_mod.f90 base/modules/psb_s_csr_mat_mod.f90 base/modules/psb_z_csc_mat_mod.f90 base/modules/psb_z_csr_mat_mod.f90 base/serial/impl/psb_c_base_mat_impl.F90 base/serial/impl/psb_c_csc_impl.f90 base/serial/impl/psb_c_csr_impl.f90 base/serial/impl/psb_d_base_mat_impl.F90 base/serial/impl/psb_d_csc_impl.f90 base/serial/impl/psb_d_csr_impl.f90 base/serial/impl/psb_s_base_mat_impl.F90 base/serial/impl/psb_s_csc_impl.f90 base/serial/impl/psb_s_csr_impl.f90 base/serial/impl/psb_z_base_mat_impl.F90 base/serial/impl/psb_z_csc_impl.f90 base/serial/impl/psb_z_csr_impl.f90 Implement norm-1 and norm-infinity at base_sparse_mat relying on arwsum/aclsum, only reimplement in child class if memory savings are possible. --- base/modules/psb_c_csc_mat_mod.f90 | 11 ------- base/modules/psb_c_csr_mat_mod.f90 | 11 ------- base/modules/psb_d_csc_mat_mod.f90 | 11 ------- base/modules/psb_d_csr_mat_mod.f90 | 11 ------- base/modules/psb_s_csc_mat_mod.f90 | 11 ------- base/modules/psb_s_csr_mat_mod.f90 | 11 ------- base/modules/psb_z_csc_mat_mod.f90 | 11 ------- base/modules/psb_z_csr_mat_mod.f90 | 11 ------- base/serial/impl/psb_c_base_mat_impl.F90 | 2 ++ base/serial/impl/psb_c_csc_impl.f90 | 41 ------------------------ base/serial/impl/psb_c_csr_impl.f90 | 39 ---------------------- base/serial/impl/psb_d_base_mat_impl.F90 | 2 ++ base/serial/impl/psb_d_csc_impl.f90 | 41 ------------------------ base/serial/impl/psb_d_csr_impl.f90 | 39 ---------------------- base/serial/impl/psb_s_base_mat_impl.F90 | 2 ++ base/serial/impl/psb_s_csc_impl.f90 | 41 ------------------------ base/serial/impl/psb_s_csr_impl.f90 | 39 ---------------------- base/serial/impl/psb_z_base_mat_impl.F90 | 2 ++ base/serial/impl/psb_z_csc_impl.f90 | 41 ------------------------ base/serial/impl/psb_z_csr_impl.f90 | 39 ---------------------- 20 files changed, 8 insertions(+), 408 deletions(-) diff --git a/base/modules/psb_c_csc_mat_mod.f90 b/base/modules/psb_c_csc_mat_mod.f90 index c0e811ec..72930360 100644 --- a/base/modules/psb_c_csc_mat_mod.f90 +++ b/base/modules/psb_c_csc_mat_mod.f90 @@ -72,7 +72,6 @@ module psb_c_csc_mat_mod procedure, pass(a) :: scals => psb_c_csc_scals procedure, pass(a) :: scalv => psb_c_csc_scal procedure, pass(a) :: maxval => psb_c_csc_maxval - procedure, pass(a) :: spnmi => psb_c_csc_csnmi procedure, pass(a) :: spnm1 => psb_c_csc_csnm1 procedure, pass(a) :: rowsum => psb_c_csc_rowsum procedure, pass(a) :: arwsum => psb_c_csc_arwsum @@ -408,16 +407,6 @@ module psb_c_csc_mat_mod end function psb_c_csc_maxval end interface - !> \memberof psb_c_csc_sparse_mat - !! \see psb_c_base_mat_mod::psb_c_base_csnmi - interface - function psb_c_csc_csnmi(a) result(res) - import :: psb_ipk_, psb_c_csc_sparse_mat, psb_spk_ - class(psb_c_csc_sparse_mat), intent(in) :: a - real(psb_spk_) :: res - end function psb_c_csc_csnmi - end interface - !> \memberof psb_c_csc_sparse_mat !! \see psb_c_base_mat_mod::psb_c_base_csnm1 interface diff --git a/base/modules/psb_c_csr_mat_mod.f90 b/base/modules/psb_c_csr_mat_mod.f90 index f1d579ff..4819eaf5 100644 --- a/base/modules/psb_c_csr_mat_mod.f90 +++ b/base/modules/psb_c_csr_mat_mod.f90 @@ -74,7 +74,6 @@ module psb_c_csr_mat_mod procedure, pass(a) :: scalv => psb_c_csr_scal procedure, pass(a) :: maxval => psb_c_csr_maxval procedure, pass(a) :: spnmi => psb_c_csr_csnmi - procedure, pass(a) :: spnm1 => psb_c_csr_csnm1 procedure, pass(a) :: rowsum => psb_c_csr_rowsum procedure, pass(a) :: arwsum => psb_c_csr_arwsum procedure, pass(a) :: colsum => psb_c_csr_colsum @@ -421,16 +420,6 @@ module psb_c_csr_mat_mod end function psb_c_csr_csnmi end interface - !> \memberof psb_c_csr_sparse_mat - !! \see psb_c_base_mat_mod::psb_c_base_csnm1 - interface - function psb_c_csr_csnm1(a) result(res) - import :: psb_ipk_, psb_c_csr_sparse_mat, psb_spk_ - class(psb_c_csr_sparse_mat), intent(in) :: a - real(psb_spk_) :: res - end function psb_c_csr_csnm1 - end interface - !> \memberof psb_c_csr_sparse_mat !! \see psb_c_base_mat_mod::psb_c_base_rowsum interface diff --git a/base/modules/psb_d_csc_mat_mod.f90 b/base/modules/psb_d_csc_mat_mod.f90 index 026e662e..102afe30 100644 --- a/base/modules/psb_d_csc_mat_mod.f90 +++ b/base/modules/psb_d_csc_mat_mod.f90 @@ -72,7 +72,6 @@ module psb_d_csc_mat_mod procedure, pass(a) :: scals => psb_d_csc_scals procedure, pass(a) :: scalv => psb_d_csc_scal procedure, pass(a) :: maxval => psb_d_csc_maxval - procedure, pass(a) :: spnmi => psb_d_csc_csnmi procedure, pass(a) :: spnm1 => psb_d_csc_csnm1 procedure, pass(a) :: rowsum => psb_d_csc_rowsum procedure, pass(a) :: arwsum => psb_d_csc_arwsum @@ -408,16 +407,6 @@ module psb_d_csc_mat_mod end function psb_d_csc_maxval end interface - !> \memberof psb_d_csc_sparse_mat - !! \see psb_d_base_mat_mod::psb_d_base_csnmi - interface - function psb_d_csc_csnmi(a) result(res) - import :: psb_ipk_, psb_d_csc_sparse_mat, psb_dpk_ - class(psb_d_csc_sparse_mat), intent(in) :: a - real(psb_dpk_) :: res - end function psb_d_csc_csnmi - end interface - !> \memberof psb_d_csc_sparse_mat !! \see psb_d_base_mat_mod::psb_d_base_csnm1 interface diff --git a/base/modules/psb_d_csr_mat_mod.f90 b/base/modules/psb_d_csr_mat_mod.f90 index bfe3e458..bd16b958 100644 --- a/base/modules/psb_d_csr_mat_mod.f90 +++ b/base/modules/psb_d_csr_mat_mod.f90 @@ -74,7 +74,6 @@ module psb_d_csr_mat_mod procedure, pass(a) :: scalv => psb_d_csr_scal procedure, pass(a) :: maxval => psb_d_csr_maxval procedure, pass(a) :: spnmi => psb_d_csr_csnmi - procedure, pass(a) :: spnm1 => psb_d_csr_csnm1 procedure, pass(a) :: rowsum => psb_d_csr_rowsum procedure, pass(a) :: arwsum => psb_d_csr_arwsum procedure, pass(a) :: colsum => psb_d_csr_colsum @@ -421,16 +420,6 @@ module psb_d_csr_mat_mod end function psb_d_csr_csnmi end interface - !> \memberof psb_d_csr_sparse_mat - !! \see psb_d_base_mat_mod::psb_d_base_csnm1 - interface - function psb_d_csr_csnm1(a) result(res) - import :: psb_ipk_, psb_d_csr_sparse_mat, psb_dpk_ - class(psb_d_csr_sparse_mat), intent(in) :: a - real(psb_dpk_) :: res - end function psb_d_csr_csnm1 - end interface - !> \memberof psb_d_csr_sparse_mat !! \see psb_d_base_mat_mod::psb_d_base_rowsum interface diff --git a/base/modules/psb_s_csc_mat_mod.f90 b/base/modules/psb_s_csc_mat_mod.f90 index 21513e3e..b7850006 100644 --- a/base/modules/psb_s_csc_mat_mod.f90 +++ b/base/modules/psb_s_csc_mat_mod.f90 @@ -72,7 +72,6 @@ module psb_s_csc_mat_mod procedure, pass(a) :: scals => psb_s_csc_scals procedure, pass(a) :: scalv => psb_s_csc_scal procedure, pass(a) :: maxval => psb_s_csc_maxval - procedure, pass(a) :: spnmi => psb_s_csc_csnmi procedure, pass(a) :: spnm1 => psb_s_csc_csnm1 procedure, pass(a) :: rowsum => psb_s_csc_rowsum procedure, pass(a) :: arwsum => psb_s_csc_arwsum @@ -408,16 +407,6 @@ module psb_s_csc_mat_mod end function psb_s_csc_maxval end interface - !> \memberof psb_s_csc_sparse_mat - !! \see psb_s_base_mat_mod::psb_s_base_csnmi - interface - function psb_s_csc_csnmi(a) result(res) - import :: psb_ipk_, psb_s_csc_sparse_mat, psb_spk_ - class(psb_s_csc_sparse_mat), intent(in) :: a - real(psb_spk_) :: res - end function psb_s_csc_csnmi - end interface - !> \memberof psb_s_csc_sparse_mat !! \see psb_s_base_mat_mod::psb_s_base_csnm1 interface diff --git a/base/modules/psb_s_csr_mat_mod.f90 b/base/modules/psb_s_csr_mat_mod.f90 index 07505874..e9d3c63f 100644 --- a/base/modules/psb_s_csr_mat_mod.f90 +++ b/base/modules/psb_s_csr_mat_mod.f90 @@ -74,7 +74,6 @@ module psb_s_csr_mat_mod procedure, pass(a) :: scalv => psb_s_csr_scal procedure, pass(a) :: maxval => psb_s_csr_maxval procedure, pass(a) :: spnmi => psb_s_csr_csnmi - procedure, pass(a) :: spnm1 => psb_s_csr_csnm1 procedure, pass(a) :: rowsum => psb_s_csr_rowsum procedure, pass(a) :: arwsum => psb_s_csr_arwsum procedure, pass(a) :: colsum => psb_s_csr_colsum @@ -421,16 +420,6 @@ module psb_s_csr_mat_mod end function psb_s_csr_csnmi end interface - !> \memberof psb_s_csr_sparse_mat - !! \see psb_s_base_mat_mod::psb_s_base_csnm1 - interface - function psb_s_csr_csnm1(a) result(res) - import :: psb_ipk_, psb_s_csr_sparse_mat, psb_spk_ - class(psb_s_csr_sparse_mat), intent(in) :: a - real(psb_spk_) :: res - end function psb_s_csr_csnm1 - end interface - !> \memberof psb_s_csr_sparse_mat !! \see psb_s_base_mat_mod::psb_s_base_rowsum interface diff --git a/base/modules/psb_z_csc_mat_mod.f90 b/base/modules/psb_z_csc_mat_mod.f90 index 39431642..9eadcb19 100644 --- a/base/modules/psb_z_csc_mat_mod.f90 +++ b/base/modules/psb_z_csc_mat_mod.f90 @@ -72,7 +72,6 @@ module psb_z_csc_mat_mod procedure, pass(a) :: scals => psb_z_csc_scals procedure, pass(a) :: scalv => psb_z_csc_scal procedure, pass(a) :: maxval => psb_z_csc_maxval - procedure, pass(a) :: spnmi => psb_z_csc_csnmi procedure, pass(a) :: spnm1 => psb_z_csc_csnm1 procedure, pass(a) :: rowsum => psb_z_csc_rowsum procedure, pass(a) :: arwsum => psb_z_csc_arwsum @@ -408,16 +407,6 @@ module psb_z_csc_mat_mod end function psb_z_csc_maxval end interface - !> \memberof psb_z_csc_sparse_mat - !! \see psb_z_base_mat_mod::psb_z_base_csnmi - interface - function psb_z_csc_csnmi(a) result(res) - import :: psb_ipk_, psb_z_csc_sparse_mat, psb_dpk_ - class(psb_z_csc_sparse_mat), intent(in) :: a - real(psb_dpk_) :: res - end function psb_z_csc_csnmi - end interface - !> \memberof psb_z_csc_sparse_mat !! \see psb_z_base_mat_mod::psb_z_base_csnm1 interface diff --git a/base/modules/psb_z_csr_mat_mod.f90 b/base/modules/psb_z_csr_mat_mod.f90 index a3adae3a..0cb75281 100644 --- a/base/modules/psb_z_csr_mat_mod.f90 +++ b/base/modules/psb_z_csr_mat_mod.f90 @@ -74,7 +74,6 @@ module psb_z_csr_mat_mod procedure, pass(a) :: scalv => psb_z_csr_scal procedure, pass(a) :: maxval => psb_z_csr_maxval procedure, pass(a) :: spnmi => psb_z_csr_csnmi - procedure, pass(a) :: spnm1 => psb_z_csr_csnm1 procedure, pass(a) :: rowsum => psb_z_csr_rowsum procedure, pass(a) :: arwsum => psb_z_csr_arwsum procedure, pass(a) :: colsum => psb_z_csr_colsum @@ -421,16 +420,6 @@ module psb_z_csr_mat_mod end function psb_z_csr_csnmi end interface - !> \memberof psb_z_csr_sparse_mat - !! \see psb_z_base_mat_mod::psb_z_base_csnm1 - interface - function psb_z_csr_csnm1(a) result(res) - import :: psb_ipk_, psb_z_csr_sparse_mat, psb_dpk_ - class(psb_z_csr_sparse_mat), intent(in) :: a - real(psb_dpk_) :: res - end function psb_z_csr_csnm1 - end interface - !> \memberof psb_z_csr_sparse_mat !! \see psb_z_base_mat_mod::psb_z_base_rowsum interface diff --git a/base/serial/impl/psb_c_base_mat_impl.F90 b/base/serial/impl/psb_c_base_mat_impl.F90 index d8ae13a5..40a953ca 100644 --- a/base/serial/impl/psb_c_base_mat_impl.F90 +++ b/base/serial/impl/psb_c_base_mat_impl.F90 @@ -1631,6 +1631,7 @@ end function psb_c_base_maxval function psb_c_base_csnmi(a) result(res) use psb_error_mod use psb_const_mod + use psb_realloc_mod use psb_c_base_mat_mod, psb_protect_name => psb_c_base_csnmi implicit none @@ -1674,6 +1675,7 @@ end function psb_c_base_csnmi function psb_c_base_csnm1(a) result(res) use psb_error_mod use psb_const_mod + use psb_realloc_mod use psb_c_base_mat_mod, psb_protect_name => psb_c_base_csnm1 implicit none diff --git a/base/serial/impl/psb_c_csc_impl.f90 b/base/serial/impl/psb_c_csc_impl.f90 index af3884fa..7dc7195c 100644 --- a/base/serial/impl/psb_c_csc_impl.f90 +++ b/base/serial/impl/psb_c_csc_impl.f90 @@ -1094,47 +1094,6 @@ function psb_c_csc_maxval(a) result(res) end if end function psb_c_csc_maxval -function psb_c_csc_csnmi(a) result(res) - use psb_error_mod - use psb_c_csc_mat_mod, psb_protect_name => psb_c_csc_csnmi - implicit none - class(psb_c_csc_sparse_mat), intent(in) :: a - real(psb_spk_) :: res - - integer(psb_ipk_) :: i,j,k,m,n, nr, ir, jc, nc, info - real(psb_spk_), allocatable :: acc(:) - logical :: tra - integer(psb_ipk_) :: err_act - integer(psb_ipk_) :: ierr(5) - character(len=20) :: name='c_csnmi' - logical, parameter :: debug=.false. - - - res = szero - nr = a%get_nrows() - nc = a%get_ncols() - allocate(acc(nr),stat=info) - if (info /= psb_success_) then - return - end if - if (a%is_unit()) then - acc = sone - else - acc = szero - end if - do i=1, nc - do j=a%icp(i),a%icp(i+1)-1 - acc(a%ia(j)) = acc(a%ia(j)) + abs(a%val(j)) - end do - end do - do i=1, nr - res = max(res,acc(i)) - end do - deallocate(acc) - -end function psb_c_csc_csnmi - - function psb_c_csc_csnm1(a) result(res) use psb_error_mod use psb_const_mod diff --git a/base/serial/impl/psb_c_csr_impl.f90 b/base/serial/impl/psb_c_csr_impl.f90 index 2de9cfd8..b124adbd 100644 --- a/base/serial/impl/psb_c_csr_impl.f90 +++ b/base/serial/impl/psb_c_csr_impl.f90 @@ -1326,45 +1326,6 @@ function psb_c_csr_csnmi(a) result(res) end function psb_c_csr_csnmi -function psb_c_csr_csnm1(a) result(res) - use psb_error_mod - use psb_const_mod - use psb_c_csr_mat_mod, psb_protect_name => psb_c_csr_csnm1 - - implicit none - class(psb_c_csr_sparse_mat), intent(in) :: a - real(psb_spk_) :: res - - integer(psb_ipk_) :: i,j,k,m,n, nnz, ir, jc, nc, info - real(psb_spk_) :: acc - real(psb_spk_), allocatable :: vt(:) - logical :: tra - integer(psb_ipk_) :: err_act - integer(psb_ipk_) :: ierr(5) - character(len=20) :: name='d_csr_csnm1' - logical, parameter :: debug=.false. - - - res = szero - nnz = a%get_nzeros() - m = a%get_nrows() - n = a%get_ncols() - allocate(vt(n),stat=info) - if (info /= 0) return - vt(:) = szero - do i=1, m - do j=a%irp(i),a%irp(i+1)-1 - k = a%ja(j) - vt(k) = vt(k) + abs(a%val(j)) - end do - end do - res = maxval(vt(1:n)) - deallocate(vt,stat=info) - - return - -end function psb_c_csr_csnm1 - subroutine psb_c_csr_rowsum(d,a) use psb_error_mod use psb_const_mod diff --git a/base/serial/impl/psb_d_base_mat_impl.F90 b/base/serial/impl/psb_d_base_mat_impl.F90 index cac5955a..e6e87217 100644 --- a/base/serial/impl/psb_d_base_mat_impl.F90 +++ b/base/serial/impl/psb_d_base_mat_impl.F90 @@ -1631,6 +1631,7 @@ end function psb_d_base_maxval function psb_d_base_csnmi(a) result(res) use psb_error_mod use psb_const_mod + use psb_realloc_mod use psb_d_base_mat_mod, psb_protect_name => psb_d_base_csnmi implicit none @@ -1674,6 +1675,7 @@ end function psb_d_base_csnmi function psb_d_base_csnm1(a) result(res) use psb_error_mod use psb_const_mod + use psb_realloc_mod use psb_d_base_mat_mod, psb_protect_name => psb_d_base_csnm1 implicit none diff --git a/base/serial/impl/psb_d_csc_impl.f90 b/base/serial/impl/psb_d_csc_impl.f90 index 3beea7b8..c065eec4 100644 --- a/base/serial/impl/psb_d_csc_impl.f90 +++ b/base/serial/impl/psb_d_csc_impl.f90 @@ -1094,47 +1094,6 @@ function psb_d_csc_maxval(a) result(res) end if end function psb_d_csc_maxval -function psb_d_csc_csnmi(a) result(res) - use psb_error_mod - use psb_d_csc_mat_mod, psb_protect_name => psb_d_csc_csnmi - implicit none - class(psb_d_csc_sparse_mat), intent(in) :: a - real(psb_dpk_) :: res - - integer(psb_ipk_) :: i,j,k,m,n, nr, ir, jc, nc, info - real(psb_dpk_), allocatable :: acc(:) - logical :: tra - integer(psb_ipk_) :: err_act - integer(psb_ipk_) :: ierr(5) - character(len=20) :: name='d_csnmi' - logical, parameter :: debug=.false. - - - res = dzero - nr = a%get_nrows() - nc = a%get_ncols() - allocate(acc(nr),stat=info) - if (info /= psb_success_) then - return - end if - if (a%is_unit()) then - acc = done - else - acc = dzero - end if - do i=1, nc - do j=a%icp(i),a%icp(i+1)-1 - acc(a%ia(j)) = acc(a%ia(j)) + abs(a%val(j)) - end do - end do - do i=1, nr - res = max(res,acc(i)) - end do - deallocate(acc) - -end function psb_d_csc_csnmi - - function psb_d_csc_csnm1(a) result(res) use psb_error_mod use psb_const_mod diff --git a/base/serial/impl/psb_d_csr_impl.f90 b/base/serial/impl/psb_d_csr_impl.f90 index 61bac740..628d42d4 100644 --- a/base/serial/impl/psb_d_csr_impl.f90 +++ b/base/serial/impl/psb_d_csr_impl.f90 @@ -1326,45 +1326,6 @@ function psb_d_csr_csnmi(a) result(res) end function psb_d_csr_csnmi -function psb_d_csr_csnm1(a) result(res) - use psb_error_mod - use psb_const_mod - use psb_d_csr_mat_mod, psb_protect_name => psb_d_csr_csnm1 - - implicit none - class(psb_d_csr_sparse_mat), intent(in) :: a - real(psb_dpk_) :: res - - integer(psb_ipk_) :: i,j,k,m,n, nnz, ir, jc, nc, info - real(psb_dpk_) :: acc - real(psb_dpk_), allocatable :: vt(:) - logical :: tra - integer(psb_ipk_) :: err_act - integer(psb_ipk_) :: ierr(5) - character(len=20) :: name='d_csr_csnm1' - logical, parameter :: debug=.false. - - - res = dzero - nnz = a%get_nzeros() - m = a%get_nrows() - n = a%get_ncols() - allocate(vt(n),stat=info) - if (info /= 0) return - vt(:) = dzero - do i=1, m - do j=a%irp(i),a%irp(i+1)-1 - k = a%ja(j) - vt(k) = vt(k) + abs(a%val(j)) - end do - end do - res = maxval(vt(1:n)) - deallocate(vt,stat=info) - - return - -end function psb_d_csr_csnm1 - subroutine psb_d_csr_rowsum(d,a) use psb_error_mod use psb_const_mod diff --git a/base/serial/impl/psb_s_base_mat_impl.F90 b/base/serial/impl/psb_s_base_mat_impl.F90 index aed57415..cea210bb 100644 --- a/base/serial/impl/psb_s_base_mat_impl.F90 +++ b/base/serial/impl/psb_s_base_mat_impl.F90 @@ -1631,6 +1631,7 @@ end function psb_s_base_maxval function psb_s_base_csnmi(a) result(res) use psb_error_mod use psb_const_mod + use psb_realloc_mod use psb_s_base_mat_mod, psb_protect_name => psb_s_base_csnmi implicit none @@ -1674,6 +1675,7 @@ end function psb_s_base_csnmi function psb_s_base_csnm1(a) result(res) use psb_error_mod use psb_const_mod + use psb_realloc_mod use psb_s_base_mat_mod, psb_protect_name => psb_s_base_csnm1 implicit none diff --git a/base/serial/impl/psb_s_csc_impl.f90 b/base/serial/impl/psb_s_csc_impl.f90 index a89f52da..c925defa 100644 --- a/base/serial/impl/psb_s_csc_impl.f90 +++ b/base/serial/impl/psb_s_csc_impl.f90 @@ -1094,47 +1094,6 @@ function psb_s_csc_maxval(a) result(res) end if end function psb_s_csc_maxval -function psb_s_csc_csnmi(a) result(res) - use psb_error_mod - use psb_s_csc_mat_mod, psb_protect_name => psb_s_csc_csnmi - implicit none - class(psb_s_csc_sparse_mat), intent(in) :: a - real(psb_spk_) :: res - - integer(psb_ipk_) :: i,j,k,m,n, nr, ir, jc, nc, info - real(psb_spk_), allocatable :: acc(:) - logical :: tra - integer(psb_ipk_) :: err_act - integer(psb_ipk_) :: ierr(5) - character(len=20) :: name='s_csnmi' - logical, parameter :: debug=.false. - - - res = szero - nr = a%get_nrows() - nc = a%get_ncols() - allocate(acc(nr),stat=info) - if (info /= psb_success_) then - return - end if - if (a%is_unit()) then - acc = sone - else - acc = szero - end if - do i=1, nc - do j=a%icp(i),a%icp(i+1)-1 - acc(a%ia(j)) = acc(a%ia(j)) + abs(a%val(j)) - end do - end do - do i=1, nr - res = max(res,acc(i)) - end do - deallocate(acc) - -end function psb_s_csc_csnmi - - function psb_s_csc_csnm1(a) result(res) use psb_error_mod use psb_const_mod diff --git a/base/serial/impl/psb_s_csr_impl.f90 b/base/serial/impl/psb_s_csr_impl.f90 index 69b69ded..338b57a6 100644 --- a/base/serial/impl/psb_s_csr_impl.f90 +++ b/base/serial/impl/psb_s_csr_impl.f90 @@ -1326,45 +1326,6 @@ function psb_s_csr_csnmi(a) result(res) end function psb_s_csr_csnmi -function psb_s_csr_csnm1(a) result(res) - use psb_error_mod - use psb_const_mod - use psb_s_csr_mat_mod, psb_protect_name => psb_s_csr_csnm1 - - implicit none - class(psb_s_csr_sparse_mat), intent(in) :: a - real(psb_spk_) :: res - - integer(psb_ipk_) :: i,j,k,m,n, nnz, ir, jc, nc, info - real(psb_spk_) :: acc - real(psb_spk_), allocatable :: vt(:) - logical :: tra - integer(psb_ipk_) :: err_act - integer(psb_ipk_) :: ierr(5) - character(len=20) :: name='d_csr_csnm1' - logical, parameter :: debug=.false. - - - res = szero - nnz = a%get_nzeros() - m = a%get_nrows() - n = a%get_ncols() - allocate(vt(n),stat=info) - if (info /= 0) return - vt(:) = szero - do i=1, m - do j=a%irp(i),a%irp(i+1)-1 - k = a%ja(j) - vt(k) = vt(k) + abs(a%val(j)) - end do - end do - res = maxval(vt(1:n)) - deallocate(vt,stat=info) - - return - -end function psb_s_csr_csnm1 - subroutine psb_s_csr_rowsum(d,a) use psb_error_mod use psb_const_mod diff --git a/base/serial/impl/psb_z_base_mat_impl.F90 b/base/serial/impl/psb_z_base_mat_impl.F90 index aea3cb5f..a26ee37f 100644 --- a/base/serial/impl/psb_z_base_mat_impl.F90 +++ b/base/serial/impl/psb_z_base_mat_impl.F90 @@ -1631,6 +1631,7 @@ end function psb_z_base_maxval function psb_z_base_csnmi(a) result(res) use psb_error_mod use psb_const_mod + use psb_realloc_mod use psb_z_base_mat_mod, psb_protect_name => psb_z_base_csnmi implicit none @@ -1674,6 +1675,7 @@ end function psb_z_base_csnmi function psb_z_base_csnm1(a) result(res) use psb_error_mod use psb_const_mod + use psb_realloc_mod use psb_z_base_mat_mod, psb_protect_name => psb_z_base_csnm1 implicit none diff --git a/base/serial/impl/psb_z_csc_impl.f90 b/base/serial/impl/psb_z_csc_impl.f90 index 6b2c3250..802fc9b6 100644 --- a/base/serial/impl/psb_z_csc_impl.f90 +++ b/base/serial/impl/psb_z_csc_impl.f90 @@ -1094,47 +1094,6 @@ function psb_z_csc_maxval(a) result(res) end if end function psb_z_csc_maxval -function psb_z_csc_csnmi(a) result(res) - use psb_error_mod - use psb_z_csc_mat_mod, psb_protect_name => psb_z_csc_csnmi - implicit none - class(psb_z_csc_sparse_mat), intent(in) :: a - real(psb_dpk_) :: res - - integer(psb_ipk_) :: i,j,k,m,n, nr, ir, jc, nc, info - real(psb_dpk_), allocatable :: acc(:) - logical :: tra - integer(psb_ipk_) :: err_act - integer(psb_ipk_) :: ierr(5) - character(len=20) :: name='z_csnmi' - logical, parameter :: debug=.false. - - - res = dzero - nr = a%get_nrows() - nc = a%get_ncols() - allocate(acc(nr),stat=info) - if (info /= psb_success_) then - return - end if - if (a%is_unit()) then - acc = done - else - acc = dzero - end if - do i=1, nc - do j=a%icp(i),a%icp(i+1)-1 - acc(a%ia(j)) = acc(a%ia(j)) + abs(a%val(j)) - end do - end do - do i=1, nr - res = max(res,acc(i)) - end do - deallocate(acc) - -end function psb_z_csc_csnmi - - function psb_z_csc_csnm1(a) result(res) use psb_error_mod use psb_const_mod diff --git a/base/serial/impl/psb_z_csr_impl.f90 b/base/serial/impl/psb_z_csr_impl.f90 index 49059c4c..bf0027ad 100644 --- a/base/serial/impl/psb_z_csr_impl.f90 +++ b/base/serial/impl/psb_z_csr_impl.f90 @@ -1326,45 +1326,6 @@ function psb_z_csr_csnmi(a) result(res) end function psb_z_csr_csnmi -function psb_z_csr_csnm1(a) result(res) - use psb_error_mod - use psb_const_mod - use psb_z_csr_mat_mod, psb_protect_name => psb_z_csr_csnm1 - - implicit none - class(psb_z_csr_sparse_mat), intent(in) :: a - real(psb_dpk_) :: res - - integer(psb_ipk_) :: i,j,k,m,n, nnz, ir, jc, nc, info - real(psb_dpk_) :: acc - real(psb_dpk_), allocatable :: vt(:) - logical :: tra - integer(psb_ipk_) :: err_act - integer(psb_ipk_) :: ierr(5) - character(len=20) :: name='d_csr_csnm1' - logical, parameter :: debug=.false. - - - res = dzero - nnz = a%get_nzeros() - m = a%get_nrows() - n = a%get_ncols() - allocate(vt(n),stat=info) - if (info /= 0) return - vt(:) = dzero - do i=1, m - do j=a%irp(i),a%irp(i+1)-1 - k = a%ja(j) - vt(k) = vt(k) + abs(a%val(j)) - end do - end do - res = maxval(vt(1:n)) - deallocate(vt,stat=info) - - return - -end function psb_z_csr_csnm1 - subroutine psb_z_csr_rowsum(d,a) use psb_error_mod use psb_const_mod