ScaLAPACK  2.0.2 ScaLAPACK: Scalable Linear Algebra PACKage
zdttrf.f
Go to the documentation of this file.
```00001       SUBROUTINE ZDTTRF( N, DL, D, DU, INFO )
00002 *
00003 *  -- ScaLAPACK auxiliary routine (version 2.0) --
00004 *     Univ. of Tennessee, Univ. of California Berkeley, Univ. of Colorado Denver
00005 *
00006 *     Written by Andrew J. Cleary, November 1996.
00007 *     Modified from ZGTTRF:
00008 *  -- LAPACK routine (preliminary version) --
00009 *     Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
00010 *     Courant Institute, Argonne National Lab, and Rice University
00011 *
00012 *     .. Scalar Arguments ..
00013       INTEGER            INFO, N
00014 *     ..
00015 *     .. Array Arguments ..
00016       COMPLEX*16         D( * ), DL( * ), DU( * )
00017 *     ..
00018 *
00019 *  Purpose
00020 *  =======
00021 *
00022 *  ZDTTRF computes an LU factorization of a complex tridiagonal matrix A
00023 *  using elimination without partial pivoting.
00024 *
00025 *  The factorization has the form
00026 *     A = L * U
00027 *  where L is a product of unit lower bidiagonal
00028 *  matrices and U is upper triangular with nonzeros in only the main
00029 *  diagonal and first superdiagonal.
00030 *
00031 *  Arguments
00032 *  =========
00033 *
00034 *  N       (input) INTEGER
00035 *          The order of the matrix A.  N >= 0.
00036 *
00037 *  DL      (input/output) COMPLEX array, dimension (N-1)
00038 *          On entry, DL must contain the (n-1) subdiagonal elements of
00039 *          A.
00040 *          On exit, DL is overwritten by the (n-1) multipliers that
00041 *          define the matrix L from the LU factorization of A.
00042 *
00043 *  D       (input/output) COMPLEX array, dimension (N)
00044 *          On entry, D must contain the diagonal elements of A.
00045 *          On exit, D is overwritten by the n diagonal elements of the
00046 *          upper triangular matrix U from the LU factorization of A.
00047 *
00048 *  DU      (input/output) COMPLEX array, dimension (N-1)
00049 *          On entry, DU must contain the (n-1) superdiagonal elements
00050 *          of A.
00051 *          On exit, DU is overwritten by the (n-1) elements of the first
00052 *          superdiagonal of U.
00053 *
00054 *  INFO    (output) INTEGER
00055 *          = 0:  successful exit
00056 *          < 0:  if INFO = -i, the i-th argument had an illegal value
00057 *          > 0:  if INFO = i, U(i,i) is exactly zero. The factorization
00058 *                has been completed, but the factor U is exactly
00059 *                singular, and division by zero will occur if it is used
00060 *                to solve a system of equations.
00061 *
00062 *  =====================================================================
00063 *
00064 *     .. Local Scalars ..
00065       INTEGER            I
00066       COMPLEX*16         FACT
00067 *     ..
00068 *     .. Intrinsic Functions ..
00069       INTRINSIC          ABS
00070 *     ..
00071 *     .. External Subroutines ..
00072       EXTERNAL           XERBLA
00073 *     ..
00074 *     .. Parameters ..
00075       COMPLEX*16         CZERO
00076       PARAMETER          ( CZERO = ( 0.0D+0, 0.0D+0 ) )
00077 *     ..
00078 *     .. Executable Statements ..
00079 *
00080       INFO = 0
00081       IF( N.LT.0 ) THEN
00082          INFO = -1
00083          CALL XERBLA( 'ZDTTRF', -INFO )
00084          RETURN
00085       END IF
00086 *
00087 *     Quick return if possible
00088 *
00089       IF( N.EQ.0 )
00090      \$   RETURN
00091 *
00092       DO 20 I = 1, N - 1
00093          IF( DL( I ).EQ.CZERO ) THEN
00094 *
00095 *           Subdiagonal is zero, no elimination is required.
00096 *
00097             IF( D( I ).EQ.CZERO .AND. INFO.EQ.0 )
00098      \$         INFO = I
00099          ELSE
00100 *
00101             FACT = DL( I ) / D( I )
00102             DL( I ) = FACT
00103             D( I+1 ) = D( I+1 ) - FACT*DU( I )
00104          END IF
00105    20 CONTINUE
00106       IF( D( N ).EQ.CZERO .AND. INFO.EQ.0 ) THEN
00107          INFO = N
00108          RETURN
00109       END IF
00110 *
00111       RETURN
00112 *
00113 *     End of ZDTTRF
00114 *
00115       END
```