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.
psblas-3.3.1-1
Salvatore Filippone 10 years ago
parent 9acfdc0dad
commit 4709d68502

@ -72,7 +72,6 @@ module psb_c_csc_mat_mod
procedure, pass(a) :: scals => psb_c_csc_scals procedure, pass(a) :: scals => psb_c_csc_scals
procedure, pass(a) :: scalv => psb_c_csc_scal procedure, pass(a) :: scalv => psb_c_csc_scal
procedure, pass(a) :: maxval => psb_c_csc_maxval 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) :: spnm1 => psb_c_csc_csnm1
procedure, pass(a) :: rowsum => psb_c_csc_rowsum procedure, pass(a) :: rowsum => psb_c_csc_rowsum
procedure, pass(a) :: arwsum => psb_c_csc_arwsum 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 function psb_c_csc_maxval
end interface 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 !> \memberof psb_c_csc_sparse_mat
!! \see psb_c_base_mat_mod::psb_c_base_csnm1 !! \see psb_c_base_mat_mod::psb_c_base_csnm1
interface interface

@ -74,7 +74,6 @@ module psb_c_csr_mat_mod
procedure, pass(a) :: scalv => psb_c_csr_scal procedure, pass(a) :: scalv => psb_c_csr_scal
procedure, pass(a) :: maxval => psb_c_csr_maxval procedure, pass(a) :: maxval => psb_c_csr_maxval
procedure, pass(a) :: spnmi => psb_c_csr_csnmi 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) :: rowsum => psb_c_csr_rowsum
procedure, pass(a) :: arwsum => psb_c_csr_arwsum procedure, pass(a) :: arwsum => psb_c_csr_arwsum
procedure, pass(a) :: colsum => psb_c_csr_colsum 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 function psb_c_csr_csnmi
end interface 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 !> \memberof psb_c_csr_sparse_mat
!! \see psb_c_base_mat_mod::psb_c_base_rowsum !! \see psb_c_base_mat_mod::psb_c_base_rowsum
interface interface

@ -72,7 +72,6 @@ module psb_d_csc_mat_mod
procedure, pass(a) :: scals => psb_d_csc_scals procedure, pass(a) :: scals => psb_d_csc_scals
procedure, pass(a) :: scalv => psb_d_csc_scal procedure, pass(a) :: scalv => psb_d_csc_scal
procedure, pass(a) :: maxval => psb_d_csc_maxval 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) :: spnm1 => psb_d_csc_csnm1
procedure, pass(a) :: rowsum => psb_d_csc_rowsum procedure, pass(a) :: rowsum => psb_d_csc_rowsum
procedure, pass(a) :: arwsum => psb_d_csc_arwsum 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 function psb_d_csc_maxval
end interface 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 !> \memberof psb_d_csc_sparse_mat
!! \see psb_d_base_mat_mod::psb_d_base_csnm1 !! \see psb_d_base_mat_mod::psb_d_base_csnm1
interface interface

@ -74,7 +74,6 @@ module psb_d_csr_mat_mod
procedure, pass(a) :: scalv => psb_d_csr_scal procedure, pass(a) :: scalv => psb_d_csr_scal
procedure, pass(a) :: maxval => psb_d_csr_maxval procedure, pass(a) :: maxval => psb_d_csr_maxval
procedure, pass(a) :: spnmi => psb_d_csr_csnmi 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) :: rowsum => psb_d_csr_rowsum
procedure, pass(a) :: arwsum => psb_d_csr_arwsum procedure, pass(a) :: arwsum => psb_d_csr_arwsum
procedure, pass(a) :: colsum => psb_d_csr_colsum 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 function psb_d_csr_csnmi
end interface 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 !> \memberof psb_d_csr_sparse_mat
!! \see psb_d_base_mat_mod::psb_d_base_rowsum !! \see psb_d_base_mat_mod::psb_d_base_rowsum
interface interface

@ -72,7 +72,6 @@ module psb_s_csc_mat_mod
procedure, pass(a) :: scals => psb_s_csc_scals procedure, pass(a) :: scals => psb_s_csc_scals
procedure, pass(a) :: scalv => psb_s_csc_scal procedure, pass(a) :: scalv => psb_s_csc_scal
procedure, pass(a) :: maxval => psb_s_csc_maxval 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) :: spnm1 => psb_s_csc_csnm1
procedure, pass(a) :: rowsum => psb_s_csc_rowsum procedure, pass(a) :: rowsum => psb_s_csc_rowsum
procedure, pass(a) :: arwsum => psb_s_csc_arwsum 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 function psb_s_csc_maxval
end interface 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 !> \memberof psb_s_csc_sparse_mat
!! \see psb_s_base_mat_mod::psb_s_base_csnm1 !! \see psb_s_base_mat_mod::psb_s_base_csnm1
interface interface

