3 * =========== DOCUMENTATION ===========
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
9 *> Download DTRTRS + dependencies
10 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/dtrtrs.f">
12 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/dtrtrs.f">
14 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dtrtrs.f">
21 * SUBROUTINE DTRTRS( UPLO, TRANS, DIAG, N, NRHS, A, LDA, B, LDB,
24 * .. Scalar Arguments ..
25 * CHARACTER DIAG, TRANS, UPLO
26 * INTEGER INFO, LDA, LDB, N, NRHS
28 * .. Array Arguments ..
29 * DOUBLE PRECISION A( LDA, * ), B( LDB, * )
38 *> DTRTRS solves a triangular system of the form
40 *> A * X = B or A**T * X = B,
42 *> where A is a triangular matrix of order N, and B is an N-by-NRHS
43 *> matrix. A check is made to verify that A is nonsingular.
51 *> UPLO is CHARACTER*1
52 *> = 'U': A is upper triangular;
53 *> = 'L': A is lower triangular.
58 *> TRANS is CHARACTER*1
59 *> Specifies the form of the system of equations:
60 *> = 'N': A * X = B (No transpose)
61 *> = 'T': A**T * X = B (Transpose)
62 *> = 'C': A**H * X = B (Conjugate transpose = Transpose)
67 *> DIAG is CHARACTER*1
68 *> = 'N': A is non-unit triangular;
69 *> = 'U': A is unit triangular.
75 *> The order of the matrix A. N >= 0.
81 *> The number of right hand sides, i.e., the number of columns
82 *> of the matrix B. NRHS >= 0.
87 *> A is DOUBLE PRECISION array, dimension (LDA,N)
88 *> The triangular matrix A. If UPLO = 'U', the leading N-by-N
89 *> upper triangular part of the array A contains the upper
90 *> triangular matrix, and the strictly lower triangular part of
91 *> A is not referenced. If UPLO = 'L', the leading N-by-N lower
92 *> triangular part of the array A contains the lower triangular
93 *> matrix, and the strictly upper triangular part of A is not
94 *> referenced. If DIAG = 'U', the diagonal elements of A are
95 *> also not referenced and are assumed to be 1.
101 *> The leading dimension of the array A. LDA >= max(1,N).
106 *> B is DOUBLE PRECISION array, dimension (LDB,NRHS)
107 *> On entry, the right hand side matrix B.
108 *> On exit, if INFO = 0, the solution matrix X.
114 *> The leading dimension of the array B. LDB >= max(1,N).
120 *> = 0: successful exit
121 *> < 0: if INFO = -i, the i-th argument had an illegal value
122 *> > 0: if INFO = i, the i-th diagonal element of A is zero,
123 *> indicating that the matrix is singular and the solutions
124 *> X have not been computed.
130 *> \author Univ. of Tennessee
131 *> \author Univ. of California Berkeley
132 *> \author Univ. of Colorado Denver
135 *> \date November 2011
137 *> \ingroup doubleOTHERcomputational
139 * =====================================================================
140 SUBROUTINE DTRTRS( UPLO, TRANS, DIAG, N, NRHS, A, LDA, B, LDB,
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..--
148 * .. Scalar Arguments ..
149 CHARACTER DIAG, TRANS, UPLO
150 INTEGER INFO, LDA, LDB, N, NRHS
152 * .. Array Arguments ..
153 DOUBLE PRECISION A( LDA, * ), B( LDB, * )
156 * =====================================================================
159 DOUBLE PRECISION ZERO, ONE
160 PARAMETER ( ZERO = 0.0D+0, ONE = 1.0D+0 )
162 * .. Local Scalars ..
165 * .. External Functions ..
169 * .. External Subroutines ..
170 EXTERNAL DTRSM, XERBLA
172 * .. Intrinsic Functions ..
175 * .. Executable Statements ..
177 * Test the input parameters.
180 NOUNIT = LSAME( DIAG, 'N' )
181 IF( .NOT.LSAME( UPLO, 'U' ) .AND. .NOT.LSAME( UPLO, 'L' ) ) THEN
183 ELSE IF( .NOT.LSAME( TRANS, 'N' ) .AND. .NOT.
184 $ LSAME( TRANS, 'T' ) .AND. .NOT.LSAME( TRANS, 'C' ) ) THEN
186 ELSE IF( .NOT.NOUNIT .AND. .NOT.LSAME( DIAG, 'U' ) ) THEN
188 ELSE IF( N.LT.0 ) THEN
190 ELSE IF( NRHS.LT.0 ) THEN
192 ELSE IF( LDA.LT.MAX( 1, N ) ) THEN
194 ELSE IF( LDB.LT.MAX( 1, N ) ) THEN
198 CALL XERBLA( 'DTRTRS', -INFO )
202 * Quick return if possible
207 * Check for singularity.
211 IF( A( INFO, INFO ).EQ.ZERO )
217 * Solve A * x = b or A**T * x = b.
219 CALL DTRSM( 'Left', UPLO, TRANS, DIAG, N, NRHS, ONE, A, LDA, B,