nag_dgttrf (f07cdc) (PDF version)
f07 Chapter Contents
f07 Chapter Introduction
NAG Library Manual

NAG Library Function Document

nag_dgttrf (f07cdc)

 Contents

    1  Purpose
    7  Accuracy

1  Purpose

nag_dgttrf (f07cdc) computes the LU  factorization of a real n  by n  tridiagonal matrix A .

2  Specification

#include <nag.h>
#include <nagf07.h>
void  nag_dgttrf (Integer n, double dl[], double d[], double du[], double du2[], Integer ipiv[], NagError *fail)

3  Description

nag_dgttrf (f07cdc) uses Gaussian elimination with partial pivoting and row interchanges to factorize the matrix A  as
A=PLU ,  
where P  is a permutation matrix, L  is unit lower triangular with at most one nonzero subdiagonal element in each column, and U  is an upper triangular band matrix, with two superdiagonals.

4  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

5  Arguments

1:     n IntegerInput
On entry: n, the order of the matrix A.
Constraint: n0.
2:     dl[dim] doubleInput/Output
Note: the dimension, dim, of the array dl must be at least max1,n-1.
On entry: must contain the n-1 subdiagonal elements of the matrix A.
On exit: is overwritten by the n-1 multipliers that define the matrix L of the LU factorization of A.
3:     d[dim] doubleInput/Output
Note: the dimension, dim, of the array d must be at least max1,n.
On entry: must contain the n diagonal elements of the matrix A.
On exit: is overwritten by the n diagonal elements of the upper triangular matrix U from the LU factorization of A.
4:     du[dim] doubleInput/Output
Note: the dimension, dim, of the array du must be at least max1,n-1.
On entry: must contain the n-1 superdiagonal elements of the matrix A.
On exit: is overwritten by the n-1 elements of the first superdiagonal of U.
5:     du2[n-2] doubleOutput
On exit: contains the n-2 elements of the second superdiagonal of U.
6:     ipiv[n] IntegerOutput
On exit: contains the n pivot indices that define the permutation matrix P. At the ith step, row i of the matrix was interchanged with row ipiv[i-1]. ipiv[i-1] will always be either i or i+1, ipiv[i-1]=i indicating that a row interchange was not performed.
7:     fail NagError *Input/Output
The NAG error argument (see Section 2.7 in How to Use the NAG Library and its Documentation).

6  Error Indicators and Warnings

NE_ALLOC_FAIL
Dynamic memory allocation failed.
See Section 2.3.1.2 in How to Use the NAG Library and its Documentation for further information.
NE_BAD_PARAM
On entry, argument value had an illegal value.
NE_INT
On entry, n=value.
Constraint: n0.
NE_INTERNAL_ERROR
An internal error has occurred in this function. Check the function call and any array sizes. If the call is correct then please contact NAG for assistance.
An unexpected error has been triggered by this function. Please contact NAG.
See Section 2.7.6 in How to Use the NAG Library and its Documentation for further information.
NE_NO_LICENCE
Your licence key may have expired or may not have been installed correctly.
See Section 2.7.5 in How to Use the NAG Library and its Documentation for further information.
NE_SINGULAR
Element value of the diagonal is exactly zero. The factorization has been completed, but the factor U is exactly singular, and division by zero will occur if it is used to solve a system of equations.

7  Accuracy

The computed factorization satisfies an equation of the form
A+E=PLU ,  
where
E=OεA  
and ε  is the machine precision.
Following the use of this function, nag_dgttrs (f07cec) can be used to solve systems of equations AX=B  or ATX=B , and nag_dgtcon (f07cgc) can be used to estimate the condition number of A .

8  Parallelism and Performance

nag_dgttrf (f07cdc) is not threaded in any implementation.

9  Further Comments

The total number of floating-point operations required to factorize the matrix A  is proportional to n .
The complex analogue of this function is nag_zgttrf (f07crc).

10  Example

This example factorizes the tridiagonal matrix A  given by
A = 3.0 2.1 0.0 0.0 0.0 3.4 2.3 -1.0 0.0 0.0 0.0 3.6 -5.0 1.9 0.0 0.0 0.0 7.0 -0.9 8.0 0.0 0.0 0.0 -6.0 7.1 .  

10.1  Program Text

Program Text (f07cdce.c)

10.2  Program Data

Program Data (f07cdce.d)

10.3  Program Results

Program Results (f07cdce.r)


nag_dgttrf (f07cdc) (PDF version)
f07 Chapter Contents
f07 Chapter Introduction
NAG Library Manual

© The Numerical Algorithms Group Ltd, Oxford, UK. 2016