LAPACK  3.4.1
LAPACK: Linear Algebra PACKage
strtrs.f
Go to the documentation of this file.
00001 *> \brief \b STRTRS
00002 *
00003 *  =========== DOCUMENTATION ===========
00004 *
00005 * Online html documentation available at 
00006 *            http://www.netlib.org/lapack/explore-html/ 
00007 *
00008 *> \htmlonly
00009 *> Download STRTRS + dependencies 
00010 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/strtrs.f"> 
00011 *> [TGZ]</a> 
00012 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/strtrs.f"> 
00013 *> [ZIP]</a> 
00014 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/strtrs.f"> 
00015 *> [TXT]</a>
00016 *> \endhtmlonly 
00017 *
00018 *  Definition:
00019 *  ===========
00020 *
00021 *       SUBROUTINE STRTRS( UPLO, TRANS, DIAG, N, NRHS, A, LDA, B, LDB,
00022 *                          INFO )
00023 * 
00024 *       .. Scalar Arguments ..
00025 *       CHARACTER          DIAG, TRANS, UPLO
00026 *       INTEGER            INFO, LDA, LDB, N, NRHS
00027 *       ..
00028 *       .. Array Arguments ..
00029 *       REAL               A( LDA, * ), B( LDB, * )
00030 *       ..
00031 *  
00032 *
00033 *> \par Purpose:
00034 *  =============
00035 *>
00036 *> \verbatim
00037 *>
00038 *> STRTRS solves a triangular system of the form
00039 *>
00040 *>    A * X = B  or  A**T * X = B,
00041 *>
00042 *> where A is a triangular matrix of order N, and B is an N-by-NRHS
00043 *> matrix.  A check is made to verify that A is nonsingular.
00044 *> \endverbatim
00045 *
00046 *  Arguments:
00047 *  ==========
00048 *
00049 *> \param[in] UPLO
00050 *> \verbatim
00051 *>          UPLO is CHARACTER*1
00052 *>          = 'U':  A is upper triangular;
00053 *>          = 'L':  A is lower triangular.
00054 *> \endverbatim
00055 *>
00056 *> \param[in] TRANS
00057 *> \verbatim
00058 *>          TRANS is CHARACTER*1
00059 *>          Specifies the form of the system of equations:
00060 *>          = 'N':  A * X = B  (No transpose)
00061 *>          = 'T':  A**T * X = B  (Transpose)
00062 *>          = 'C':  A**H * X = B  (Conjugate transpose = Transpose)
00063 *> \endverbatim
00064 *>
00065 *> \param[in] DIAG
00066 *> \verbatim
00067 *>          DIAG is CHARACTER*1
00068 *>          = 'N':  A is non-unit triangular;
00069 *>          = 'U':  A is unit triangular.
00070 *> \endverbatim
00071 *>
00072 *> \param[in] N
00073 *> \verbatim
00074 *>          N is INTEGER
00075 *>          The order of the matrix A.  N >= 0.
00076 *> \endverbatim
00077 *>
00078 *> \param[in] NRHS
00079 *> \verbatim
00080 *>          NRHS is INTEGER
00081 *>          The number of right hand sides, i.e., the number of columns
00082 *>          of the matrix B.  NRHS >= 0.
00083 *> \endverbatim
00084 *>
00085 *> \param[in] A
00086 *> \verbatim
00087 *>          A is REAL array, dimension (LDA,N)
00088 *>          The triangular matrix A.  If UPLO = 'U', the leading N-by-N
00089 *>          upper triangular part of the array A contains the upper
00090 *>          triangular matrix, and the strictly lower triangular part of
00091 *>          A is not referenced.  If UPLO = 'L', the leading N-by-N lower
00092 *>          triangular part of the array A contains the lower triangular
00093 *>          matrix, and the strictly upper triangular part of A is not
00094 *>          referenced.  If DIAG = 'U', the diagonal elements of A are
00095 *>          also not referenced and are assumed to be 1.
00096 *> \endverbatim
00097 *>
00098 *> \param[in] LDA
00099 *> \verbatim
00100 *>          LDA is INTEGER
00101 *>          The leading dimension of the array A.  LDA >= max(1,N).
00102 *> \endverbatim
00103 *>
00104 *> \param[in,out] B
00105 *> \verbatim
00106 *>          B is REAL array, dimension (LDB,NRHS)
00107 *>          On entry, the right hand side matrix B.
00108 *>          On exit, if INFO = 0, the solution matrix X.
00109 *> \endverbatim
00110 *>
00111 *> \param[in] LDB
00112 *> \verbatim
00113 *>          LDB is INTEGER
00114 *>          The leading dimension of the array B.  LDB >= max(1,N).
00115 *> \endverbatim
00116 *>
00117 *> \param[out] INFO
00118 *> \verbatim
00119 *>          INFO is INTEGER
00120 *>          = 0:  successful exit
00121 *>          < 0: if INFO = -i, the i-th argument had an illegal value
00122 *>          > 0: if INFO = i, the i-th diagonal element of A is zero,
00123 *>               indicating that the matrix is singular and the solutions
00124 *>               X have not been computed.
00125 *> \endverbatim
00126 *
00127 *  Authors:
00128 *  ========
00129 *
00130 *> \author Univ. of Tennessee 
00131 *> \author Univ. of California Berkeley 
00132 *> \author Univ. of Colorado Denver 
00133 *> \author NAG Ltd. 
00134 *
00135 *> \date November 2011
00136 *
00137 *> \ingroup realOTHERcomputational
00138 *
00139 *  =====================================================================
00140       SUBROUTINE STRTRS( UPLO, TRANS, DIAG, N, NRHS, A, LDA, B, LDB,
00141      $                   INFO )
00142 *
00143 *  -- LAPACK computational routine (version 3.4.0) --
00144 *  -- LAPACK is a software package provided by Univ. of Tennessee,    --
00145 *  -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
00146 *     November 2011
00147 *
00148 *     .. Scalar Arguments ..
00149       CHARACTER          DIAG, TRANS, UPLO
00150       INTEGER            INFO, LDA, LDB, N, NRHS
00151 *     ..
00152 *     .. Array Arguments ..
00153       REAL               A( LDA, * ), B( LDB, * )
00154 *     ..
00155 *
00156 *  =====================================================================
00157 *
00158 *     .. Parameters ..
00159       REAL               ZERO, ONE
00160       PARAMETER          ( ZERO = 0.0E+0, ONE = 1.0E+0 )
00161 *     ..
00162 *     .. Local Scalars ..
00163       LOGICAL            NOUNIT
00164 *     ..
00165 *     .. External Functions ..
00166       LOGICAL            LSAME
00167       EXTERNAL           LSAME
00168 *     ..
00169 *     .. External Subroutines ..
00170       EXTERNAL           STRSM, XERBLA
00171 *     ..
00172 *     .. Intrinsic Functions ..
00173       INTRINSIC          MAX
00174 *     ..
00175 *     .. Executable Statements ..
00176 *
00177 *     Test the input parameters.
00178 *
00179       INFO = 0
00180       NOUNIT = LSAME( DIAG, 'N' )
00181       IF( .NOT.LSAME( UPLO, 'U' ) .AND. .NOT.LSAME( UPLO, 'L' ) ) THEN
00182          INFO = -1
00183       ELSE IF( .NOT.LSAME( TRANS, 'N' ) .AND. .NOT.
00184      $         LSAME( TRANS, 'T' ) .AND. .NOT.LSAME( TRANS, 'C' ) ) THEN
00185          INFO = -2
00186       ELSE IF( .NOT.NOUNIT .AND. .NOT.LSAME( DIAG, 'U' ) ) THEN
00187          INFO = -3
00188       ELSE IF( N.LT.0 ) THEN
00189          INFO = -4
00190       ELSE IF( NRHS.LT.0 ) THEN
00191          INFO = -5
00192       ELSE IF( LDA.LT.MAX( 1, N ) ) THEN
00193          INFO = -7
00194       ELSE IF( LDB.LT.MAX( 1, N ) ) THEN
00195          INFO = -9
00196       END IF
00197       IF( INFO.NE.0 ) THEN
00198          CALL XERBLA( 'STRTRS', -INFO )
00199          RETURN
00200       END IF
00201 *
00202 *     Quick return if possible
00203 *
00204       IF( N.EQ.0 )
00205      $   RETURN
00206 *
00207 *     Check for singularity.
00208 *
00209       IF( NOUNIT ) THEN
00210          DO 10 INFO = 1, N
00211             IF( A( INFO, INFO ).EQ.ZERO )
00212      $         RETURN
00213    10    CONTINUE
00214       END IF
00215       INFO = 0
00216 *
00217 *     Solve A * x = b  or  A**T * x = b.
00218 *
00219       CALL STRSM( 'Left', UPLO, TRANS, DIAG, N, NRHS, ONE, A, LDA, B,
00220      $            LDB )
00221 *
00222       RETURN
00223 *
00224 *     End of STRTRS
00225 *
00226       END
 All Files Functions