34 #include "qrm_common.h"
57 real(kind(1.d0)) :: b(:,:), x(:,:)
58 real(kind(1.d0)) :: nrm(:)
60 real(kind(1.d0)),
allocatable :: nrmb(:), nrmx(:)
61 real(kind(1.d0)) :: nrma
66 character(len=*),
parameter :: name=
'qrm_residual_norm'
71 __qrm_check_ret(name,
'qrm_check_spmat',9999)
73 nrhs = min(
size(b,2),
size(x,2))
75 call qrm_aalloc(nrmb, nrhs)
76 call qrm_aalloc(nrmx, nrhs)
78 call
qrm_vecnrm(b(:,1:nrhs), qrm_mat%m,
'i', nrmb)
79 call
qrm_vecnrm(x(:,1:nrhs), qrm_mat%n,
'i', nrmx)
82 call
qrm_matmul(qrm_mat,
'n', -1.d0, x, 1.d0, b)
86 nrmb = nrmb + nrma*nrmx
90 call qrm_adealloc(nrmx)
91 call qrm_adealloc(nrmb)
98 if(err_act .eq. qrm_abort_)
then
128 real(kind(1.d0)) :: b(:), x(:)
129 real(kind(1.d0)) :: nrm
131 real(kind(1.d0)) :: nrmb, nrmx
132 real(kind(1.d0)) :: nrma
137 character(len=*),
parameter :: name=
'qrm_residual_norm'
142 __qrm_check_ret(name,
'qrm_check_spmat',9999)
148 call
qrm_matmul(qrm_mat,
'n', -1.d0, x, 1.d0, b)
152 nrmb = nrmb + nrma*nrmx
160 if(err_act .eq. qrm_abort_)
then
This module contains all the error management routines and data.
subroutine dqrm_residual_norm1d(qrm_mat, b, x, nrm)
This routine computes the scaled norm of the residual.
Generic interface for the ::dqrm_matmul2d and ::dqrm_matmul1d routines.
subroutine qrm_err_act_restore(err_act)
Restores the value of the qrm_err_act variable.
This module contains the definition of the basic sparse matrix type and of the associated methods...
Generic interface for the ::dqrm_vecnrm2d and ::dqrm_vecnrm1d routines.
This module contains generic interfaces for a number of auxiliary tools.
subroutine qrm_err_check()
This subroutine checks the errors stack. If something is found all the entries in the stack are poppe...
This type defines the data structure used to store a matrix.
subroutine dqrm_check_spmat(qrm_spmat, op)
Check the compatibility and correctness of icntl and rcntl parameters.
subroutine dqrm_residual_norm2d(qrm_mat, b, x, nrm)
This routine computes the scaled norm of multiple residuals.
subroutine qrm_err_act_save(err_act)
Saves a copy of the qrm_err_act variable.