NAG Library Function Document

nag_linsys_complex_gen_norm_rcomm (f04zdc)


    1  Purpose
    7  Accuracy


nag_linsys_complex_gen_norm_rcomm (f04zdc) estimates the 1-norm of a complex rectangular matrix without accessing the matrix explicitly. It uses reverse communication for evaluating matrix products. The function may be used for estimating condition numbers of square matrices.


#include <nag.h>
#include <nagf04.h>
void  nag_linsys_complex_gen_norm_rcomm (Integer *irevcm, Integer m, Integer n, Complex x[], Integer pdx, Complex y[], Integer pdy, double *estnrm, Integer t, Integer seed, Complex work[], double rwork[], Integer iwork[], NagError *fail)


nag_linsys_complex_gen_norm_rcomm (f04zdc) computes an estimate (a lower bound) for the 1-norm
A1 = max 1jn i=1 m aij (1)
of an m by n complex matrix A=aij. The function regards the matrix A as being defined by a user-supplied ‘Black Box’ which, given an n×t matrix X (with tn) or an m×t matrix Y, can return AX or AHY, where AH is the complex conjugate transpose. A reverse communication interface is used; thus control is returned to the calling program whenever a matrix product is required.
Note:  this function is not recommended for use when the elements of A are known explicitly; it is then more efficient to compute the 1-norm directly from the formula (1) above.
The main use of the function is for estimating B-11 for a square matrix B, and hence the condition number κ1B=B1B-11, without forming B-1 explicitly (A=B-1 above).
If, for example, an LU factorization of B is available, the matrix products B-1X and B-HY required by nag_linsys_complex_gen_norm_rcomm (f04zdc) may be computed by back- and forward-substitutions, without computing B-1.
The function can also be used to estimate 1-norms of matrix products such as A-1B and ABC, without forming the products explicitly. Further applications are described in Higham (1988).
Since A=AH1, nag_linsys_complex_gen_norm_rcomm (f04zdc) can be used to estimate the -norm of A by working with AH instead of A.
The algorithm used is described in Higham and Tisseur (2000).


Higham N J (1988) FORTRAN codes for estimating the one-norm of a real or complex matrix, with applications to condition estimation ACM Trans. Math. Software 14 381–396
Higham N J and Tisseur F (2000) A block algorithm for matrix 1-norm estimation, with an application to 1-norm pseudospectra SIAM J. Matrix. Anal. Appl. 21 1185–1201


Note:  this function uses reverse communication. Its use involves an initial entry, intermediate exits and re-entries, and a final exit, as indicated by the argument irevcm. Between intermediate exits and re-entries, all arguments other than x and y must remain unchanged.
1:     irevcm Integer *Input/Output
On initial entry: must be set to 0.
On intermediate exit: irevcm=1 or 2, and x contains the n×t matrix X and y contains the m×t matrix Y. The calling program must
(a) if irevcm=1, evaluate AX and store the result in y
if irevcm=2, evaluate AHY and store the result in x, where AH is the complex conjugate transpose;
(b) call nag_linsys_complex_gen_norm_rcomm (f04zdc) once again, with all the arguments unchanged.
On intermediate re-entry: irevcm must be unchanged.
On final exit: irevcm=0.
Note: any values you return to nag_linsys_complex_gen_norm_rcomm (f04zdc) as part of the reverse communication procedure should not include floating-point NaN (Not a Number) or infinity values, since these are not handled by nag_linsys_complex_gen_norm_rcomm (f04zdc). If your code inadvertently does return any NaNs or infinities, nag_linsys_complex_gen_norm_rcomm (f04zdc) is likely to produce unexpected results.
2:     m IntegerInput
On entry: the number of rows of the matrix A.
Constraint: m0.
3:     n IntegerInput
On initial entry: n, the number of columns of the matrix A.
Constraint: n0.
4:     x[dim] ComplexInput/Output
Note: the dimension, dim, of the array x must be at least pdx×t.
The i,jth element of the matrix X is stored in x[j-1×pdx+i-1].
On initial entry: need not be set.
On intermediate exit: if irevcm=1, contains the current matrix X.
On intermediate re-entry: if irevcm=2, must contain AHY.
On final exit: the array is undefined.
5:     pdx IntegerInput
On entry: the stride separating matrix row elements in the array x.
Constraint: pdxn.
6:     y[dim] ComplexInput/Output
Note: the dimension, dim, of the array y must be at least pdy×t.
The i,jth element of the matrix Y is stored in y[j-1×pdy+i-1].
On initial entry: need not be set.
On intermediate exit: if irevcm=2, contains the current matrix Y.
On intermediate re-entry: if irevcm=1, must contain AX.
On final exit: the array is undefined.
7:     pdy IntegerInput
On entry: the stride separating matrix row elements in the array y.
Constraint: pdym.
8:     estnrm double *Input/Output
On initial entry: need not be set.
On intermediate re-entry: must not be changed.
On final exit: an estimate (a lower bound) for A1.
9:     t IntegerInput
On entry: the number of columns t of the matrices X and Y. This is an argument that can be used to control the accuracy and reliability of the estimate and corresponds roughly to the number of columns of A that are visited during each iteration of the algorithm.
If t2 then a partly random starting matrix is used in the algorithm.
Suggested value: t=2.
Constraint: 1tm.
10:   seed IntegerInput
On entry: the seed used for random number generation.
If t=1, seed is not used.
Constraint: if t>1, seed1.
11:   work[m×t] ComplexCommunication Array
12:   rwork[2×n] doubleCommunication Array
13:   iwork[2×n+5×t+20] IntegerCommunication Array
On initial entry: need not be set.
On intermediate re-entry: must not be changed.
14:   fail NagError *Input/Output
The NAG error argument (see Section 3.7 in How to Use the NAG Library and its Documentation).

