hide long namesshow long names
hide short namesshow short names
Integer type:  int32  int64  nag_int  show int32  show int32  show int64  show int64  show nag_int  show nag_int

PDF version (NAG web site, 64-bit version, 64-bit version)
Chapter Contents
Chapter Introduction
NAG Toolbox

NAG Toolbox: nag_lapack_zgbrfs (f07bv)

Purpose

nag_lapack_zgbrfs (f07bv) returns error bounds for the solution of a complex band system of linear equations with multiple right-hand sides, AX = BAX=B, ATX = BATX=B or AHX = BAHX=B. It improves the solution by iterative refinement, in order to reduce the backward error as much as possible.

Syntax

[x, ferr, berr, info] = f07bv(trans, kl, ku, ab, afb, ipiv, b, x, 'n', n, 'nrhs_p', nrhs_p)
[x, ferr, berr, info] = nag_lapack_zgbrfs(trans, kl, ku, ab, afb, ipiv, b, x, 'n', n, 'nrhs_p', nrhs_p)

Description

nag_lapack_zgbrfs (f07bv) returns the backward errors and estimated bounds on the forward errors for the solution of a complex band system of linear equations with multiple right-hand sides AX = BAX=B, ATX = BATX=B or AHX = BAHX=B. The function handles each right-hand side vector (stored as a column of the matrix BB) independently, so we describe the function of nag_lapack_zgbrfs (f07bv) in terms of a single right-hand side bb and solution xx.
Given a computed solution xx, the function computes the component-wise backward error ββ. This is the size of the smallest relative perturbation in each element of AA and bb such that xx is the exact solution of a perturbed system
(A + δA)x = b + δb
|δaij|β|aij|   and   |δbi|β|bi| .
(A+δA)x=b+δb |δaij|β|aij|   and   |δbi|β|bi| .
Then the function estimates a bound for the component-wise forward error in the computed solution, defined by:
max |xii| / max |xi|
i i
maxi|xi-x^i|/maxi|xi|
where x^ is the true solution.
For details of the method, see the F07 Chapter Introduction.

References

Golub G H and Van Loan C F (1996) Matrix Computations (3rd Edition) Johns Hopkins University Press, Baltimore

Parameters

Compulsory Input Parameters

1:     trans – string (length ≥ 1)
Indicates the form of the linear equations for which XX is the computed solution as follows:
trans = 'N'trans='N'
The linear equations are of the form AX = BAX=B.
trans = 'T'trans='T'
The linear equations are of the form ATX = BATX=B.
trans = 'C'trans='C'
The linear equations are of the form AHX = BAHX=B.
Constraint: trans = 'N'trans='N', 'T''T' or 'C''C'.
2:     kl – int64int32nag_int scalar
klkl, the number of subdiagonals within the band of the matrix AA.
Constraint: kl0kl0.
3:     ku – int64int32nag_int scalar
kuku, the number of superdiagonals within the band of the matrix AA.
Constraint: ku0ku0.
4:     ab(ldab, : :) – complex array
The first dimension of the array ab must be at least kl + ku + 1kl+ku+1
The second dimension of the array must be at least max (1,n)max(1,n)
The original nn by nn band matrix AA as supplied to nag_lapack_zgbtrf (f07br).
The matrix is stored in rows 11 to kl + ku + 1kl+ku+1, more precisely, the element AijAij must be stored in
ab(ku + 1 + ij,j)  for ​max (1,jku)imin (n,j + kl).
abku+1+i-jj  for ​max(1,j-ku)imin(n,j+kl).
See Section [Further Comments] in (f07bn) for further details.
5:     afb(ldafb, : :) – complex array
The first dimension of the array afb must be at least 2 × kl + ku + 12×kl+ku+1
The second dimension of the array must be at least max (1,n)max(1,n)
The LULU factorization of AA, as returned by nag_lapack_zgbtrf (f07br).
6:     ipiv( : :) – int64int32nag_int array
Note: the dimension of the array ipiv must be at least max (1,n)max(1,n).
The pivot indices, as returned by nag_lapack_zgbtrf (f07br).
7:     b(ldb, : :) – complex array
The first dimension of the array b must be at least max (1,n)max(1,n)
The second dimension of the array must be at least max (1,nrhs)max(1,nrhs)
The nn by rr right-hand side matrix BB.
8:     x(ldx, : :) – complex array
The first dimension of the array x must be at least max (1,n)max(1,n)
The second dimension of the array must be at least max (1,nrhs)max(1,nrhs)
The nn by rr solution matrix XX, as returned by nag_lapack_zgbtrs (f07bs).

Optional Input Parameters

1:     n – int64int32nag_int scalar
Default: The second dimension of the array ab.
nn, the order of the matrix AA.
Constraint: n0n0.
2:     nrhs_p – int64int32nag_int scalar
Default: The second dimension of the arrays b, x.
rr, the number of right-hand sides.
Constraint: nrhs0nrhs0.

Input Parameters Omitted from the MATLAB Interface

ldab ldafb ldb ldx work rwork

Output Parameters

1:     x(ldx, : :) – complex array
The first dimension of the array x will be max (1,n)max(1,n)
The second dimension of the array will be max (1,nrhs)max(1,nrhs)
ldxmax (1,n)ldxmax(1,n).
The improved solution matrix XX.
2:     ferr(nrhs_p) – double array
ferr(j)ferrj contains an estimated error bound for the jjth solution vector, that is, the jjth column of XX, for j = 1,2,,rj=1,2,,r.
3:     berr(nrhs_p) – double array
berr(j)berrj contains the component-wise backward error bound ββ for the jjth solution vector, that is, the jjth column of XX, for j = 1,2,,rj=1,2,,r.
4:     info – int64int32nag_int scalar
info = 0info=0 unless the function detects an error (see Section [Error Indicators and Warnings]).

Error Indicators and Warnings

  info = iinfo=-i
If info = iinfo=-i, parameter ii had an illegal value on entry. The parameters are numbered as follows:
1: trans, 2: n, 3: kl, 4: ku, 5: nrhs_p, 6: ab, 7: ldab, 8: afb, 9: ldafb, 10: ipiv, 11: b, 12: ldb, 13: x, 14: ldx, 15: ferr, 16: berr, 17: work, 18: rwork, 19: info.
It is possible that info refers to a parameter that is omitted from the MATLAB interface. This usually indicates that an error in one of the other input parameters has caused an incorrect value to be inferred.

Accuracy

The bounds returned in ferr are not rigorous, because they are estimated, not computed exactly; but in practice they almost always overestimate the actual error.

Further Comments

For each right-hand side, computation of the backward error involves a minimum of 16n(kl + ku)16n(kl+ku) real floating point operations. Each step of iterative refinement involves an additional 8n(4kl + 3ku)8n(4kl+3ku) real operations. This assumes nklnkl and nkunku. At most five steps of iterative refinement are performed, but usually only one or two steps are required.
Estimating the forward error involves solving a number of systems of linear equations of the form Ax = bAx=b or AHx = bAHx=b; the number is usually 55 and never more than 1111. Each solution involves approximately 8n(2kl + ku)8n(2kl+ku) real operations.
The real analogue of this function is nag_lapack_dgbrfs (f07bh).

Example

function nag_lapack_zgbrfs_example
trans = 'N';
kl = int64(1);
ku = int64(2);
ab = [0,  0 + 0i,  0.97 - 2.84i,  0.59 - 0.48i;
      0 + 0i,  -2.05 - 0.85i,  -3.99 + 4.01i,  3.33 - 1.04i;
      -1.65 + 2.26i,  -1.48 - 1.75i,  -1.06 + 1.94i,  -0.46 - 1.72i;
      0 + 6.3i,  -0.77 + 2.83i,  4.48 - 1.09i,  0 + 0i];
afb = [0,  0 + 0i,  0 + 0i,  0.59 - 0.48i;
      0 + 0i,  0 + 0i,  -3.99 + 4.01i,  3.33 - 1.04i;
      0 + 0i,  -1.48 - 1.75i,  -1.06 + 1.94i,  -1.769209381609681 - 1.858747281945787i;
      0 + 6.3i,  -0.77 + 2.83i, ...
     4.930266941175471 - 3.008563740627192i,  0.4337749265901603 + 0.123252818156083i;
      0.3587301587301587 + 0.2619047619047619i, ...
    0.2314260728743743 + 0.6357648842047455i,  0.7604226619635511 + 0.2429442589267133i,  0 + 0i];
ipiv = [int64(2);3;3;4];
b = [ -1.06 + 21.5i,  12.85 + 2.84i;
      -22.72 - 53.9i,  -70.22 + 21.57i;
      28.24 - 38.6i,  -20.73 - 1.23i;
      -34.56 + 16.73i,  26.01 + 31.97i];
x = [ -3 + 2i,  1 + 6i;
      1 - 7i,  -7 - 4i;
      -5 + 4i,  3 + 5i;
      6 - 8i,  -8 + 2i];
[xOut, ferr, berr, info] = nag_lapack_zgbrfs(trans, kl, ku, ab, afb, ipiv, b, x)
 

xOut =

  -3.0000 + 2.0000i   1.0000 + 6.0000i
   1.0000 - 7.0000i  -7.0000 - 4.0000i
  -5.0000 + 4.0000i   3.0000 + 5.0000i
   6.0000 - 8.0000i  -8.0000 + 2.0000i


ferr =

   1.0e-13 *

    0.3492
    0.4309


berr =

   1.0e-16 *

    0.2899
    0.5497


info =

                    0


function f07bv_example
trans = 'N';
kl = int64(1);
ku = int64(2);
ab = [0,  0 + 0i,  0.97 - 2.84i,  0.59 - 0.48i;
      0 + 0i,  -2.05 - 0.85i,  -3.99 + 4.01i,  3.33 - 1.04i;
      -1.65 + 2.26i,  -1.48 - 1.75i,  -1.06 + 1.94i,  -0.46 - 1.72i;
      0 + 6.3i,  -0.77 + 2.83i,  4.48 - 1.09i,  0 + 0i];
afb = [0,  0 + 0i,  0 + 0i,  0.59 - 0.48i;
      0 + 0i,  0 + 0i,  -3.99 + 4.01i,  3.33 - 1.04i;
      0 + 0i,  -1.48 - 1.75i,  -1.06 + 1.94i,  -1.769209381609681 - 1.858747281945787i;
      0 + 6.3i,  -0.77 + 2.83i, ...
     4.930266941175471 - 3.008563740627192i,  0.4337749265901603 + 0.123252818156083i;
      0.3587301587301587 + 0.2619047619047619i, ...
    0.2314260728743743 + 0.6357648842047455i,  0.7604226619635511 + 0.2429442589267133i,  0 + 0i];
ipiv = [int64(2);3;3;4];
b = [ -1.06 + 21.5i,  12.85 + 2.84i;
      -22.72 - 53.9i,  -70.22 + 21.57i;
      28.24 - 38.6i,  -20.73 - 1.23i;
      -34.56 + 16.73i,  26.01 + 31.97i];
x = [ -3 + 2i,  1 + 6i;
      1 - 7i,  -7 - 4i;
      -5 + 4i,  3 + 5i;
      6 - 8i,  -8 + 2i];
[xOut, ferr, berr, info] = f07bv(trans, kl, ku, ab, afb, ipiv, b, x)
 

xOut =

  -3.0000 + 2.0000i   1.0000 + 6.0000i
   1.0000 - 7.0000i  -7.0000 - 4.0000i
  -5.0000 + 4.0000i   3.0000 + 5.0000i
   6.0000 - 8.0000i  -8.0000 + 2.0000i


ferr =

   1.0e-13 *

    0.3492
    0.4309


berr =

   1.0e-16 *

    0.2899
    0.5497


info =

                    0



PDF version (NAG web site, 64-bit version, 64-bit version)
Chapter Contents
Chapter Introduction
NAG Toolbox

© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2013