LAPACK  3.8.0
LAPACK: Linear Algebra PACKage

◆ cpptrs()

subroutine cpptrs ( character  UPLO,
integer  N,
integer  NRHS,
complex, dimension( * )  AP,
complex, dimension( ldb, * )  B,
integer  LDB,
integer  INFO 
)

CPPTRS

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

Purpose:
 CPPTRS solves a system of linear equations A*X = B with a Hermitian
 positive definite matrix A in packed storage using the Cholesky
 factorization A = U**H*U or A = L*L**H computed by CPPTRF.
Parameters
[in]UPLO
          UPLO is CHARACTER*1
          = 'U':  Upper triangle of A is stored;
          = 'L':  Lower triangle of A is stored.
[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 COMPLEX array, dimension (N*(N+1)/2)
          The triangular factor U or L from the Cholesky factorization
          A = U**H*U or A = L*L**H, packed columnwise in a linear
          array.  The j-th column of U or L is stored in the array AP
          as follows:
          if UPLO = 'U', AP(i + (j-1)*j/2) = U(i,j) for 1<=i<=j;
          if UPLO = 'L', AP(i + (j-1)*(2n-j)/2) = L(i,j) for j<=i<=n.
[in,out]B
          B is COMPLEX array, dimension (LDB,NRHS)
          On entry, the right hand side matrix B.
          On exit, 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
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Date
December 2016

Definition at line 110 of file cpptrs.f.

110 *
111 * -- LAPACK computational routine (version 3.7.0) --
112 * -- LAPACK is a software package provided by Univ. of Tennessee, --
113 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
114 * December 2016
115 *
116 * .. Scalar Arguments ..
117  CHARACTER uplo
118  INTEGER info, ldb, n, nrhs
119 * ..
120 * .. Array Arguments ..
121  COMPLEX ap( * ), b( ldb, * )
122 * ..
123 *
124 * =====================================================================
125 *
126 * .. Local Scalars ..
127  LOGICAL upper
128  INTEGER i
129 * ..
130 * .. External Functions ..
131  LOGICAL lsame
132  EXTERNAL lsame
133 * ..
134 * .. External Subroutines ..
135  EXTERNAL ctpsv, xerbla
136 * ..
137 * .. Intrinsic Functions ..
138  INTRINSIC max
139 * ..
140 * .. Executable Statements ..
141 *
142 * Test the input parameters.
143 *
144  info = 0
145  upper = lsame( uplo, 'U' )
146  IF( .NOT.upper .AND. .NOT.lsame( uplo, 'L' ) ) THEN
147  info = -1
148  ELSE IF( n.LT.0 ) THEN
149  info = -2
150  ELSE IF( nrhs.LT.0 ) THEN
151  info = -3
152  ELSE IF( ldb.LT.max( 1, n ) ) THEN
153  info = -6
154  END IF
155  IF( info.NE.0 ) THEN
156  CALL xerbla( 'CPPTRS', -info )
157  RETURN
158  END IF
159 *
160 * Quick return if possible
161 *
162  IF( n.EQ.0 .OR. nrhs.EQ.0 )
163  $ RETURN
164 *
165  IF( upper ) THEN
166 *
167 * Solve A*X = B where A = U**H * U.
168 *
169  DO 10 i = 1, nrhs
170 *
171 * Solve U**H *X = B, overwriting B with X.
172 *
173  CALL ctpsv( 'Upper', 'Conjugate transpose', 'Non-unit', n,
174  $ ap, b( 1, i ), 1 )
175 *
176 * Solve U*X = B, overwriting B with X.
177 *
178  CALL ctpsv( 'Upper', 'No transpose', 'Non-unit', n, ap,
179  $ b( 1, i ), 1 )
180  10 CONTINUE
181  ELSE
182 *
183 * Solve A*X = B where A = L * L**H.
184 *
185  DO 20 i = 1, nrhs
186 *
187 * Solve L*Y = B, overwriting B with X.
188 *
189  CALL ctpsv( 'Lower', 'No transpose', 'Non-unit', n, ap,
190  $ b( 1, i ), 1 )
191 *
192 * Solve L**H *X = Y, overwriting B with X.
193 *
194  CALL ctpsv( 'Lower', 'Conjugate transpose', 'Non-unit', n,
195  $ ap, b( 1, i ), 1 )
196  20 CONTINUE
197  END IF
198 *
199  RETURN
200 *
201 * End of CPPTRS
202 *
subroutine xerbla(SRNAME, INFO)
XERBLA
Definition: xerbla.f:62
logical function lsame(CA, CB)
LSAME
Definition: lsame.f:55
subroutine ctpsv(UPLO, TRANS, DIAG, N, AP, X, INCX)
CTPSV
Definition: ctpsv.f:146
Here is the call graph for this function:
Here is the caller graph for this function: