Routine: SPTTRSV()  File: SRC\spttrsv.f

 
 
# lines: 132
  # code: 132
  # comment: 0
  # blank:0
# Variables:10
# Callers:0
# Callings:0
# Words:57
# Keywords:42
 

 

..
     .. Array Arguments ..
     ..
  Purpose
  =======
  SPTTRSV solves one of the triangular systems
     L**T* X = B, or  L * X = B,
  where L is the Cholesky factor of a Hermitian positive
  definite tridiagonal matrix A such that
  A = L*D*L**H (computed by SPTTRF).
  Arguments
  =========
  TRANS   (input) CHARACTER
          Specifies the form of the system of equations:
          = 'N':  L * X = B     (No transpose)
          = 'T':  L**T * X = B  (Transpose)
  N       (input) INTEGER
          The order of the tridiagonal matrix A.  N >= 0.
  NRHS    (input) INTEGER
          The number of right hand sides, i.e., the number of columns
          of the matrix B.  NRHS >= 0.
  D       (input) REAL array, dimension (N)
          The n diagonal elements of the diagonal matrix D from the
          factorization computed by SPTTRF.
  E       (input) COMPLEX array, dimension (N-1)
          The (n-1) off-diagonal elements of the unit bidiagonal
          factor U or L from the factorization computed by SPTTRF
          (see UPLO).
  B       (input/output) COMPLEX array, dimension (LDB,NRHS)
          On entry, the right hand side matrix B.
          On exit, the solution matrix X.
  LDB     (input) INTEGER
          The leading dimension of the array B.  LDB >= max(1,N).
  INFO    (output) INTEGER
          = 0:  successful exit
          < 0:  if INFO = -i, the i-th argument had an illegal value
  =====================================================================
     .. Local Scalars ..

 
Display dynamic version Find AutoScroll Reload FontSize: - + Hide Comments Hide Blanks Frame FullScreen MailPrint

 
01        SUBROUTINE SPTTRSV( TRANS , N , NRHS , D , E , B , LDB ,
02       $INFO )
03  
04  *     Written by Andrew J. Cleary , University of Tennessee.
05  *     November , 1996.
06  *     Modified from SPTTRS :
07  *     -- LAPACK routine(preliminary version) --
08  *     Univ. of Tennessee , Univ. of California Berkeley , NAG Ltd. ,
09  *     Courant Institute , Argonne National Lab , and Rice University
10  
11  *     .. Scalar Arguments ..
12        CHARACTER TRANS
13        INTEGER INFO , LDB , N , NRHS
14        LOGICAL NOTRAN
15        INTEGER I , J
16  *     ..
17  *     .. External Functions ..
18        LOGICAL LSAME
19        EXTERNAL LSAME
20  *     ..
21  *     .. External Subroutines ..
22        EXTERNAL XERBLA
23  *     ..
24  *     .. Intrinsic Functions ..
25        INTRINSIC MAX
26  *     ..
27  *     .. Executable Statements ..
28  
29  *     Test the input arguments.
30  
31        INFO = 0
32        NOTRAN = LSAME( TRANS , 'N' )
33        IF( .NOT.NOTRAN .AND. .NOT.LSAME( TRANS , 'T' ) ) THEN
34            INFO = - 1
35        ELSE IF( N.LT.0 ) THEN
36            INFO = - 2
37        ELSE IF( NRHS.LT.0 ) THEN
38            INFO = - 3
39        ELSE IF( LDB.LT.MAX( 1 , N ) ) THEN
40            INFO = - 7
41        END IF
42        IF( INFO.NE.0 ) THEN
43            CALL XERBLA( 'SPTTRS' , - INFO )
44            RETURN
45        END IF
46  
47  *     Quick return if possible
48  
49        IF( N.EQ.0 )
50       $    RETURN
51            IF( NOTRAN ) THEN
52  
53                DO 60 J = 1 , NRHS
54  
55  *                 Solve L * x = b.
56  
57                    DO 40 I = 2 , N
58                        B( I , J ) = B( I , J ) - B( I - 1 , J )*E( I - 1 )
59     40             CONTINUE
60     60         CONTINUE
61  
62            ELSE
63  
64                DO 65 J = 1 , NRHS
65  
66  *                 Solve L**H * x = b.
67  
68                    DO 50 I = N - 1 , 1 , - 1
69                        B( I , J ) = B( I , J ) -
70       $                B( I + 1 , J )*( E( I ) )
71     50             CONTINUE
72     65         CONTINUE
73            ENDIF
74  
75            RETURN
76  
77  *         End of SPTTRS
78  
79        END