LAPACK  3.6.1
LAPACK: Linear Algebra PACKage
subroutine ctrtrs ( character  UPLO,
character  TRANS,
character  DIAG,
integer  N,
integer  NRHS,
complex, dimension( lda, * )  A,
integer  LDA,
complex, dimension( ldb, * )  B,
integer  LDB,
integer  INFO 
)

CTRTRS

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

Purpose:
 CTRTRS solves a triangular system of the form

    A * X = B,  A**T * X = B,  or  A**H * X = B,

 where A is a triangular matrix of order N, and B is an N-by-NRHS
 matrix.  A check is made to verify that A is nonsingular.
Parameters
[in]UPLO
          UPLO is CHARACTER*1
          = 'U':  A is upper triangular;
          = 'L':  A is lower triangular.
[in]TRANS
          TRANS is CHARACTER*1
          Specifies the form of the system of equations:
          = 'N':  A * X = B     (No transpose)
          = 'T':  A**T * X = B  (Transpose)
          = 'C':  A**H * X = B  (Conjugate transpose)
[in]DIAG
          DIAG is CHARACTER*1
          = 'N':  A is non-unit triangular;
          = 'U':  A is unit triangular.
[in]N
          N is INTEGER
          The order of the matrix A.  N >= 0.
[in]NRHS
          NRHS is INTEGER
          The number of right hand sides, i.e., the number of columns
          of the matrix B.  NRHS >= 0.
[in]A
          A is COMPLEX array, dimension (LDA,N)
          The triangular matrix A.  If UPLO = 'U', the leading N-by-N
          upper triangular part of the array A contains the upper
          triangular matrix, and the strictly lower triangular part of
          A is not referenced.  If UPLO = 'L', the leading N-by-N lower
          triangular part of the array A contains the lower triangular
          matrix, and the strictly upper triangular part of A is not
          referenced.  If DIAG = 'U', the diagonal elements of A are
          also not referenced and are assumed to be 1.
[in]LDA
          LDA is INTEGER
          The leading dimension of the array A.  LDA >= max(1,N).
[in,out]B
          B is COMPLEX array, dimension (LDB,NRHS)
          On entry, the right hand side matrix B.
          On exit, if INFO = 0, the solution matrix X.
[in]LDB
          LDB is INTEGER
          The leading dimension of the array B.  LDB >= max(1,N).
[out]INFO
          INFO is INTEGER
          = 0:  successful exit
          < 0: if INFO = -i, the i-th argument had an illegal value
          > 0: if INFO = i, the i-th diagonal element of A is zero,
               indicating that the matrix is singular and the solutions
               X have not been computed.
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Date
November 2011

Definition at line 142 of file ctrtrs.f.

142 *
143 * -- LAPACK computational routine (version 3.4.0) --
144 * -- LAPACK is a software package provided by Univ. of Tennessee, --
145 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
146 * November 2011
147 *
148 * .. Scalar Arguments ..
149  CHARACTER diag, trans, uplo
150  INTEGER info, lda, ldb, n, nrhs
151 * ..
152 * .. Array Arguments ..
153  COMPLEX a( lda, * ), b( ldb, * )
154 * ..
155 *
156 * =====================================================================
157 *
158 * .. Parameters ..
159  COMPLEX zero, one
160  parameter ( zero = ( 0.0e+0, 0.0e+0 ),
161  $ one = ( 1.0e+0, 0.0e+0 ) )
162 * ..
163 * .. Local Scalars ..
164  LOGICAL nounit
165 * ..
166 * .. External Functions ..
167  LOGICAL lsame
168  EXTERNAL lsame
169 * ..
170 * .. External Subroutines ..
171  EXTERNAL ctrsm, xerbla
172 * ..
173 * .. Intrinsic Functions ..
174  INTRINSIC max
175 * ..
176 * .. Executable Statements ..
177 *
178 * Test the input parameters.
179 *
180  info = 0
181  nounit = lsame( diag, 'N' )
182  IF( .NOT.lsame( uplo, 'U' ) .AND. .NOT.lsame( uplo, 'L' ) ) THEN
183  info = -1
184  ELSE IF( .NOT.lsame( trans, 'N' ) .AND. .NOT.
185  $ lsame( trans, 'T' ) .AND. .NOT.lsame( trans, 'C' ) ) THEN
186  info = -2
187  ELSE IF( .NOT.nounit .AND. .NOT.lsame( diag, 'U' ) ) THEN
188  info = -3
189  ELSE IF( n.LT.0 ) THEN
190  info = -4
191  ELSE IF( nrhs.LT.0 ) THEN
192  info = -5
193  ELSE IF( lda.LT.max( 1, n ) ) THEN
194  info = -7
195  ELSE IF( ldb.LT.max( 1, n ) ) THEN
196  info = -9
197  END IF
198  IF( info.NE.0 ) THEN
199  CALL xerbla( 'CTRTRS', -info )
200  RETURN
201  END IF
202 *
203 * Quick return if possible
204 *
205  IF( n.EQ.0 )
206  $ RETURN
207 *
208 * Check for singularity.
209 *
210  IF( nounit ) THEN
211  DO 10 info = 1, n
212  IF( a( info, info ).EQ.zero )
213  $ RETURN
214  10 CONTINUE
215  END IF
216  info = 0
217 *
218 * Solve A * x = b, A**T * x = b, or A**H * x = b.
219 *
220  CALL ctrsm( 'Left', uplo, trans, diag, n, nrhs, one, a, lda, b,
221  $ ldb )
222 *
223  RETURN
224 *
225 * End of CTRTRS
226 *
subroutine xerbla(SRNAME, INFO)
XERBLA
Definition: xerbla.f:62
subroutine ctrsm(SIDE, UPLO, TRANSA, DIAG, M, N, ALPHA, A, LDA, B, LDB)
CTRSM
Definition: ctrsm.f:182
logical function lsame(CA, CB)
LSAME
Definition: lsame.f:55

Here is the call graph for this function:

Here is the caller graph for this function: