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_zptsvx (f07jp)

Purpose

nag_lapack_zptsvx (f07jp) uses the factorization
A = LDLH
A=LDLH
to compute the solution to a complex system of linear equations
AX = B ,
AX=B ,
where AA is an nn by nn Hermitian positive definite tridiagonal matrix and XX and BB are nn by rr matrices. Error bounds on the solution and a condition estimate are also provided.

Syntax

[df, ef, x, rcond, ferr, berr, info] = f07jp(fact, d, e, df, ef, b, 'n', n, 'nrhs_p', nrhs_p)
[df, ef, x, rcond, ferr, berr, info] = nag_lapack_zptsvx(fact, d, e, df, ef, b, 'n', n, 'nrhs_p', nrhs_p)

Description

nag_lapack_zptsvx (f07jp) performs the following steps:
  1. If fact = 'N'fact='N', the matrix AA is factorized as A = LDLHA=LDLH, where LL is a unit lower bidiagonal matrix and DD is diagonal. The factorization can also be regarded as having the form A = UHDUA=UHDU.
  2. If the leading ii by ii principal minor is not positive definite, then the function returns with info = iinfo=i. Otherwise, the factored form of AA is used to estimate the condition number of the matrix AA. If the reciprocal of the condition number is less than machine precision, infon + 1infon+1 is returned as a warning, but the function still goes on to solve for XX and compute error bounds as described below.
  3. The system of equations is solved for XX using the factored form of AA.
  4. Iterative refinement is applied to improve the computed solution matrix and to calculate error bounds and backward error estimates for it.

References

Anderson E, Bai Z, Bischof C, Blackford S, Demmel J, Dongarra J J, Du Croz J J, Greenbaum A, Hammarling S, McKenney A and Sorensen D (1999) LAPACK Users' Guide (3rd Edition) SIAM, Philadelphia http://www.netlib.org/lapack/lug
Golub G H and Van Loan C F (1996) Matrix Computations (3rd Edition) Johns Hopkins University Press, Baltimore
Higham N J (2002) Accuracy and Stability of Numerical Algorithms (2nd Edition) SIAM, Philadelphia

Parameters

Compulsory Input Parameters

1:     fact – string (length ≥ 1)
Specifies whether or not the factorized form of the matrix AA has been supplied.
fact = 'F'fact='F'
df and ef contain the factorized form of the matrix AA. df and ef will not be modified.
fact = 'N'fact='N'
The matrix AA will be copied to df and ef and factorized.
Constraint: fact = 'F'fact='F' or 'N''N'.
2:     d( : :) – double array
Note: the dimension of the array d must be at least max (1,n)max(1,n).
The nn diagonal elements of the tridiagonal matrix AA.
3:     e( : :) – complex array
Note: the dimension of the array e must be at least max (1,n1)max(1,n-1).
The (n1)(n-1) subdiagonal elements of the tridiagonal matrix AA.
4:     df( : :) – double array
Note: the dimension of the array df must be at least max (1,n)max(1,n).
If fact = 'F'fact='F', df must contain the nn diagonal elements of the diagonal matrix DD from the LDLHLDLH factorization of AA.
5:     ef( : :) – complex array
Note: the dimension of the array ef must be at least max (1,n1)max(1,n-1).
If fact = 'F'fact='F', ef must contain the (n1)(n-1) subdiagonal elements of the unit bidiagonal factor LL from the LDLHLDLH factorization of AA.
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 first dimension of the array b The dimension of the arrays d, df.
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, i.e., the number of columns of the matrix BB.
Constraint: nrhs0nrhs0.

Input Parameters Omitted from the MATLAB Interface

ldb ldx work rwork

Output Parameters

1:     df( : :) – double array
Note: the dimension of the array df must be at least max (1,n)max(1,n).
If fact = 'N'fact='N', df contains the nn diagonal elements of the diagonal matrix DD from the LDLHLDLH factorization of AA.
2:     ef( : :) – complex array
Note: the dimension of the array ef must be at least max (1,n1)max(1,n-1).
If fact = 'N'fact='N', ef contains the (n1)(n-1) subdiagonal elements of the unit bidiagonal factor LL from the LDLHLDLH factorization of AA.
3:     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).
If INFO = 0INFO=0 or n + 1n+1, the nn by rr solution matrix XX.
4:     rcond – double scalar
The reciprocal condition number of the matrix AA. If rcond is less than the machine precision (in particular, if rcond = 0.0rcond=0.0), the matrix is singular to working precision. This condition is indicated by a return code of infon + 1infon+1.
5:     ferr(nrhs_p) – double array
The forward error bound for each solution vector jx^j (the jjth column of the solution matrix XX). If xjxj is the true solution corresponding to jx^j, ferr(j)ferrj is an estimated upper bound for the magnitude of the largest element in (jxjx^j-xj) divided by the magnitude of the largest element in jx^j.
6:     berr(nrhs_p) – double array
The component-wise relative backward error of each solution vector jx^j (i.e., the smallest relative change in any element of AA or BB that makes jx^j an exact solution).
7:     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: fact, 2: n, 3: nrhs_p, 4: d, 5: e, 6: df, 7: ef, 8: b, 9: ldb, 10: x, 11: ldx, 12: rcond, 13: ferr, 14: berr, 15: work, 16: rwork, 17: 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.
  INFO > 0andINFONINFO>0andINFON
