PDF version (NAG web site
, 64-bit version, 64-bit version)
NAG Toolbox: nag_lapack_dptsv (f07ja)
Purpose
nag_lapack_dptsv (f07ja) computes the solution to a real system of linear equations
where
is an
by
symmetric positive definite tridiagonal matrix, and
and
are
by
matrices.
Syntax
Description
nag_lapack_dptsv (f07ja) factors as . The factored form of is then used to solve the system of equations.
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
Parameters
Compulsory Input Parameters
- 1:
– double array
-
The dimension of the array
d
must be at least
The diagonal elements of the tridiagonal matrix .
- 2:
– double array
-
The dimension of the array
e
must be at least
The subdiagonal elements of the tridiagonal matrix .
- 3:
– double array
-
The first dimension of the array
b must be at least
.
The second dimension of the array
b must be at least
.
The by right-hand side matrix .
Optional Input Parameters
- 1:
– int64int32nag_int scalar
-
Default:
the first dimension of the array
b and the dimension of the array
d.
, the order of the matrix .
Constraint:
.
- 2:
– int64int32nag_int scalar
-
Default:
the second dimension of the array
b.
, the number of right-hand sides, i.e., the number of columns of the matrix .
Constraint:
.
Output Parameters
- 1:
– double array
-
The dimension of the array
d will be
The diagonal elements of the diagonal matrix from the factorization .
- 2:
– double array
-
The dimension of the array
e will be
The
subdiagonal elements of the unit bidiagonal factor
from the
factorization of
. (
e can also be regarded as the superdiagonal of the unit bidiagonal factor
from the
factorization of
.)
- 3:
– double array
-
The first dimension of the array
b will be
.
The second dimension of the array
b will be
.
If , the by solution matrix .
- 4:
– int64int32nag_int scalar
unless the function detects an error (see
Error Indicators and Warnings).
Error Indicators and Warnings
-
If , argument had an illegal value. An explanatory message is output, and execution of the program is terminated.
-
-
The leading minor of order is not positive definite,
and the solution has not been computed.
Accuracy
The computed solution for a single right-hand side,
, satisfies an equation of the form
where
and
is the
machine precision. An approximate error bound for the computed solution is given by
where
, the condition number of
with respect to the solution of the linear equations. See Section 4.4 of
Anderson et al. (1999) for further details.
nag_lapack_dptsvx (f07jb) is a comprehensive LAPACK driver that returns forward and backward error bounds and an estimate of the condition number. Alternatively,
nag_linsys_real_posdef_tridiag_solve (f04bg) solves
and returns a forward error bound and condition estimate.
nag_linsys_real_posdef_tridiag_solve (f04bg) calls
nag_lapack_dptsv (f07ja) to solve the equations.
Further Comments
The number of floating-point operations required for the factorization of is proportional to , and the number of floating-point operations required for the solution of the equations is proportional to , where is the number of right-hand sides.
The complex analogue of this function is
nag_lapack_zptsv (f07jn).
Example
This example solves the equations
where
is the symmetric positive definite tridiagonal matrix
Details of the factorization of are also output.
Open in the MATLAB editor:
f07ja_example
function f07ja_example
fprintf('f07ja example results\n\n');
d = [ 4 10 29 25 5];
e = [-2 -6 15 8 ];
b = [ 6;
9;
2;
14;
7];
[df, ef, x, info] = f07ja( ...
d, e, b);
disp('Solution');
disp(x');
disp('Diagonal elements of the diagonal matrix D');
disp(df);
disp('Sub-diagonal elements of the Cholesky factor L');
disp(ef);
f07ja example results
Solution
2.5000 2.0000 1.0000 -1.0000 3.0000
Diagonal elements of the diagonal matrix D
4 9 25 16 1
Sub-diagonal elements of the Cholesky factor L
-0.5000 -0.6667 0.6000 0.5000
PDF version (NAG web site
, 64-bit version, 64-bit version)
© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2015