@ -74,7 +74,6 @@ module psb_s_csr_mat_mod
procedure, pass(a) :: scalv => psb_s_csr_scal procedure, pass(a) :: scalv => psb_s_csr_scal
procedure, pass(a) :: maxval => psb_s_csr_maxval procedure, pass(a) :: maxval => psb_s_csr_maxval
procedure, pass(a) :: spnmi => psb_s_csr_csnmi 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) :: rowsum => psb_s_csr_rowsum
procedure, pass(a) :: arwsum => psb_s_csr_arwsum procedure, pass(a) :: arwsum => psb_s_csr_arwsum
procedure, pass(a) :: colsum => psb_s_csr_colsum 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 function psb_s_csr_csnmi
end interface 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 !> \memberof psb_s_csr_sparse_mat
!! \see psb_s_base_mat_mod::psb_s_base_rowsum !! \see psb_s_base_mat_mod::psb_s_base_rowsum
interface interface

@ -72,7 +72,6 @@ module psb_z_csc_mat_mod
procedure, pass(a) :: scals => psb_z_csc_scals procedure, pass(a) :: scals => psb_z_csc_scals
procedure, pass(a) :: scalv => psb_z_csc_scal procedure, pass(a) :: scalv => psb_z_csc_scal
procedure, pass(a) :: maxval => psb_z_csc_maxval 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) :: spnm1 => psb_z_csc_csnm1
procedure, pass(a) :: rowsum => psb_z_csc_rowsum procedure, pass(a) :: rowsum => psb_z_csc_rowsum
procedure, pass(a) :: arwsum => psb_z_csc_arwsum 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 function psb_z_csc_maxval
end interface 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 !> \memberof psb_z_csc_sparse_mat
!! \see psb_z_base_mat_mod::psb_z_base_csnm1 !! \see psb_z_base_mat_mod::psb_z_base_csnm1
interface interface

@ -74,7 +74,6 @@ module psb_z_csr_mat_mod
procedure, pass(a) :: scalv => psb_z_csr_scal procedure, pass(a) :: scalv => psb_z_csr_scal
procedure, pass(a) :: maxval => psb_z_csr_maxval procedure, pass(a) :: maxval => psb_z_csr_maxval
procedure, pass(a) :: spnmi => psb_z_csr_csnmi 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) :: rowsum => psb_z_csr_rowsum
procedure, pass(a) :: arwsum => psb_z_csr_arwsum procedure, pass(a) :: arwsum => psb_z_csr_arwsum
procedure, pass(a) :: colsum => psb_z_csr_colsum 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 function psb_z_csr_csnmi
end interface 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 !> \memberof psb_z_csr_sparse_mat
!! \see psb_z_base_mat_mod::psb_z_base_rowsum !! \see psb_z_base_mat_mod::psb_z_base_rowsum
interface interface

@ -1631,6 +1631,7 @@ end function psb_c_base_maxval
function psb_c_base_csnmi(a) result(res) function psb_c_base_csnmi(a) result(res)
use psb_error_mod use psb_error_mod
use psb_const_mod use psb_const_mod
use psb_realloc_mod
use psb_c_base_mat_mod, psb_protect_name => psb_c_base_csnmi use psb_c_base_mat_mod, psb_protect_name => psb_c_base_csnmi
implicit none implicit none
@ -1674,6 +1675,7 @@ end function psb_c_base_csnmi
function psb_c_base_csnm1(a) result(res) function psb_c_base_csnm1(a) result(res)
use psb_error_mod use psb_error_mod
use psb_const_mod use psb_const_mod
use psb_realloc_mod
use psb_c_base_mat_mod, psb_protect_name => psb_c_base_csnm1 use psb_c_base_mat_mod, psb_protect_name => psb_c_base_csnm1
implicit none implicit none

@ -1094,47 +1094,6 @@ function psb_c_csc_maxval(a) result(res)
end if end if
end function psb_c_csc_maxval 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) function psb_c_csc_csnm1(a) result(res)
use psb_error_mod use psb_error_mod
use psb_const_mod use psb_const_mod

@ -1326,45 +1326,6 @@ function psb_c_csr_csnmi(a) result(res)
end function psb_c_csr_csnmi 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) subroutine psb_c_csr_rowsum(d,a)
use psb_error_mod use psb_error_mod
use psb_const_mod use psb_const_mod

@ -1631,6 +1631,7 @@ end function psb_d_base_maxval
function psb_d_base_csnmi(a) result(res) function psb_d_base_csnmi(a) result(res)
use psb_error_mod use psb_error_mod
use psb_const_mod use psb_const_mod
use psb_realloc_mod
use psb_d_base_mat_mod, psb_protect_name => psb_d_base_csnmi use psb_d_base_mat_mod, psb_protect_name => psb_d_base_csnmi
implicit none implicit none
@ -1674,6 +1675,7 @@ end function psb_d_base_csnmi
function psb_d_base_csnm1(a) result(res) function psb_d_base_csnm1(a) result(res)
use psb_error_mod use psb_error_mod
use psb_const_mod use psb_const_mod
use psb_realloc_mod
use psb_d_base_mat_mod, psb_protect_name => psb_d_base_csnm1 use psb_d_base_mat_mod, psb_protect_name => psb_d_base_csnm1
implicit none implicit none

@ -1094,47 +1094,6 @@ function psb_d_csc_maxval(a) result(res)
end if end if
end function psb_d_csc_maxval 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) function psb_d_csc_csnm1(a) result(res)
use psb_error_mod use psb_error_mod
use psb_const_mod use psb_const_mod

@ -1326,45 +1326,6 @@ function psb_d_csr_csnmi(a) result(res)
end function psb_d_csr_csnmi 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) subroutine psb_d_csr_rowsum(d,a)
use psb_error_mod use psb_error_mod
use psb_const_mod use psb_const_mod

@ -1631,6 +1631,7 @@ end function psb_s_base_maxval
function psb_s_base_csnmi(a) result(res) function psb_s_base_csnmi(a) result(res)
use psb_error_mod use psb_error_mod
use psb_const_mod use psb_const_mod
use psb_realloc_mod
use psb_s_base_mat_mod, psb_protect_name => psb_s_base_csnmi use psb_s_base_mat_mod, psb_protect_name => psb_s_base_csnmi
implicit none implicit none
@ -1674,6 +1675,7 @@ end function psb_s_base_csnmi
function psb_s_base_csnm1(a) result(res) function psb_s_base_csnm1(a) result(res)
use psb_error_mod use psb_error_mod
use psb_const_mod use psb_const_mod
use psb_realloc_mod
use psb_s_base_mat_mod, psb_protect_name => psb_s_base_csnm1 use psb_s_base_mat_mod, psb_protect_name => psb_s_base_csnm1
implicit none implicit none

@ -1094,47 +1094,6 @@ function psb_s_csc_maxval(a) result(res)
end if end if
end function psb_s_csc_maxval 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) function psb_s_csc_csnm1(a) result(res)
use psb_error_mod use psb_error_mod
use psb_const_mod use psb_const_mod

@ -1326,45 +1326,6 @@ function psb_s_csr_csnmi(a) result(res)
end function psb_s_csr_csnmi 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) subroutine psb_s_csr_rowsum(d,a)
use psb_error_mod use psb_error_mod
use psb_const_mod use psb_const_mod

@ -1631,6 +1631,7 @@ end function psb_z_base_maxval
function psb_z_base_csnmi(a) result(res) function psb_z_base_csnmi(a) result(res)
use psb_error_mod use psb_error_mod
use psb_const_mod use psb_const_mod
use psb_realloc_mod
use psb_z_base_mat_mod, psb_protect_name => psb_z_base_csnmi use psb_z_base_mat_mod, psb_protect_name => psb_z_base_csnmi
implicit none implicit none
@ -1674,6 +1675,7 @@ end function psb_z_base_csnmi
function psb_z_base_csnm1(a) result(res) function psb_z_base_csnm1(a) result(res)
use psb_error_mod use psb_error_mod
use psb_const_mod use psb_const_mod
use psb_realloc_mod
use psb_z_base_mat_mod, psb_protect_name => psb_z_base_csnm1 use psb_z_base_mat_mod, psb_protect_name => psb_z_base_csnm1
implicit none implicit none

@ -1094,47 +1094,6 @@ function psb_z_csc_maxval(a) result(res)
end if end if
end function psb_z_csc_maxval 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) function psb_z_csc_csnm1(a) result(res)
use psb_error_mod use psb_error_mod
use psb_const_mod use psb_const_mod

@ -1326,45 +1326,6 @@ function psb_z_csr_csnmi(a) result(res)
end function psb_z_csr_csnmi 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) subroutine psb_z_csr_rowsum(d,a)
use psb_error_mod use psb_error_mod
use psb_const_mod use psb_const_mod

Loading…
Cancel
Save