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_ztbtrs (f07vs)

Purpose

nag_lapack_ztbtrs (f07vs) solves a complex triangular band system of linear equations with multiple right-hand sides, AX = BAX=B, ATX = BATX=B or AHX = BAHX=B.

Syntax

[b, info] = f07vs(uplo, trans, diag, kd, ab, b, 'n', n, 'nrhs_p', nrhs_p)
[b, info] = nag_lapack_ztbtrs(uplo, trans, diag, kd, ab, b, 'n', n, 'nrhs_p', nrhs_p)

Description

nag_lapack_ztbtrs (f07vs) solves a complex triangular band system of linear equations AX = BAX=B, ATX = BATX=B or AHX = BAHX=B.

References

Golub G H and Van Loan C F (1996) Matrix Computations (3rd Edition) Johns Hopkins University Press, Baltimore
Higham N J (1989) The accuracy of solutions to triangular systems SIAM J. Numer. Anal. 26 1252–1265

Parameters

Compulsory Input Parameters

1:     uplo – string (length ≥ 1)
Specifies whether AA is upper or lower triangular.
uplo = 'U'uplo='U'
AA is upper triangular.
uplo = 'L'uplo='L'
AA is lower triangular.
Constraint: uplo = 'U'uplo='U' or 'L''L'.
2:     trans – string (length ≥ 1)
Indicates the form of the equations.
trans = 'N'trans='N'
The equations are of the form AX = BAX=B.
trans = 'T'trans='T'
The equations are of the form ATX = BATX=B.
trans = 'C'trans='C'
The equations are of the form AHX = BAHX=B.
Constraint: trans = 'N'trans='N', 'T''T' or 'C''C'.
3:     diag – string (length ≥ 1)
Indicates whether AA is a nonunit or unit triangular matrix.
diag = 'N'diag='N'
AA is a nonunit triangular matrix.
diag = 'U'diag='U'
AA is a unit triangular matrix; the diagonal elements are not referenced and are assumed to be 11.
Constraint: diag = 'N'diag='N' or 'U''U'.
4:     kd – int64int32nag_int scalar
kdkd, the number of superdiagonals of the matrix AA if uplo = 'U'uplo='U', or the number of subdiagonals if uplo = 'L'uplo='L'.
Constraint: kd0kd0.
5:     ab(ldab, : :) – complex array
The first dimension of the array ab must be at least kd + 1kd+1
The second dimension of the array must be at least max (1,n)max(1,n)
The nn by nn triangular band matrix AA.
The matrix is stored in rows 11 to kd + 1kd+1, more precisely,
  • if uplo = 'U'uplo='U', the elements of the upper triangle of AA within the band must be stored with element AijAij in ab(kd + 1 + ij,j)​ for ​max (1,jkd)ijabkd+1+i-jj​ for ​max(1,j-kd)ij;
  • if uplo = 'L'uplo='L', the elements of the lower triangle of AA within the band must be stored with element AijAij in ab(1 + ij,j)​ for ​jimin (n,j + kd).ab1+i-jj​ for ​jimin(n,j+kd).
If diag = 'U'diag='U', the diagonal elements of AA are assumed to be 11, and are not referenced.
6:     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.

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 array b.
rr, the number of right-hand sides.
Constraint: nrhs0nrhs0.

Input Parameters Omitted from the MATLAB Interface

ldab ldb

Output Parameters

1:     b(ldb, : :) – complex array
The first dimension of the array b will be max (1,n)max(1,n)
The second dimension of the array will be max (1,nrhs)max(1,nrhs)
ldbmax (1,n)ldbmax(1,n).
The nn by rr solution matrix XX.
2:     info – int64int32nag_int scalar
info = 0info=0 unless the function detects an error (see Section [Error Indicators and Warnings]).

Error Indicators and Warnings

Cases prefixed with W are classified as warnings and do not generate an error of type NAG:error_n. See nag_issue_warnings.

  info = iinfo=-i
