LAPACK 3.12.1
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches

◆ zgttrf()

subroutine zgttrf ( integer n,
complex*16, dimension( * ) dl,
complex*16, dimension( * ) d,
complex*16, dimension( * ) du,
complex*16, dimension( * ) du2,
integer, dimension( * ) ipiv,
integer info )

ZGTTRF

Download ZGTTRF + dependencies [TGZ] [ZIP] [TXT]

Purpose:
!>
!> ZGTTRF computes an LU factorization of a complex tridiagonal matrix A
!> using elimination with partial pivoting and row interchanges.
!>
!> The factorization has the form
!>    A = L * U
!> where L is a product of permutation and unit lower bidiagonal
!> matrices and U is upper triangular with nonzeros in only the main
!> diagonal and first two superdiagonals.
!> 
Parameters
[in]N
!>          N is INTEGER
!>          The order of the matrix A.
!> 
[in,out]DL
!>          DL is COMPLEX*16 array, dimension (N-1)
!>          On entry, DL must contain the (n-1) sub-diagonal elements of
!>          A.
!>
!>          On exit, DL is overwritten by the (n-1) multipliers that
!>          define the matrix L from the LU factorization of A.
!> 
[in,out]D
!>          D is COMPLEX*16 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.
!> 
[in,out]DU
!>          DU is COMPLEX*16 array, dimension (N-1)
!>          On entry, DU must contain the (n-1) super-diagonal elements
!>          of A.
!>
!>          On exit, DU is overwritten by the (n-1) elements of the first
!>          super-diagonal of U.
!> 
[out]DU2
!>          DU2 is COMPLEX*16 array, dimension (N-2)
!>          On exit, DU2 is overwritten by the (n-2) elements of the
!>          second super-diagonal of U.
!> 
[out]IPIV
!>          IPIV is INTEGER array, dimension (N)
!>          The pivot indices; for 1 <= i <= n, row i of the matrix was
!>          interchanged with row IPIV(i).  IPIV(i) will always be either
!>          i or i+1; IPIV(i) = i indicates a row interchange was not
!>          required.
!> 
[out]INFO
!>          INFO is INTEGER
!>          = 0:  successful exit
!>          < 0:  if INFO = -k, the k-th argument had an illegal value
!>          > 0:  if INFO = k, U(k,k) 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.
!> 
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.

Definition at line 121 of file zgttrf.f.

122*
123* -- LAPACK computational routine --
124* -- LAPACK is a software package provided by Univ. of Tennessee, --
125* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
126*
127* .. Scalar Arguments ..
128 INTEGER INFO, N
129* ..
130* .. Array Arguments ..
131 INTEGER IPIV( * )
132 COMPLEX*16 D( * ), DL( * ), DU( * ), DU2( * )
133* ..
134*
135* =====================================================================
136*
137* .. Parameters ..
138 DOUBLE PRECISION ZERO
139 parameter( zero = 0.0d+0 )
140* ..
141* .. Local Scalars ..
142 INTEGER I
143 COMPLEX*16 FACT, TEMP, ZDUM
144* ..
145* .. External Subroutines ..
146 EXTERNAL xerbla
147* ..
148* .. Intrinsic Functions ..
149 INTRINSIC abs, dble, dimag
150* ..
151* .. Statement Functions ..
152 DOUBLE PRECISION CABS1
153* ..
154* .. Statement Function definitions ..
155 cabs1( zdum ) = abs( dble( zdum ) ) + abs( dimag( zdum ) )
156* ..
157* .. Executable Statements ..
158*
159 info = 0
160 IF( n.LT.0 ) THEN
161 info = -1
162 CALL xerbla( 'ZGTTRF', -info )
163 RETURN
164 END IF
165*
166* Quick return if possible
167*
168 IF( n.EQ.0 )
169 $ RETURN
170*
171* Initialize IPIV(i) = i and DU2(i) = 0
172*
173 DO 10 i = 1, n
174 ipiv( i ) = i
175 10 CONTINUE
176 DO 20 i = 1, n - 2
177 du2( i ) = zero
178 20 CONTINUE
179*
180 DO 30 i = 1, n - 2
181 IF( cabs1( d( i ) ).GE.cabs1( dl( i ) ) ) THEN
182*
183* No row interchange required, eliminate DL(I)
184*
185 IF( cabs1( d( i ) ).NE.zero ) THEN
186 fact = dl( i ) / d( i )
187 dl( i ) = fact
188 d( i+1 ) = d( i+1 ) - fact*du( i )
189 END IF
190 ELSE
191*
192* Interchange rows I and I+1, eliminate DL(I)
193*
194 fact = d( i ) / dl( i )
195 d( i ) = dl( i )
196 dl( i ) = fact
197 temp = du( i )
198 du( i ) = d( i+1 )
199 d( i+1 ) = temp - fact*d( i+1 )
200 du2( i ) = du( i+1 )
201 du( i+1 ) = -fact*du( i+1 )
202 ipiv( i ) = i + 1
203 END IF
204 30 CONTINUE
205 IF( n.GT.1 ) THEN
206 i = n - 1
207 IF( cabs1( d( i ) ).GE.cabs1( dl( i ) ) ) THEN
208 IF( cabs1( d( i ) ).NE.zero ) THEN
209 fact = dl( i ) / d( i )
210 dl( i ) = fact
211 d( i+1 ) = d( i+1 ) - fact*du( i )
212 END IF
213 ELSE
214 fact = d( i ) / dl( i )
215 d( i ) = dl( i )
216 dl( i ) = fact
217 temp = du( i )
218 du( i ) = d( i+1 )
219 d( i+1 ) = temp - fact*d( i+1 )
220 ipiv( i ) = i + 1
221 END IF
222 END IF
223*
224* Check for a zero on the diagonal of U.
225*
226 DO 40 i = 1, n
227 IF( cabs1( d( i ) ).EQ.zero ) THEN
228 info = i
229 GO TO 50
230 END IF
231 40 CONTINUE
232 50 CONTINUE
233*
234 RETURN
235*
236* End of ZGTTRF
237*
subroutine xerbla(srname, info)
Definition cblat2.f:3285
Here is the call graph for this function:
Here is the caller graph for this function: