From ad61accbb07381252b42d2b460785fce94221fda Mon Sep 17 00:00:00 2001 From: Salvatore Filippone Date: Mon, 21 Nov 2011 15:51:46 +0000 Subject: [PATCH] psblas3: base/modules/psb_const_mod.F90 base/modules/psb_error_mod.F90 util/psb_d_renum_impl.F90a Added check for square matrices. --- base/modules/psb_const_mod.F90 | 1 + base/modules/psb_error_mod.F90 | 3 +++ util/psb_d_renum_impl.F90 | 12 ++++++++++-- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/base/modules/psb_const_mod.F90 b/base/modules/psb_const_mod.F90 index be010e67..5db8533b 100644 --- a/base/modules/psb_const_mod.F90 +++ b/base/modules/psb_const_mod.F90 @@ -178,6 +178,7 @@ module psb_const_mod integer, parameter, public :: psb_err_spmat_invalid_state_=600 integer, parameter, public :: psb_err_missing_override_method_=700 integer, parameter, public :: psb_err_invalid_dynamic_type_=701 + integer, parameter, public :: psb_err_rectangular_mat_unsupported_=1120 integer, parameter, public :: psb_err_invalid_mat_state_=1121 integer, parameter, public :: psb_err_invalid_cd_state_=1122 integer, parameter, public :: psb_err_invalid_a_and_cd_state_=1123 diff --git a/base/modules/psb_error_mod.F90 b/base/modules/psb_error_mod.F90 index 7154b246..8f57a7f6 100644 --- a/base/modules/psb_error_mod.F90 +++ b/base/modules/psb_error_mod.F90 @@ -487,6 +487,9 @@ contains case(psb_err_invalid_dynamic_type_) write(psb_err_unit,'("input argument n. ",i0," has a dynamic type not allowed here.")')& & i_e_d(1) + case (psb_err_rectangular_mat_unsupported_) + write(psb_err_unit,'("This routine does not support rectangular matrices: ",i0, " /= ",i0)'), & + & i_e_d(1), i_e_d(2) case (psb_err_invalid_mat_state_) write(psb_err_unit,'("Invalid state for sparse matrix")') case (psb_err_invalid_cd_state_) diff --git a/util/psb_d_renum_impl.F90 b/util/psb_d_renum_impl.F90 index e01ab787..212067e1 100644 --- a/util/psb_d_renum_impl.F90 +++ b/util/psb_d_renum_impl.F90 @@ -7,14 +7,22 @@ subroutine psb_d_mat_renum(alg,mat,info,perm) integer, intent(out) :: info integer, allocatable, optional, intent(out) :: perm(:) - integer :: err_act - character(len=20) :: name + integer :: err_act, nr, nc + character(len=20) :: name info = psb_success_ name = 'mat_renum' call psb_erractionsave(err_act) info = psb_success_ + + nr = mat%get_nrows() + nc = mat%get_ncols() + if (nr /= nc) then + info = psb_err_rectangular_mat_unsupported_ + call psb_errpush(info,name,i_err=(/nr,nc,0,0,0/)) + goto 9999 + end if select case (alg) case(psb_mat_renum_gps_)