If info = iinfo=-i, parameter ii had an illegal value on entry. The parameters are numbered as follows:
1: uplo, 2: trans, 3: diag, 4: n, 5: kd, 6: nrhs_p, 7: ab, 8: ldab, 9: b, 10: ldb, 11: 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.
W INFO > 0INFO>0
If info = iinfo=i, a(i,i)a(i,i) is exactly zero; AA is singular and the solution has not been computed.

Accuracy

The solutions of triangular systems of equations are usually computed to high accuracy. See Higham (1989).
For each right-hand side vector bb, the computed solution xx is the exact solution of a perturbed system of equations (A + E)x = b(A+E)x=b, where
|E|c(k)ε|A| ,
|E|c(k)ε|A| ,
c(k)c(k) is a modest linear function of kk, and εε is the machine precision.
If x^ is the true solution, then the computed solution xx satisfies a forward error bound of the form
(x)/(x)c(k)cond(A,x)ε ,   provided   c(k)cond(A,x)ε < 1 ,
x-x^ x c(k)cond(A,x)ε ,   provided   c(k)cond(A,x)ε<1 ,
where cond(A,x) = |A1||A||x| / xcond(A,x)=|A-1||A||x|/x.
Note that cond(A,x)cond(A) = |A1||A|κ(A)cond(A,x)cond(A)=|A-1||A|κ(A); cond(A,x)cond(A,x) can be much smaller than cond(A)cond(A) and it is also possible for cond(AH)cond(AH), which is the same as cond(AT)cond(AT), to be much larger (or smaller) than cond(A)cond(A).
Forward and backward error bounds can be computed by calling nag_lapack_ztbrfs (f07vv), and an estimate for κ(A)κ(A) can be obtained by calling nag_lapack_ztbcon (f07vu) with norm = 'I'norm='I'.

Further Comments

The total number of real floating point operations is approximately 8nkr8nkr if knkn.
The real analogue of this function is nag_lapack_dtbtrs (f07ve).

Example

function nag_lapack_ztbtrs_example
uplo = 'L';
trans = 'N';
diag = 'N';
kd = int64(2);
ab = [ -1.94 + 4.43i,  4.12 - 4.27i,  0.43 - 2.66i,  0.44 + 0.1i;
      -3.39 + 3.44i,  -1.84 + 5.53i,  1.74 - 0.04i,  0 + 0i;
      1.62 + 3.68i,  -2.77 - 1.93i,  0 + 0i,  0 + 0i];
b = [ -8.86 - 3.88i,  -24.09 - 5.27i;
      -15.57 - 23.41i,  -57.97 + 8.14i;
      -7.63 + 22.78i,  19.09 - 29.51i;
      -14.74 - 2.4i,  19.17 + 21.33i];
[bOut, info] = nag_lapack_ztbtrs(uplo, trans, diag, kd, ab, b)
 

bOut =

   0.0000 + 2.0000i   1.0000 + 5.0000i
   1.0000 - 3.0000i  -7.0000 - 2.0000i
  -4.0000 - 5.0000i   3.0000 + 4.0000i
   2.0000 - 1.0000i  -6.0000 - 9.0000i


info =

                    0


function f07vs_example
uplo = 'L';
trans = 'N';
diag = 'N';
kd = int64(2);
ab = [ -1.94 + 4.43i,  4.12 - 4.27i,  0.43 - 2.66i,  0.44 + 0.1i;
      -3.39 + 3.44i,  -1.84 + 5.53i,  1.74 - 0.04i,  0 + 0i;
      1.62 + 3.68i,  -2.77 - 1.93i,  0 + 0i,  0 + 0i];
b = [ -8.86 - 3.88i,  -24.09 - 5.27i;
      -15.57 - 23.41i,  -57.97 + 8.14i;
      -7.63 + 22.78i,  19.09 - 29.51i;
      -14.74 - 2.4i,  19.17 + 21.33i];
[bOut, info] = f07vs(uplo, trans, diag, kd, ab, b)
 

bOut =

   0.0000 + 2.0000i   1.0000 + 5.0000i
   1.0000 - 3.0000i  -7.0000 - 2.0000i
  -4.0000 - 5.0000i   3.0000 + 4.0000i
   2.0000 - 1.0000i  -6.0000 - 9.0000i


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