If info = iinfo=i and inin, the leading minor of order ii of AA is not positive definite, so the factorization could not be completed, and the solution has not been computed. rcond = 0.0rcond=0.0 is returned.
W INFO = N + 1INFO=N+1
The diagonal matrix DD is nonsingular, but rcond is less than machine precision, meaning that the matrix is singular to working precision. Nevertheless, the solution and error bounds are computed because there are a number of situations where the computed solution can be more accurate than the value of rcond would suggest.

Accuracy

For each right-hand side vector bb, the computed solution x^ is the exact solution of a perturbed system of equations (A + E) = b(A+E)x^=b, where
|E| c (n) ε |RT| |R| , where ​ R = D(1/2) U ,
|E| c (n) ε |RT| |R| , where ​ R = D12 U ,
c(n)c(n) is a modest linear function of nn, and εε is the machine precision. See Section 10.1 of Higham (2002) for further details.
If xx is the true solution, then the computed solution x^ satisfies a forward error bound of the form
( x )/( ) wc cond(A,,b)
x-x^ x^ wc cond(A,x^,b)
where cond(A,,b) = |A1|(|A||| + |b|) / cond(A) = |A1||A|κ (A) cond(A,x^,b) = |A-1| ( |A| |x^| + |b| ) / x^ cond(A) = |A-1| |A| κ (A). If x^  is the j j th column of X X , then wc wc  is returned in berr(j) berrj  and a bound on x / x - x^ / x^  is returned in ferr(j) ferrj . See Section 4.4 of Anderson et al. (1999) for further details.

Further Comments

The number of floating point operations required for the factorization, and for the estimation of the condition number of A A  is proportional to n n . The number of floating point operations required for the solution of the equations, and for the estimation of the forward and backward error is proportional to nr nr , where r r  is the number of right-hand sides.
The condition estimation is based upon Equation (15.11) of Higham (2002). For further details of the error estimation, see Section 4.4 of Anderson et al. (1999).
The real analogue of this function is nag_lapack_dptsvx (f07jb).

Example

function nag_lapack_zptsvx_example
fact = 'Not factored';
d = [16;
     41;
     46;
     21];
e = [ 16 + 16i;
      18 - 9i;
      1 - 4i];
df = zeros(4, 1);
ef = complex(zeros(3, 1));
b = [ 64 + 16i,  -16 - 32i;
      93 + 62i,  61 - 66i;
      78 - 80i,  71 - 74i;
      14 - 27i,  35 + 15i];
[dfOut, efOut, x, rcond, ferr, berr, info] = nag_lapack_zptsvx(fact, d, e, df, ef, b)
 

dfOut =

    16
     9
     1
     4


efOut =

   1.0000 + 1.0000i
   2.0000 - 1.0000i
   1.0000 - 4.0000i


x =

   2.0000 + 1.0000i  -3.0000 - 2.0000i
   1.0000 + 1.0000i   1.0000 + 1.0000i
   1.0000 - 2.0000i   1.0000 - 2.0000i
   1.0000 - 1.0000i   2.0000 + 1.0000i


rcond =

   1.0862e-04


ferr =

   1.0e-11 *

    0.9038
    0.6093


berr =

     0
     0


info =

                    0


function f07jp_example
fact = 'Not factored';
d = [16;
     41;
     46;
     21];
e = [ 16 + 16i;
      18 - 9i;
      1 - 4i];
df = zeros(4, 1);
ef = complex(zeros(3, 1));
b = [ 64 + 16i,  -16 - 32i;
      93 + 62i,  61 - 66i;
      78 - 80i,  71 - 74i;
      14 - 27i,  35 + 15i];
[dfOut, efOut, x, rcond, ferr, berr, info] = f07jp(fact, d, e, df, ef, b)
 

dfOut =

    16
     9
     1
     4


efOut =

   1.0000 + 1.0000i
   2.0000 - 1.0000i
   1.0000 - 4.0000i


x =

   2.0000 + 1.0000i  -3.0000 - 2.0000i
   1.0000 + 1.0000i   1.0000 + 1.0000i
   1.0000 - 2.0000i   1.0000 - 2.0000i
   1.0000 - 1.0000i   2.0000 + 1.0000i


rcond =

   1.0862e-04


ferr =

   1.0e-11 *

    0.9038
    0.6093


berr =

     0
     0


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