LAPACK  3.6.1
LAPACK: Linear Algebra PACKage
subroutine stptrs ( character  UPLO,
character  TRANS,
character  DIAG,
integer  N,
integer  NRHS,
real, dimension( * )  AP,
real, dimension( ldb, * )  B,
integer  LDB,
integer  INFO 
)

STPTRS

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

Purpose:
 STPTRS solves a triangular system of the form

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

 where A is a triangular matrix of order N stored in packed format,
 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 = 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]AP
          AP is REAL array, dimension (N*(N+1)/2)
          The upper or lower triangular matrix A, packed columnwise in
          a linear array.  The j-th column of A is stored in the array
          AP as follows:
          if UPLO = 'U', AP(i + (j-1)*j/2) = A(i,j) for 1<=i<=j;
          if UPLO = 'L', AP(i + (j-1)*(2*n-j)/2) = A(i,j) for j<=i<=n.
[in,out]B
          B is REAL 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 132 of file stptrs.f.

132 *
133 * -- LAPACK computational routine (version 3.4.0) --
134 * -- LAPACK is a software package provided by Univ. of Tennessee, --
135 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
136 * November 2011
137 *
138 * .. Scalar Arguments ..
139  CHARACTER diag, trans, uplo
140  INTEGER info, ldb, n, nrhs
141 * ..
142 * .. Array Arguments ..
143  REAL ap( * ), b( ldb, * )
144 * ..
145 *
146 * =====================================================================
147 *
148 * .. Parameters ..
149  REAL zero
150  parameter ( zero = 0.0e+0 )
151 * ..
152 * .. Local Scalars ..
153  LOGICAL nounit, upper
154  INTEGER j, jc
155 * ..
156 * .. External Functions ..
157  LOGICAL lsame
158  EXTERNAL lsame
159 * ..
160 * .. External Subroutines ..
161  EXTERNAL stpsv, xerbla
162 * ..
163 * .. Intrinsic Functions ..
164  INTRINSIC max
165 * ..
166 * .. Executable Statements ..
167 *
168 * Test the input parameters.
169 *
170  info = 0
171  upper = lsame( uplo, 'U' )
172  nounit = lsame( diag, 'N' )
173  IF( .NOT.upper .AND. .NOT.lsame( uplo, 'L' ) ) THEN
174  info = -1
175  ELSE IF( .NOT.lsame( trans, 'N' ) .AND. .NOT.
176  $ lsame( trans, 'T' ) .AND. .NOT.lsame( trans, 'C' ) ) THEN
177  info = -2
178  ELSE IF( .NOT.nounit .AND. .NOT.lsame( diag, 'U' ) ) THEN
179  info = -3
180  ELSE IF( n.LT.0 ) THEN
181  info = -4
182  ELSE IF( nrhs.LT.0 ) THEN
183  info = -5
184  ELSE IF( ldb.LT.max( 1, n ) ) THEN
185  info = -8
186  END IF
187  IF( info.NE.0 ) THEN
188  CALL xerbla( 'STPTRS', -info )
189  RETURN
190  END IF
191 *
192 * Quick return if possible
193 *
194  IF( n.EQ.0 )
195  $ RETURN
196 *
197 * Check for singularity.
198 *
199  IF( nounit ) THEN
200  IF( upper ) THEN
201  jc = 1
202  DO 10 info = 1, n
203  IF( ap( jc+info-1 ).EQ.zero )
204  $ RETURN
205  jc = jc + info
206  10 CONTINUE
207  ELSE
208  jc = 1
209  DO 20 info = 1, n
210  IF( ap( jc ).EQ.zero )
211  $ RETURN
212  jc = jc + n - info + 1
213  20 CONTINUE
214  END IF
215  END IF
216  info = 0
217 *
218 * Solve A * x = b or A**T * x = b.
219 *
220  DO 30 j = 1, nrhs
221  CALL stpsv( uplo, trans, diag, n, ap, b( 1, j ), 1 )
222  30 CONTINUE
223 *
224  RETURN
225 *
226 * End of STPTRS
227 *
subroutine xerbla(SRNAME, INFO)
XERBLA
Definition: xerbla.f:62
subroutine stpsv(UPLO, TRANS, DIAG, N, AP, X, INCX)
STPSV
Definition: stpsv.f:146
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: