Routine: CDTTRF()  File: SRC\cdttrf.f

 
 
# lines: 112
  # code: 112
  # comment: 0
  # blank:0
# Variables:7
# Callers:0
# Callings:0
# Words:44
# Keywords:34
 

 

..
     .. Array Arguments ..
     ..
  Purpose
  =======
  CDTTRF computes an LU factorization of a complex tridiagonal matrix A
  using elimination without partial pivoting.
  The factorization has the form
     A = L * U
  where L is a product of unit lower bidiagonal
  matrices and U is upper triangular with nonzeros in only the main
  diagonal and first superdiagonal.
  Arguments
  =========
  N       (input) INTEGER
          The order of the matrix A.  N >= 0.
  DL      (input/output) COMPLEX array, dimension (N-1)
          On entry, DL must contain the (n-1) subdiagonal elements of
          A.
          On exit, DL is overwritten by the (n-1) multipliers that
          define the matrix L from the LU factorization of A.
  D       (input/output) COMPLEX array, dimension (N)
          On entry, D must contain the diagonal elements of A.
          On exit, D is overwritten by the n diagonal elements of the
          upper triangular matrix U from the LU factorization of A.
  DU      (input/output) COMPLEX array, dimension (N-1)
          On entry, DU must contain the (n-1) superdiagonal elements
          of A.
          On exit, DU is overwritten by the (n-1) elements of the first
          superdiagonal of U.
  INFO    (output) INTEGER
          = 0:  successful exit
          < 0:  if INFO = -i, the i-th argument had an illegal value
          > 0:  if INFO = i, U(i,i) 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.
  =====================================================================
     .. Local Scalars ..

 
Display dynamic version Find AutoScroll Reload FontSize: - + Hide Comments Hide Blanks Frame FullScreen MailPrint

 
01        SUBROUTINE CDTTRF( N , DL , D , DU , INFO )
02  
03  *     Written by Andrew J. Cleary , November 1996.
04  *     Modified from CGTTRF :
05  *     -- LAPACK routine(preliminary version) --
06  *     Univ. of Tennessee , Univ. of California Berkeley , NAG Ltd. ,
07  *     Courant Institute , Argonne National Lab , and Rice University
08  
09  *     .. Scalar Arguments ..
10        INTEGER INFO , N
11        INTEGER I
12        COMPLEX FACT
13  *     ..
14  *     .. Intrinsic Functions ..
15        INTRINSIC ABS
16  *     ..
17  *     .. External Subroutines ..
18        EXTERNAL XERBLA
19  *     ..
20  *     .. Parameters ..
21        COMPLEX CZERO
22        PARAMETER( CZERO =( 0.0E + 0 , 0.0E + 0 ) )
23  *     ..
24  *     .. Executable Statements ..
25  
26        INFO = 0
27        IF( N.LT.0 ) THEN
28            INFO = - 1
29            CALL XERBLA( 'CDTTRF' , - INFO )
30            RETURN
31        END IF
32  
33  *     Quick return if possible
34  
35        IF( N.EQ.0 )
36       $    RETURN
37  
38            DO 20 I = 1 , N - 1
39                IF( DL( I ).EQ.CZERO ) THEN
40  
41  *                 Subdiagonal is zero , no elimination is required.
42  
43                    IF( D( I ).EQ.CZERO .AND. INFO.EQ.0 )
44       $                INFO = I
45                    ELSE
46  
47                        FACT = DL( I ) / D( I )
48                        DL( I ) = FACT
49                        D( I + 1 ) = D( I + 1 ) - FACT*DU( I )
50                    END IF
51     20     CONTINUE
52            IF( D( N ).EQ.CZERO .AND. INFO.EQ.0 ) THEN
53                INFO = N
54                RETURN
55            END IF
56  
57            RETURN
58  
59  *         End of CDTTRF
60  
61        END