PDF version (NAG web site
, 64-bit version, 64-bit version)
NAG Toolbox: nag_linsys_real_posdef_vband_solve (f04mc)
Purpose
nag_linsys_real_posdef_vband_solve (f04mc) computes the approximate solution of a system of real linear equations with multiple right-hand sides,
, where
is a symmetric positive definite variable-bandwidth matrix, which has previously been factorized by
nag_matop_real_vband_posdef_fac (f01mc). Related systems may also be solved.
Syntax
[
x,
ifail] = f04mc(
al,
d,
nrow,
b,
iselct, 'n',
n, 'lal',
lal, 'ir',
ir)
[
x,
ifail] = nag_linsys_real_posdef_vband_solve(
al,
d,
nrow,
b,
iselct, 'n',
n, 'lal',
lal, 'ir',
ir)
Description
The normal use of this function is the solution of the systems
, following a call of
nag_matop_real_vband_posdef_fac (f01mc) to determine the Cholesky factorization
of the symmetric positive definite variable-bandwidth matrix
.
However, the function may be used to solve any one of the following systems of linear algebraic equations:
1. |
(usual system), |
2. |
(lower triangular system), |
3. |
(upper triangular system), |
4. |
|
5. |
(unit lower triangular system), |
6. |
(unit upper triangular system). |
denotes a unit lower triangular variable-bandwidth matrix of order , a diagonal matrix of order , and a set of right-hand sides.
The matrix
is represented by the elements lying within its
envelope, i.e., between the first nonzero of each row and the diagonal (see
Example for an example). The width
of the
th row is the number of elements between the first nonzero element and the element on the diagonal inclusive.
References
Wilkinson J H and Reinsch C (1971) Handbook for Automatic Computation II, Linear Algebra Springer–Verlag
Parameters
Compulsory Input Parameters
- 1:
– double array
-
The elements within the envelope of the lower triangular matrix
, taken in row by row order, as returned by
nag_matop_real_vband_posdef_fac (f01mc). The unit diagonal elements of
must be stored explicitly.
- 2:
– double array
-
The dimension of the array
d
must be at least
if
, and at least
otherwise
The diagonal elements of the diagonal matrix
.
d is not referenced if
.
- 3:
– int64int32nag_int array
-
must contain the width of row of , i.e., the number of elements between the first (leftmost) nonzero element and the element on the diagonal, inclusive.
Constraint:
.
- 4:
– double array
-
ldb, the first dimension of the array, must satisfy the constraint
.
The
by
right-hand side matrix
. See also
Further Comments.
- 5:
– int64int32nag_int scalar
-
Must specify the type of system to be solved, as follows:
- Solve .
- Solve .
- Solve .
- Solve .
- Solve .
- Solve .
Constraint:
, , , , or .
Optional Input Parameters
- 1:
– int64int32nag_int scalar
-
Default:
the dimension of the array
nrow and the first dimension of the array
b. (An error is raised if these dimensions are not equal.)
, the order of the matrix .
Constraint:
.
- 2:
– int64int32nag_int scalar
-
Default:
the dimension of the array
al.
The dimension of the array
al.
Constraint:
.
- 3:
– int64int32nag_int scalar
-
Default:
the second dimension of the array
b.
, the number of right-hand sides.
Constraint:
.
Output Parameters
- 1:
– double array
-
The
by
solution matrix
. See also
Further Comments.
- 2:
– int64int32nag_int scalar
unless the function detects an error (see
Error Indicators and Warnings).
Error Indicators and Warnings
Errors or warnings detected by the function:
-
-
On entry, | , |
or | for some , or , |
or | . |
-
-
On entry, | , |
or | , |
or | . |
-
-
On entry, | , |
or | . |
-
-
The diagonal matrix
is singular, i.e., at least one of the elements of
d is zero. This can only occur if
.
-
-
At least one of the diagonal elements of is not equal to unity.
-
An unexpected error has been triggered by this routine. Please
contact
NAG.
-
Your licence key may have expired or may not have been installed correctly.
-
Dynamic memory allocation failed.
Accuracy
The usual backward error analysis of the solution of triangular system applies: each computed solution vector is exact for slightly perturbed matrices
and
, as appropriate (see pages 25–27 and 54–55 of
Wilkinson and Reinsch (1971)).
Further Comments
The time taken by nag_linsys_real_posdef_vband_solve (f04mc) is approximately proportional to , where .
Example
This example solves the system of equations
, where
Here
is symmetric and positive definite and must first be factorized by
nag_matop_real_vband_posdef_fac (f01mc).
Open in the MATLAB editor:
f04mc_example
function f04mc_example
fprintf('f04mc example results\n\n');
a = [1;
2; 5;
3; 13;
16;
5; 14; 18; 8; 55;
24; 17; 77];
nrow = [int64(1); 2; 2; 1; 5; 3];
[L, D, ifail] = f01mc(a, nrow);
b = [ 6.0 -10.0;
15.0 -21.0;
11.0 -3.0;
0.0 24.0;
51.0 -39.0;
46.0 67.0];
iselct = int64(1);
[x, ifail] = f04mc(L, D, nrow, b, iselct);
disp('Solution');
disp(x);
f04mc example results
Solution
-3 4
2 -2
-1 3
-2 1
1 -2
1 1
PDF version (NAG web site
, 64-bit version, 64-bit version)
© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2015