Error Indicators and Warnings

Dynamic memory allocation failed.
See Section in How to Use the NAG Library and its Documentation for further information.
On entry, argument value had an illegal value.
On entry, irevcm=value.
Constraint: irevcm=0, 1 or 2.
On entry, m=value.
Constraint: m0.
On entry, n=value.
Constraint: n0.
On initial entry, irevcm=value.
Constraint: irevcm=0.
On entry, m=value and t=value.
Constraint: 1tm.
On entry, pdx=value and n=value.
Constraint: pdxn.
On entry, pdy=value and m=value.
Constraint: pdym.
On entry, t=value and seed=value.
Constraint: if t>1, seed1.
An internal error has occurred in this function. Check the function call and any array sizes. If the call is correct then please contact NAG for assistance.
See Section 2.7.6 in How to Use the NAG Library and its Documentation for further information.
Your licence key may have expired or may not have been installed correctly.
See Section 2.7.5 in How to Use the NAG Library and its Documentation for further information.


In extensive tests on random matrices of size up to m=n=450 the estimate estnrm has been found always to be within a factor two of A1; often the estimate has many correct figures. However, matrices exist for which the estimate is smaller than A1 by an arbitrary factor; such matrices are very unlikely to arise in practice. See Higham and Tisseur (2000) for further details.

Parallelism and Performance

nag_linsys_complex_gen_norm_rcomm (f04zdc) is threaded by NAG for parallel execution in multithreaded implementations of the NAG Library.
Please consult the x06 Chapter Introduction for information on how to control and interrogate the OpenMP environment used within this function. Please also consult the Users' Note for your implementation for any additional implementation-specific information.

Further Comments


For most problems the time taken during calls to nag_linsys_complex_gen_norm_rcomm (f04zdc) will be negligible compared with the time spent evaluating matrix products between calls to nag_linsys_complex_gen_norm_rcomm (f04zdc).
The number of matrix products required depends on the matrix A. At most six products of the form Y=AX and five products of the form X=AHY will be required. The number of iterations is independent of the choice of t.


It is your responsibility to guard against potential overflows during evaluation of the matrix products. In particular, when estimating B-11 using a triangular factorization of B, nag_linsys_complex_gen_norm_rcomm (f04zdc) should not be called if one of the factors is exactly singular – otherwise division by zero may occur in the substitutions.

Choice of t

The argument t controls the accuracy and reliability of the estimate. For t=1, the algorithm behaves similarly to the LAPACK estimator xLACON. Increasing t typically improves the estimate, without increasing the number of iterations required.
For t2, random matrices are used in the algorithm, so for repeatable results the same value of seed should be used each time.
A value of t=2 is recommended for new users.

Use in Conjunction with NAG Library Routines

To estimate the 1-norm of the inverse of a matrix A, the following skeleton code can normally be used:
do {
   if (irevcm == 1){
     .. Code to compute y = A^(-1) x ..
   else if  (irevcm == 2){
     .. Code to compute x = A^(-H) y ..
} (while irevcm != 0)
To compute A-1X or A-HY, solve the equation AY=X or AHX=Y storing the result in y or x respectively. The code will vary, depending on the type of the matrix A, and the NAG function used to factorize A.
The example program in Section 10 illustrates how nag_linsys_complex_gen_norm_rcomm (f04zdc) can be used in conjunction with NAG C Library function for LU factorization of complex matrices nag_zgetrf (f07arc)).
It is also straightforward to use nag_linsys_complex_gen_norm_rcomm (f04zdc) for Hermitian positive definite matrices, using nag_zge_copy (f16tfc), nag_zpotrf (f07frc) and nag_zpotrs (f07fsc) for factorization and solution.
For upper or lower triangular square matrices, no factorization function is needed: Y=A-1X and X=A-HY may be computed by calls to nag_ztrsv (f16sjc) (or nag_ztbsv (f16skc) if the matrix is banded, or nag_ztpsv (f16slc) if the matrix is stored in packed form).


This example estimates the condition number A1A-11 of the matrix A given by
A = 0.7+0.1i -0.2+0.0i 1.0+0.0i 0.0+0.0i 0.0+0.0i 0.1+0.0i 0.3+0.0i 0.7+0.0i 0.0+0.0i 1.0+0.2i 0.9+0.0i 0.2+0.0i 0.0+5.9i 0.0+0.0i 0.2+0.0i 0.7+0.0i 0.4+6.1i 1.1+0.4i 0.0+0.1i 0.0+0.1i -0.7+0.0i 0.2+0.0i 0.1+0.0i 0.1+0.0i 0.0+0.0i 4.0+0.0i 0.0+0.0i 1.0+0.0i 9.0+0.0i 0.0+0.1i 4.5+6.7i 0.1+0.4i 0.0+3.2i 1.2+0.0i 0.0+0.0i 7.8+0.2i .  

Program Text

Program Text (f04zdce.c)

Program Data

Program Data (f04zdce.d)

Program Results

Program Results (f04zdce.r)

© The Numerical Algorithms Group Ltd, Oxford, UK. 2017