LAPACK  3.6.0
LAPACK: Linear Algebra PACKage
Collaboration diagram for complex16:

Functions

subroutine zsysv (UPLO, N, NRHS, A, LDA, IPIV, B, LDB, WORK, LWORK, INFO)
  ZSYSV computes the solution to system of linear equations A * X = B for SY matrices More...
 
subroutine zsysv_rook (UPLO, N, NRHS, A, LDA, IPIV, B, LDB, WORK, LWORK, INFO)
  ZSYSV_ROOK computes the solution to system of linear equations A * X = B for SY matrices More...
 
subroutine zsysvx (FACT, UPLO, N, NRHS, A, LDA, AF, LDAF, IPIV, B, LDB, X, LDX, RCOND, FERR, BERR, WORK, LWORK, RWORK, INFO)
  ZSYSVX computes the solution to system of linear equations A * X = B for SY matrices More...
 
subroutine zsysvxx (FACT, UPLO, N, NRHS, A, LDA, AF, LDAF, IPIV, EQUED, S, B, LDB, X, LDX, RCOND, RPVGRW, BERR, N_ERR_BNDS, ERR_BNDS_NORM, ERR_BNDS_COMP, NPARAMS, PARAMS, WORK, RWORK, INFO)
  ZSYSVXX computes the solution to system of linear equations A * X = B for SY matrices More...
 

Detailed Description

This is the group of complex16 solve driver functions for SY matrices

Function Documentation

subroutine zsysv ( character  UPLO,
integer  N,
integer  NRHS,
complex*16, dimension( lda, * )  A,
integer  LDA,
integer, dimension( * )  IPIV,
complex*16, dimension( ldb, * )  B,
integer  LDB,
complex*16, dimension( * )  WORK,
integer  LWORK,
integer  INFO 
)

ZSYSV computes the solution to system of linear equations A * X = B for SY matrices

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

Purpose:
 ZSYSV computes the solution to a complex system of linear equations
    A * X = B,
 where A is an N-by-N symmetric matrix and X and B are N-by-NRHS
 matrices.

 The diagonal pivoting method is used to factor A as
    A = U * D * U**T,  if UPLO = 'U', or
    A = L * D * L**T,  if UPLO = 'L',
 where U (or L) is a product of permutation and unit upper (lower)
 triangular matrices, and D is symmetric and block diagonal with
 1-by-1 and 2-by-2 diagonal blocks.  The factored form of A is then
 used to solve the system of equations A * X = B.
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 number of linear equations, i.e., 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,out]A
          A is COMPLEX*16 array, dimension (LDA,N)
          On entry, the symmetric matrix A.  If UPLO = 'U', the leading
          N-by-N upper triangular part of A contains the upper
          triangular part of the matrix A, and the strictly lower
          triangular part of A is not referenced.  If UPLO = 'L', the
          leading N-by-N lower triangular part of A contains the lower
          triangular part of the matrix A, and the strictly upper
          triangular part of A is not referenced.

          On exit, if INFO = 0, the block diagonal matrix D and the
          multipliers used to obtain the factor U or L from the
          factorization A = U*D*U**T or A = L*D*L**T as computed by
          ZSYTRF.
[in]LDA
          LDA is INTEGER
          The leading dimension of the array A.  LDA >= max(1,N).
[out]IPIV
          IPIV is INTEGER array, dimension (N)
          Details of the interchanges and the block structure of D, as
          determined by ZSYTRF.  If IPIV(k) > 0, then rows and columns
          k and IPIV(k) were interchanged, and D(k,k) is a 1-by-1
          diagonal block.  If UPLO = 'U' and IPIV(k) = IPIV(k-1) < 0,
          then rows and columns k-1 and -IPIV(k) were interchanged and
          D(k-1:k,k-1:k) is a 2-by-2 diagonal block.  If UPLO = 'L' and
          IPIV(k) = IPIV(k+1) < 0, then rows and columns k+1 and
          -IPIV(k) were interchanged and D(k:k+1,k:k+1) is a 2-by-2
          diagonal block.
[in,out]B
          B is COMPLEX*16 array, dimension (LDB,NRHS)
          On entry, the N-by-NRHS right hand side matrix B.
          On exit, if INFO = 0, the N-by-NRHS solution matrix X.
[in]LDB
          LDB is INTEGER
          The leading dimension of the array B.  LDB >= max(1,N).
[out]WORK
          WORK is COMPLEX*16 array, dimension (MAX(1,LWORK))
          On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
[in]LWORK
          LWORK is INTEGER
          The length of WORK.  LWORK >= 1, and for best performance
          LWORK >= max(1,N*NB), where NB is the optimal blocksize for
          ZSYTRF.
          for LWORK < N, TRS will be done with Level BLAS 2
          for LWORK >= N, TRS will be done with Level BLAS 3

          If LWORK = -1, then a workspace query is assumed; the routine
          only calculates the optimal size of the WORK array, returns
          this value as the first entry of the WORK array, and no error
          message related to LWORK is issued by XERBLA.
[out]INFO
          INFO is INTEGER
          = 0: successful exit
          < 0: if INFO = -i, the i-th argument had an illegal value
          > 0: if INFO = i, D(i,i) is exactly zero.  The factorization
               has been completed, but the block diagonal matrix D is
               exactly singular, so the solution could not be computed.
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Date
November 2011

Definition at line 173 of file zsysv.f.

173 *
174 * -- LAPACK driver routine (version 3.4.0) --
175 * -- LAPACK is a software package provided by Univ. of Tennessee, --
176 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
177 * November 2011
178 *
179 * .. Scalar Arguments ..
180  CHARACTER uplo
181  INTEGER info, lda, ldb, lwork, n, nrhs
182 * ..
183 * .. Array Arguments ..
184  INTEGER ipiv( * )
185  COMPLEX*16 a( lda, * ), b( ldb, * ), work( * )
186 * ..
187 *
188 * =====================================================================
189 *
190 * .. Local Scalars ..
191  LOGICAL lquery
192  INTEGER lwkopt
193 * ..
194 * .. External Functions ..
195  LOGICAL lsame
196  EXTERNAL lsame
197 * ..
198 * .. External Subroutines ..
199  EXTERNAL xerbla, zsytrf, zsytrs, zsytrs2
200 * ..
201 * .. Intrinsic Functions ..
202  INTRINSIC max
203 * ..
204 * .. Executable Statements ..
205 *
206 * Test the input parameters.
207 *
208  info = 0
209  lquery = ( lwork.EQ.-1 )
210  IF( .NOT.lsame( uplo, 'U' ) .AND. .NOT.lsame( uplo, 'L' ) ) THEN
211  info = -1
212  ELSE IF( n.LT.0 ) THEN
213  info = -2
214  ELSE IF( nrhs.LT.0 ) THEN
215  info = -3
216  ELSE IF( lda.LT.max( 1, n ) ) THEN
217  info = -5
218  ELSE IF( ldb.LT.max( 1, n ) ) THEN
219  info = -8
220  ELSE IF( lwork.LT.1 .AND. .NOT.lquery ) THEN
221  info = -10
222  END IF
223 *
224  IF( info.EQ.0 ) THEN
225  IF( n.EQ.0 ) THEN
226  lwkopt = 1
227  ELSE
228  CALL zsytrf( uplo, n, a, lda, ipiv, work, -1, info )
229  lwkopt = work(1)
230  END IF
231  work( 1 ) = lwkopt
232  END IF
233 *
234  IF( info.NE.0 ) THEN
235  CALL xerbla( 'ZSYSV ', -info )
236  RETURN
237  ELSE IF( lquery ) THEN
238  RETURN
239  END IF
240 *
241 * Compute the factorization A = U*D*U**T or A = L*D*L**T.
242 *
243  CALL zsytrf( uplo, n, a, lda, ipiv, work, lwork, info )
244  IF( info.EQ.0 ) THEN
245 *
246 * Solve the system A*X = B, overwriting B with X.
247 *
248  IF ( lwork.LT.n ) THEN
249 *
250 * Solve with TRS ( Use Level BLAS 2)
251 *
252  CALL zsytrs( uplo, n, nrhs, a, lda, ipiv, b, ldb, info )
253 *
254  ELSE
255 *
256 * Solve with TRS2 ( Use Level BLAS 3)
257 *
258  CALL zsytrs2( uplo,n,nrhs,a,lda,ipiv,b,ldb,work,info )
259 *
260  END IF
261 *
262  END IF
263 *
264  work( 1 ) = lwkopt
265 *
266  RETURN
267 *
268 * End of ZSYSV
269 *
subroutine xerbla(SRNAME, INFO)
XERBLA
Definition: xerbla.f:62
subroutine zsytrf(UPLO, N, A, LDA, IPIV, WORK, LWORK, INFO)
ZSYTRF
Definition: zsytrf.f:184
logical function lsame(CA, CB)
LSAME
Definition: lsame.f:55
subroutine zsytrs2(UPLO, N, NRHS, A, LDA, IPIV, B, LDB, WORK, INFO)
ZSYTRS2
Definition: zsytrs2.f:134
subroutine zsytrs(UPLO, N, NRHS, A, LDA, IPIV, B, LDB, INFO)
ZSYTRS
Definition: zsytrs.f:122

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine zsysv_rook ( character  UPLO,
integer  N,
integer  NRHS,
complex*16, dimension( lda, * )  A,
integer  LDA,
integer, dimension( * )  IPIV,
complex*16, dimension( ldb, * )  B,
integer  LDB,
complex*16, dimension( * )  WORK,
integer  LWORK,
integer  INFO 
)

ZSYSV_ROOK computes the solution to system of linear equations A * X = B for SY matrices

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

Purpose:
 ZSYSV_ROOK computes the solution to a complex system of linear
 equations
    A * X = B,
 where A is an N-by-N symmetric matrix and X and B are N-by-NRHS
 matrices.

 The diagonal pivoting method is used to factor A as
    A = U * D * U**T,  if UPLO = 'U', or
    A = L * D * L**T,  if UPLO = 'L',
 where U (or L) is a product of permutation and unit upper (lower)
 triangular matrices, and D is symmetric and block diagonal with
 1-by-1 and 2-by-2 diagonal blocks.  

 ZSYTRF_ROOK is called to compute the factorization of a complex
 symmetric matrix A using the bounded Bunch-Kaufman ("rook") diagonal
 pivoting method.

 The factored form of A is then used to solve the system 
 of equations A * X = B by calling ZSYTRS_ROOK.
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 number of linear equations, i.e., 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,out]A
          A is COMPLEX*16 array, dimension (LDA,N)
          On entry, the symmetric matrix A.  If UPLO = 'U', the leading
          N-by-N upper triangular part of A contains the upper
          triangular part of the matrix A, and the strictly lower
          triangular part of A is not referenced.  If UPLO = 'L', the
          leading N-by-N lower triangular part of A contains the lower
          triangular part of the matrix A, and the strictly upper
          triangular part of A is not referenced.

          On exit, if INFO = 0, the block diagonal matrix D and the
          multipliers used to obtain the factor U or L from the
          factorization A = U*D*U**T or A = L*D*L**T as computed by
          ZSYTRF_ROOK.
[in]LDA
          LDA is INTEGER
          The leading dimension of the array A.  LDA >= max(1,N).
[out]IPIV
          IPIV is INTEGER array, dimension (N)
          Details of the interchanges and the block structure of D,
          as determined by ZSYTRF_ROOK.

          If UPLO = 'U':
               If IPIV(k) > 0, then rows and columns k and IPIV(k)
               were interchanged and D(k,k) is a 1-by-1 diagonal block.

               If IPIV(k) < 0 and IPIV(k-1) < 0, then rows and
               columns k and -IPIV(k) were interchanged and rows and
               columns k-1 and -IPIV(k-1) were inerchaged,
               D(k-1:k,k-1:k) is a 2-by-2 diagonal block.

          If UPLO = 'L':
               If IPIV(k) > 0, then rows and columns k and IPIV(k)
               were interchanged and D(k,k) is a 1-by-1 diagonal block.

               If IPIV(k) < 0 and IPIV(k+1) < 0, then rows and
               columns k and -IPIV(k) were interchanged and rows and
               columns k+1 and -IPIV(k+1) were inerchaged,
               D(k:k+1,k:k+1) is a 2-by-2 diagonal block.
[in,out]B
          B is COMPLEX*16 array, dimension (LDB,NRHS)
          On entry, the N-by-NRHS right hand side matrix B.
          On exit, if INFO = 0, the N-by-NRHS solution matrix X.
[in]LDB
          LDB is INTEGER
          The leading dimension of the array B.  LDB >= max(1,N).
[out]WORK
          WORK is COMPLEX*16 array, dimension (MAX(1,LWORK))
          On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
[in]LWORK
          LWORK is INTEGER
          The length of WORK.  LWORK >= 1, and for best performance
          LWORK >= max(1,N*NB), where NB is the optimal blocksize for
          ZSYTRF_ROOK.
          
          TRS will be done with Level 2 BLAS

          If LWORK = -1, then a workspace query is assumed; the routine
          only calculates the optimal size of the WORK array, returns
          this value as the first entry of the WORK array, and no error
          message related to LWORK is issued by XERBLA.
[out]INFO
          INFO is INTEGER
          = 0: successful exit
          < 0: if INFO = -i, the i-th argument had an illegal value
          > 0: if INFO = i, D(i,i) is exactly zero.  The factorization
               has been completed, but the block diagonal matrix D is
               exactly singular, so the solution could not be computed.
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Date
November 2015
Contributors:
   November 2015, Igor Kozachenko,
                  Computer Science Division,
                  University of California, Berkeley

  September 2007, Sven Hammarling, Nicholas J. Higham, Craig Lucas,
                  School of Mathematics,
                  University of Manchester

Definition at line 206 of file zsysv_rook.f.

206 *
207 * -- LAPACK driver routine (version 3.6.0) --
208 * -- LAPACK is a software package provided by Univ. of Tennessee, --
209 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
210 * November 2015
211 *
212 * .. Scalar Arguments ..
213  CHARACTER uplo
214  INTEGER info, lda, ldb, lwork, n, nrhs
215 * ..
216 * .. Array Arguments ..
217  INTEGER ipiv( * )
218  COMPLEX*16 a( lda, * ), b( ldb, * ), work( * )
219 * ..
220 *
221 * =====================================================================
222 *
223 * .. Local Scalars ..
224  LOGICAL lquery
225  INTEGER lwkopt
226 * ..
227 * .. External Functions ..
228  LOGICAL lsame
229  EXTERNAL lsame
230 * ..
231 * .. External Subroutines ..
232  EXTERNAL xerbla, zsytrf_rook, zsytrs_rook
233 * ..
234 * .. Intrinsic Functions ..
235  INTRINSIC max
236 * ..
237 * .. Executable Statements ..
238 *
239 * Test the input parameters.
240 *
241  info = 0
242  lquery = ( lwork.EQ.-1 )
243  IF( .NOT.lsame( uplo, 'U' ) .AND. .NOT.lsame( uplo, 'L' ) ) THEN
244  info = -1
245  ELSE IF( n.LT.0 ) THEN
246  info = -2
247  ELSE IF( nrhs.LT.0 ) THEN
248  info = -3
249  ELSE IF( lda.LT.max( 1, n ) ) THEN
250  info = -5
251  ELSE IF( ldb.LT.max( 1, n ) ) THEN
252  info = -8
253  ELSE IF( lwork.LT.1 .AND. .NOT.lquery ) THEN
254  info = -10
255  END IF
256 *
257  IF( info.EQ.0 ) THEN
258  IF( n.EQ.0 ) THEN
259  lwkopt = 1
260  ELSE
261  CALL zsytrf_rook( uplo, n, a, lda, ipiv, work, -1, info )
262  lwkopt = work(1)
263  END IF
264  work( 1 ) = lwkopt
265  END IF
266 *
267  IF( info.NE.0 ) THEN
268  CALL xerbla( 'ZSYSV_ROOK ', -info )
269  RETURN
270  ELSE IF( lquery ) THEN
271  RETURN
272  END IF
273 *
274 * Compute the factorization A = U*D*U**T or A = L*D*L**T.
275 *
276  CALL zsytrf_rook( uplo, n, a, lda, ipiv, work, lwork, info )
277  IF( info.EQ.0 ) THEN
278 *
279 * Solve the system A*X = B, overwriting B with X.
280 *
281 * Solve with TRS_ROOK ( Use Level 2 BLAS)
282 *
283  CALL zsytrs_rook( uplo, n, nrhs, a, lda, ipiv, b, ldb, info )
284 *
285  END IF
286 *
287  work( 1 ) = lwkopt
288 *
289  RETURN
290 *
291 * End of ZSYSV_ROOK
292 *
subroutine zsytrs_rook(UPLO, N, NRHS, A, LDA, IPIV, B, LDB, INFO)
ZSYTRS_ROOK
Definition: zsytrs_rook.f:138
subroutine xerbla(SRNAME, INFO)
XERBLA
Definition: xerbla.f:62
logical function lsame(CA, CB)
LSAME
Definition: lsame.f:55
subroutine zsytrf_rook(UPLO, N, A, LDA, IPIV, WORK, LWORK, INFO)
ZSYTRF_ROOK
Definition: zsytrf_rook.f:210

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine zsysvx ( character  FACT,
character  UPLO,
integer  N,
integer  NRHS,
complex*16, dimension( lda, * )  A,
integer  LDA,
complex*16, dimension( ldaf, * )  AF,
integer  LDAF,
integer, dimension( * )  IPIV,
complex*16, dimension( ldb, * )  B,
integer  LDB,
complex*16, dimension( ldx, * )  X,
integer  LDX,
double precision  RCOND,
double precision, dimension( * )  FERR,
double precision, dimension( * )  BERR,
complex*16, dimension( * )  WORK,
integer  LWORK,
double precision, dimension( * )  RWORK,
integer  INFO 
)

ZSYSVX computes the solution to system of linear equations A * X = B for SY matrices

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

Purpose:
 ZSYSVX uses the diagonal pivoting factorization to compute the
 solution to a complex system of linear equations A * X = B,
 where A is an N-by-N symmetric matrix and X and B are N-by-NRHS
 matrices.

 Error bounds on the solution and a condition estimate are also
 provided.
Description:
 The following steps are performed:

 1. If FACT = 'N', the diagonal pivoting method is used to factor A.
    The form of the factorization is
       A = U * D * U**T,  if UPLO = 'U', or
       A = L * D * L**T,  if UPLO = 'L',
    where U (or L) is a product of permutation and unit upper (lower)
    triangular matrices, and D is symmetric and block diagonal with
    1-by-1 and 2-by-2 diagonal blocks.

 2. If some D(i,i)=0, so that D is exactly singular, then the routine
    returns with INFO = i. Otherwise, the factored form of A is used
    to estimate the condition number of the matrix A.  If the
    reciprocal of the condition number is less than machine precision,
    INFO = N+1 is returned as a warning, but the routine still goes on
    to solve for X and compute error bounds as described below.

 3. The system of equations is solved for X using the factored form
    of A.

 4. Iterative refinement is applied to improve the computed solution
    matrix and calculate error bounds and backward error estimates
    for it.
Parameters
[in]FACT
          FACT is CHARACTER*1
          Specifies whether or not the factored form of A has been
          supplied on entry.
          = 'F':  On entry, AF and IPIV contain the factored form
                  of A.  A, AF and IPIV will not be modified.
          = 'N':  The matrix A will be copied to AF and factored.
[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 number of linear equations, i.e., 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 matrices B and X.  NRHS >= 0.
[in]A
          A is COMPLEX*16 array, dimension (LDA,N)
          The symmetric matrix A.  If UPLO = 'U', the leading N-by-N
          upper triangular part of A contains the upper triangular part
          of the matrix A, and the strictly lower triangular part of A
          is not referenced.  If UPLO = 'L', the leading N-by-N lower
          triangular part of A contains the lower triangular part of
          the matrix A, and the strictly upper triangular part of A is
          not referenced.
[in]LDA
          LDA is INTEGER
          The leading dimension of the array A.  LDA >= max(1,N).
[in,out]AF
          AF is COMPLEX*16 array, dimension (LDAF,N)
          If FACT = 'F', then AF is an input argument and on entry
          contains the block diagonal matrix D and the multipliers used
          to obtain the factor U or L from the factorization
          A = U*D*U**T or A = L*D*L**T as computed by ZSYTRF.

          If FACT = 'N', then AF is an output argument and on exit
          returns the block diagonal matrix D and the multipliers used
          to obtain the factor U or L from the factorization
          A = U*D*U**T or A = L*D*L**T.
[in]LDAF
          LDAF is INTEGER
          The leading dimension of the array AF.  LDAF >= max(1,N).
[in,out]IPIV
          IPIV is INTEGER array, dimension (N)
          If FACT = 'F', then IPIV is an input argument and on entry
          contains details of the interchanges and the block structure
          of D, as determined by ZSYTRF.
          If IPIV(k) > 0, then rows and columns k and IPIV(k) were
          interchanged and D(k,k) is a 1-by-1 diagonal block.
          If UPLO = 'U' and IPIV(k) = IPIV(k-1) < 0, then rows and
          columns k-1 and -IPIV(k) were interchanged and D(k-1:k,k-1:k)
          is a 2-by-2 diagonal block.  If UPLO = 'L' and IPIV(k) =
          IPIV(k+1) < 0, then rows and columns k+1 and -IPIV(k) were
          interchanged and D(k:k+1,k:k+1) is a 2-by-2 diagonal block.

          If FACT = 'N', then IPIV is an output argument and on exit
          contains details of the interchanges and the block structure
          of D, as determined by ZSYTRF.
[in]B
          B is COMPLEX*16 array, dimension (LDB,NRHS)
          The N-by-NRHS right hand side matrix B.
[in]LDB
          LDB is INTEGER
          The leading dimension of the array B.  LDB >= max(1,N).
[out]X
          X is COMPLEX*16 array, dimension (LDX,NRHS)
          If INFO = 0 or INFO = N+1, the N-by-NRHS solution matrix X.
[in]LDX
          LDX is INTEGER
          The leading dimension of the array X.  LDX >= max(1,N).
[out]RCOND
          RCOND is DOUBLE PRECISION
          The estimate of the reciprocal condition number of the matrix
          A.  If RCOND is less than the machine precision (in
          particular, if RCOND = 0), the matrix is singular to working
          precision.  This condition is indicated by a return code of
          INFO > 0.
[out]FERR
          FERR is DOUBLE PRECISION array, dimension (NRHS)
          The estimated forward error bound for each solution vector
          X(j) (the j-th column of the solution matrix X).
          If XTRUE is the true solution corresponding to X(j), FERR(j)
          is an estimated upper bound for the magnitude of the largest
          element in (X(j) - XTRUE) divided by the magnitude of the
          largest element in X(j).  The estimate is as reliable as
          the estimate for RCOND, and is almost always a slight
          overestimate of the true error.
[out]BERR
          BERR is DOUBLE PRECISION array, dimension (NRHS)
          The componentwise relative backward error of each solution
          vector X(j) (i.e., the smallest relative change in
          any element of A or B that makes X(j) an exact solution).
[out]WORK
          WORK is COMPLEX*16 array, dimension (MAX(1,LWORK))
          On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
[in]LWORK
          LWORK is INTEGER
          The length of WORK.  LWORK >= max(1,2*N), and for best
          performance, when FACT = 'N', LWORK >= max(1,2*N,N*NB), where
          NB is the optimal blocksize for ZSYTRF.

          If LWORK = -1, then a workspace query is assumed; the routine
          only calculates the optimal size of the WORK array, returns
          this value as the first entry of the WORK array, and no error
          message related to LWORK is issued by XERBLA.
[out]RWORK
          RWORK is DOUBLE PRECISION array, dimension (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, and i is
                <= N:  D(i,i) is exactly zero.  The factorization
                       has been completed but the factor D is exactly
                       singular, so the solution and error bounds could
                       not be computed. RCOND = 0 is returned.
                = N+1: D is nonsingular, but RCOND is less than machine
                       precision, meaning that the matrix is singular
                       to working precision.  Nevertheless, the
                       solution and error bounds are computed because
                       there are a number of situations where the
                       computed solution can be more accurate than the
                       value of RCOND would suggest.
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Date
April 2012

Definition at line 287 of file zsysvx.f.

287 *
288 * -- LAPACK driver routine (version 3.4.1) --
289 * -- LAPACK is a software package provided by Univ. of Tennessee, --
290 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
291 * April 2012
292 *
293 * .. Scalar Arguments ..
294  CHARACTER fact, uplo
295  INTEGER info, lda, ldaf, ldb, ldx, lwork, n, nrhs
296  DOUBLE PRECISION rcond
297 * ..
298 * .. Array Arguments ..
299  INTEGER ipiv( * )
300  DOUBLE PRECISION berr( * ), ferr( * ), rwork( * )
301  COMPLEX*16 a( lda, * ), af( ldaf, * ), b( ldb, * ),
302  $ work( * ), x( ldx, * )
303 * ..
304 *
305 * =====================================================================
306 *
307 * .. Parameters ..
308  DOUBLE PRECISION zero
309  parameter( zero = 0.0d+0 )
310 * ..
311 * .. Local Scalars ..
312  LOGICAL lquery, nofact
313  INTEGER lwkopt, nb
314  DOUBLE PRECISION anorm
315 * ..
316 * .. External Functions ..
317  LOGICAL lsame
318  INTEGER ilaenv
319  DOUBLE PRECISION dlamch, zlansy
320  EXTERNAL lsame, ilaenv, dlamch, zlansy
321 * ..
322 * .. External Subroutines ..
323  EXTERNAL xerbla, zlacpy, zsycon, zsyrfs, zsytrf, zsytrs
324 * ..
325 * .. Intrinsic Functions ..
326  INTRINSIC max
327 * ..
328 * .. Executable Statements ..
329 *
330 * Test the input parameters.
331 *
332  info = 0
333  nofact = lsame( fact, 'N' )
334  lquery = ( lwork.EQ.-1 )
335  IF( .NOT.nofact .AND. .NOT.lsame( fact, 'F' ) ) THEN
336  info = -1
337  ELSE IF( .NOT.lsame( uplo, 'U' ) .AND. .NOT.lsame( uplo, 'L' ) )
338  $ THEN
339  info = -2
340  ELSE IF( n.LT.0 ) THEN
341  info = -3
342  ELSE IF( nrhs.LT.0 ) THEN
343  info = -4
344  ELSE IF( lda.LT.max( 1, n ) ) THEN
345  info = -6
346  ELSE IF( ldaf.LT.max( 1, n ) ) THEN
347  info = -8
348  ELSE IF( ldb.LT.max( 1, n ) ) THEN
349  info = -11
350  ELSE IF( ldx.LT.max( 1, n ) ) THEN
351  info = -13
352  ELSE IF( lwork.LT.max( 1, 2*n ) .AND. .NOT.lquery ) THEN
353  info = -18
354  END IF
355 *
356  IF( info.EQ.0 ) THEN
357  lwkopt = max( 1, 2*n )
358  IF( nofact ) THEN
359  nb = ilaenv( 1, 'ZSYTRF', uplo, n, -1, -1, -1 )
360  lwkopt = max( lwkopt, n*nb )
361  END IF
362  work( 1 ) = lwkopt
363  END IF
364 *
365  IF( info.NE.0 ) THEN
366  CALL xerbla( 'ZSYSVX', -info )
367  RETURN
368  ELSE IF( lquery ) THEN
369  RETURN
370  END IF
371 *
372  IF( nofact ) THEN
373 *
374 * Compute the factorization A = U*D*U**T or A = L*D*L**T.
375 *
376  CALL zlacpy( uplo, n, n, a, lda, af, ldaf )
377  CALL zsytrf( uplo, n, af, ldaf, ipiv, work, lwork, info )
378 *
379 * Return if INFO is non-zero.
380 *
381  IF( info.GT.0 )THEN
382  rcond = zero
383  RETURN
384  END IF
385  END IF
386 *
387 * Compute the norm of the matrix A.
388 *
389  anorm = zlansy( 'I', uplo, n, a, lda, rwork )
390 *
391 * Compute the reciprocal of the condition number of A.
392 *
393  CALL zsycon( uplo, n, af, ldaf, ipiv, anorm, rcond, work, info )
394 *
395 * Compute the solution vectors X.
396 *
397  CALL zlacpy( 'Full', n, nrhs, b, ldb, x, ldx )
398  CALL zsytrs( uplo, n, nrhs, af, ldaf, ipiv, x, ldx, info )
399 *
400 * Use iterative refinement to improve the computed solutions and
401 * compute error bounds and backward error estimates for them.
402 *
403  CALL zsyrfs( uplo, n, nrhs, a, lda, af, ldaf, ipiv, b, ldb, x,
404  $ ldx, ferr, berr, work, rwork, info )
405 *
406 * Set INFO = N+1 if the matrix is singular to working precision.
407 *
408  IF( rcond.LT.dlamch( 'Epsilon' ) )
409  $ info = n + 1
410 *
411  work( 1 ) = lwkopt
412 *
413  RETURN
414 *
415 * End of ZSYSVX
416 *
double precision function zlansy(NORM, UPLO, N, A, LDA, WORK)
ZLANSY returns the value of the 1-norm, or the Frobenius norm, or the infinity norm, or the element of largest absolute value of a complex symmetric matrix.
Definition: zlansy.f:125
subroutine zlacpy(UPLO, M, N, A, LDA, B, LDB)
ZLACPY copies all or part of one two-dimensional array to another.
Definition: zlacpy.f:105
subroutine xerbla(SRNAME, INFO)
XERBLA
Definition: xerbla.f:62
subroutine zsytrf(UPLO, N, A, LDA, IPIV, WORK, LWORK, INFO)
ZSYTRF
Definition: zsytrf.f:184
double precision function dlamch(CMACH)
DLAMCH
Definition: dlamch.f:65
logical function lsame(CA, CB)
LSAME
Definition: lsame.f:55
subroutine zsytrs(UPLO, N, NRHS, A, LDA, IPIV, B, LDB, INFO)
ZSYTRS
Definition: zsytrs.f:122
subroutine zsycon(UPLO, N, A, LDA, IPIV, ANORM, RCOND, WORK, INFO)
ZSYCON
Definition: zsycon.f:127
integer function ilaenv(ISPEC, NAME, OPTS, N1, N2, N3, N4)
Definition: tstiee.f:83
subroutine zsyrfs(UPLO, N, NRHS, A, LDA, AF, LDAF, IPIV, B, LDB, X, LDX, FERR, BERR, WORK, RWORK, INFO)
ZSYRFS
Definition: zsyrfs.f:194

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine zsysvxx ( character  FACT,
character  UPLO,
integer  N,
integer  NRHS,
complex*16, dimension( lda, * )  A,
integer  LDA,
complex*16, dimension( ldaf, * )  AF,
integer  LDAF,
integer, dimension( * )  IPIV,
character  EQUED,
double precision, dimension( * )  S,
complex*16, dimension( ldb, * )  B,
integer  LDB,
complex*16, dimension( ldx, * )  X,
integer  LDX,
double precision  RCOND,
double precision  RPVGRW,
double precision, dimension( * )  BERR,
integer  N_ERR_BNDS,
double precision, dimension( nrhs, * )  ERR_BNDS_NORM,
double precision, dimension( nrhs, * )  ERR_BNDS_COMP,
integer  NPARAMS,
double precision, dimension( * )  PARAMS,
complex*16, dimension( * )  WORK,
double precision, dimension( * )  RWORK,
integer  INFO 
)

ZSYSVXX computes the solution to system of linear equations A * X = B for SY matrices

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

Purpose:
    ZSYSVXX uses the diagonal pivoting factorization to compute the
    solution to a complex*16 system of linear equations A * X = B, where
    A is an N-by-N symmetric matrix and X and B are N-by-NRHS
    matrices.

    If requested, both normwise and maximum componentwise error bounds
    are returned. ZSYSVXX will return a solution with a tiny
    guaranteed error (O(eps) where eps is the working machine
    precision) unless the matrix is very ill-conditioned, in which
    case a warning is returned. Relevant condition numbers also are
    calculated and returned.

    ZSYSVXX accepts user-provided factorizations and equilibration
    factors; see the definitions of the FACT and EQUED options.
    Solving with refinement and using a factorization from a previous
    ZSYSVXX call will also produce a solution with either O(eps)
    errors or warnings, but we cannot make that claim for general
    user-provided factorizations and equilibration factors if they
    differ from what ZSYSVXX would itself produce.
Description:
    The following steps are performed:

    1. If FACT = 'E', double precision scaling factors are computed to equilibrate
    the system:

      diag(S)*A*diag(S)     *inv(diag(S))*X = diag(S)*B

    Whether or not the system will be equilibrated depends on the
    scaling of the matrix A, but if equilibration is used, A is
    overwritten by diag(S)*A*diag(S) and B by diag(S)*B.

    2. If FACT = 'N' or 'E', the LU decomposition is used to factor
    the matrix A (after equilibration if FACT = 'E') as

       A = U * D * U**T,  if UPLO = 'U', or
       A = L * D * L**T,  if UPLO = 'L',

    where U (or L) is a product of permutation and unit upper (lower)
    triangular matrices, and D is symmetric and block diagonal with
    1-by-1 and 2-by-2 diagonal blocks.

    3. If some D(i,i)=0, so that D is exactly singular, then the
    routine returns with INFO = i. Otherwise, the factored form of A
    is used to estimate the condition number of the matrix A (see
    argument RCOND).  If the reciprocal of the condition number is
    less than machine precision, the routine still goes on to solve
    for X and compute error bounds as described below.

    4. The system of equations is solved for X using the factored form
    of A.

    5. By default (unless PARAMS(LA_LINRX_ITREF_I) is set to zero),
    the routine will use iterative refinement to try to get a small
    error and error bounds.  Refinement calculates the residual to at
    least twice the working precision.

    6. If equilibration was used, the matrix X is premultiplied by
    diag(R) so that it solves the original system before
    equilibration.
     Some optional parameters are bundled in the PARAMS array.  These
     settings determine how refinement is performed, but often the
     defaults are acceptable.  If the defaults are acceptable, users
     can pass NPARAMS = 0 which prevents the source code from accessing
     the PARAMS argument.
Parameters
[in]FACT
          FACT is CHARACTER*1
     Specifies whether or not the factored form of the matrix A is
     supplied on entry, and if not, whether the matrix A should be
     equilibrated before it is factored.
       = 'F':  On entry, AF and IPIV contain the factored form of A.
               If EQUED is not 'N', the matrix A has been
               equilibrated with scaling factors given by S.
               A, AF, and IPIV are not modified.
       = 'N':  The matrix A will be copied to AF and factored.
       = 'E':  The matrix A will be equilibrated if necessary, then
               copied to AF and factored.
[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 number of linear equations, i.e., 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 matrices B and X.  NRHS >= 0.
[in,out]A
          A is COMPLEX*16 array, dimension (LDA,N)
     The symmetric matrix A.  If UPLO = 'U', the leading N-by-N
     upper triangular part of A contains the upper triangular
     part of the matrix A, and the strictly lower triangular
     part of A is not referenced.  If UPLO = 'L', the leading
     N-by-N lower triangular part of A contains the lower
     triangular part of the matrix A, and the strictly upper
     triangular part of A is not referenced.

     On exit, if FACT = 'E' and EQUED = 'Y', A is overwritten by
     diag(S)*A*diag(S).
[in]LDA
          LDA is INTEGER
     The leading dimension of the array A.  LDA >= max(1,N).
[in,out]AF
          AF is COMPLEX*16 array, dimension (LDAF,N)
     If FACT = 'F', then AF is an input argument and on entry
     contains the block diagonal matrix D and the multipliers
     used to obtain the factor U or L from the factorization A =
     U*D*U**T or A = L*D*L**T as computed by DSYTRF.

     If FACT = 'N', then AF is an output argument and on exit
     returns the block diagonal matrix D and the multipliers
     used to obtain the factor U or L from the factorization A =
     U*D*U**T or A = L*D*L**T.
[in]LDAF
          LDAF is INTEGER
     The leading dimension of the array AF.  LDAF >= max(1,N).
[in,out]IPIV
          IPIV is INTEGER array, dimension (N)
     If FACT = 'F', then IPIV is an input argument and on entry
     contains details of the interchanges and the block
     structure of D, as determined by DSYTRF.  If IPIV(k) > 0,
     then rows and columns k and IPIV(k) were interchanged and
     D(k,k) is a 1-by-1 diagonal block.  If UPLO = 'U' and
     IPIV(k) = IPIV(k-1) < 0, then rows and columns k-1 and
     -IPIV(k) were interchanged and D(k-1:k,k-1:k) is a 2-by-2
     diagonal block.  If UPLO = 'L' and IPIV(k) = IPIV(k+1) < 0,
     then rows and columns k+1 and -IPIV(k) were interchanged
     and D(k:k+1,k:k+1) is a 2-by-2 diagonal block.

     If FACT = 'N', then IPIV is an output argument and on exit
     contains details of the interchanges and the block
     structure of D, as determined by DSYTRF.
[in,out]EQUED
          EQUED is CHARACTER*1
     Specifies the form of equilibration that was done.
       = 'N':  No equilibration (always true if FACT = 'N').
       = 'Y':  Both row and column equilibration, i.e., A has been
               replaced by diag(S) * A * diag(S).
     EQUED is an input argument if FACT = 'F'; otherwise, it is an
     output argument.
[in,out]S
          S is DOUBLE PRECISION array, dimension (N)
     The scale factors for A.  If EQUED = 'Y', A is multiplied on
     the left and right by diag(S).  S is an input argument if FACT =
     'F'; otherwise, S is an output argument.  If FACT = 'F' and EQUED
     = 'Y', each element of S must be positive.  If S is output, each
     element of S is a power of the radix. If S is input, each element
     of S should be a power of the radix to ensure a reliable solution
     and error estimates. Scaling by powers of the radix does not cause
     rounding errors unless the result underflows or overflows.
     Rounding errors during scaling lead to refining with a matrix that
     is not equivalent to the input matrix, producing error estimates
     that may not be reliable.
[in,out]B
          B is COMPLEX*16 array, dimension (LDB,NRHS)
     On entry, the N-by-NRHS right hand side matrix B.
     On exit,
     if EQUED = 'N', B is not modified;
     if EQUED = 'Y', B is overwritten by diag(S)*B;
[in]LDB
          LDB is INTEGER
     The leading dimension of the array B.  LDB >= max(1,N).
[out]X
          X is COMPLEX*16 array, dimension (LDX,NRHS)
     If INFO = 0, the N-by-NRHS solution matrix X to the original
     system of equations.  Note that A and B are modified on exit if
     EQUED .ne. 'N', and the solution to the equilibrated system is
     inv(diag(S))*X.
[in]LDX
          LDX is INTEGER
     The leading dimension of the array X.  LDX >= max(1,N).
[out]RCOND
          RCOND is DOUBLE PRECISION
     Reciprocal scaled condition number.  This is an estimate of the
     reciprocal Skeel condition number of the matrix A after
     equilibration (if done).  If this is less than the machine
     precision (in particular, if it is zero), the matrix is singular
     to working precision.  Note that the error may still be small even
     if this number is very small and the matrix appears ill-
     conditioned.
[out]RPVGRW
          RPVGRW is DOUBLE PRECISION
     Reciprocal pivot growth.  On exit, this contains the reciprocal
     pivot growth factor norm(A)/norm(U). The "max absolute element"
     norm is used.  If this is much less than 1, then the stability of
     the LU factorization of the (equilibrated) matrix A could be poor.
     This also means that the solution X, estimated condition numbers,
     and error bounds could be unreliable. If factorization fails with
     0<INFO<=N, then this contains the reciprocal pivot growth factor
     for the leading INFO columns of A.
[out]BERR
          BERR is DOUBLE PRECISION array, dimension (NRHS)
     Componentwise relative backward error.  This is the
     componentwise relative backward error of each solution vector X(j)
     (i.e., the smallest relative change in any element of A or B that
     makes X(j) an exact solution).
[in]N_ERR_BNDS
          N_ERR_BNDS is INTEGER
     Number of error bounds to return for each right hand side
     and each type (normwise or componentwise).  See ERR_BNDS_NORM and
     ERR_BNDS_COMP below.
[out]ERR_BNDS_NORM
          ERR_BNDS_NORM is DOUBLE PRECISION array, dimension (NRHS, N_ERR_BNDS)
     For each right-hand side, this array contains information about
     various error bounds and condition numbers corresponding to the
     normwise relative error, which is defined as follows:

     Normwise relative error in the ith solution vector:
             max_j (abs(XTRUE(j,i) - X(j,i)))
            ------------------------------
                  max_j abs(X(j,i))

     The array is indexed by the type of error information as described
     below. There currently are up to three pieces of information
     returned.

     The first index in ERR_BNDS_NORM(i,:) corresponds to the ith
     right-hand side.

     The second index in ERR_BNDS_NORM(:,err) contains the following
     three fields:
     err = 1 "Trust/don't trust" boolean. Trust the answer if the
              reciprocal condition number is less than the threshold
              sqrt(n) * dlamch('Epsilon').

     err = 2 "Guaranteed" error bound: The estimated forward error,
              almost certainly within a factor of 10 of the true error
              so long as the next entry is greater than the threshold
              sqrt(n) * dlamch('Epsilon'). This error bound should only
              be trusted if the previous boolean is true.

     err = 3  Reciprocal condition number: Estimated normwise
              reciprocal condition number.  Compared with the threshold
              sqrt(n) * dlamch('Epsilon') to determine if the error
              estimate is "guaranteed". These reciprocal condition
              numbers are 1 / (norm(Z^{-1},inf) * norm(Z,inf)) for some
              appropriately scaled matrix Z.
              Let Z = S*A, where S scales each row by a power of the
              radix so all absolute row sums of Z are approximately 1.

     See Lapack Working Note 165 for further details and extra
     cautions.
[out]ERR_BNDS_COMP
          ERR_BNDS_COMP is DOUBLE PRECISION array, dimension (NRHS, N_ERR_BNDS)
     For each right-hand side, this array contains information about
     various error bounds and condition numbers corresponding to the
     componentwise relative error, which is defined as follows:

     Componentwise relative error in the ith solution vector:
                    abs(XTRUE(j,i) - X(j,i))
             max_j ----------------------
                         abs(X(j,i))

     The array is indexed by the right-hand side i (on which the
     componentwise relative error depends), and the type of error
     information as described below. There currently are up to three
     pieces of information returned for each right-hand side. If
     componentwise accuracy is not requested (PARAMS(3) = 0.0), then
     ERR_BNDS_COMP is not accessed.  If N_ERR_BNDS .LT. 3, then at most
     the first (:,N_ERR_BNDS) entries are returned.

     The first index in ERR_BNDS_COMP(i,:) corresponds to the ith
     right-hand side.

     The second index in ERR_BNDS_COMP(:,err) contains the following
     three fields:
     err = 1 "Trust/don't trust" boolean. Trust the answer if the
              reciprocal condition number is less than the threshold
              sqrt(n) * dlamch('Epsilon').

     err = 2 "Guaranteed" error bound: The estimated forward error,
              almost certainly within a factor of 10 of the true error
              so long as the next entry is greater than the threshold
              sqrt(n) * dlamch('Epsilon'). This error bound should only
              be trusted if the previous boolean is true.

     err = 3  Reciprocal condition number: Estimated componentwise
              reciprocal condition number.  Compared with the threshold
              sqrt(n) * dlamch('Epsilon') to determine if the error
              estimate is "guaranteed". These reciprocal condition
              numbers are 1 / (norm(Z^{-1},inf) * norm(Z,inf)) for some
              appropriately scaled matrix Z.
              Let Z = S*(A*diag(x)), where x is the solution for the
              current right-hand side and S scales each row of
              A*diag(x) by a power of the radix so all absolute row
              sums of Z are approximately 1.

     See Lapack Working Note 165 for further details and extra
     cautions.
[in]NPARAMS
          NPARAMS is INTEGER
     Specifies the number of parameters set in PARAMS.  If .LE. 0, the
     PARAMS array is never referenced and default values are used.
[in,out]PARAMS
          PARAMS is DOUBLE PRECISION array, dimension NPARAMS
     Specifies algorithm parameters.  If an entry is .LT. 0.0, then
     that entry will be filled with default value used for that
     parameter.  Only positions up to NPARAMS are accessed; defaults
     are used for higher-numbered parameters.

       PARAMS(LA_LINRX_ITREF_I = 1) : Whether to perform iterative
            refinement or not.
         Default: 1.0D+0
            = 0.0 : No refinement is performed, and no error bounds are
                    computed.
            = 1.0 : Use the extra-precise refinement algorithm.
              (other values are reserved for future use)

       PARAMS(LA_LINRX_ITHRESH_I = 2) : Maximum number of residual
            computations allowed for refinement.
         Default: 10
         Aggressive: Set to 100 to permit convergence using approximate
                     factorizations or factorizations other than LU. If
                     the factorization uses a technique other than
                     Gaussian elimination, the guarantees in
                     err_bnds_norm and err_bnds_comp may no longer be
                     trustworthy.

       PARAMS(LA_LINRX_CWISE_I = 3) : Flag determining if the code
            will attempt to find a solution with small componentwise
            relative error in the double-precision algorithm.  Positive
            is true, 0.0 is false.
         Default: 1.0 (attempt componentwise convergence)
[out]WORK
          WORK is COMPLEX*16 array, dimension (2*N)
[out]RWORK
          RWORK is DOUBLE PRECISION array, dimension (2*N)
[out]INFO
          INFO is INTEGER
       = 0:  Successful exit. The solution to every right-hand side is
         guaranteed.
       < 0:  If INFO = -i, the i-th argument had an illegal value
       > 0 and <= N:  U(INFO,INFO) is exactly zero.  The factorization
         has been completed, but the factor U is exactly singular, so
         the solution and error bounds could not be computed. RCOND = 0
         is returned.
       = N+J: The solution corresponding to the Jth right-hand side is
         not guaranteed. The solutions corresponding to other right-
         hand sides K with K > J may not be guaranteed as well, but
         only the first such right-hand side is reported. If a small
         componentwise error is not requested (PARAMS(3) = 0.0) then
         the Jth right-hand side is the first with a normwise error
         bound that is not guaranteed (the smallest J such
         that ERR_BNDS_NORM(J,1) = 0.0). By default (PARAMS(3) = 1.0)
         the Jth right-hand side is the first with either a normwise or
         componentwise error bound that is not guaranteed (the smallest
         J such that either ERR_BNDS_NORM(J,1) = 0.0 or
         ERR_BNDS_COMP(J,1) = 0.0). See the definition of
         ERR_BNDS_NORM(:,1) and ERR_BNDS_COMP(:,1). To get information
         about all of the right-hand sides check ERR_BNDS_NORM or
         ERR_BNDS_COMP.
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Date
April 2012

Definition at line 508 of file zsysvxx.f.

508 *
509 * -- LAPACK driver routine (version 3.6.0) --
510 * -- LAPACK is a software package provided by Univ. of Tennessee, --
511 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
512 * April 2012
513 *
514 * .. Scalar Arguments ..
515  CHARACTER equed, fact, uplo
516  INTEGER info, lda, ldaf, ldb, ldx, n, nrhs, nparams,
517  $ n_err_bnds
518  DOUBLE PRECISION rcond, rpvgrw
519 * ..
520 * .. Array Arguments ..
521  INTEGER ipiv( * )
522  COMPLEX*16 a( lda, * ), af( ldaf, * ), b( ldb, * ),
523  $ x( ldx, * ), work( * )
524  DOUBLE PRECISION s( * ), params( * ), berr( * ),
525  $ err_bnds_norm( nrhs, * ),
526  $ err_bnds_comp( nrhs, * ), rwork( * )
527 * ..
528 *
529 * ==================================================================
530 *
531 * .. Parameters ..
532  DOUBLE PRECISION zero, one
533  parameter( zero = 0.0d+0, one = 1.0d+0 )
534  INTEGER final_nrm_err_i, final_cmp_err_i, berr_i
535  INTEGER rcond_i, nrm_rcond_i, nrm_err_i, cmp_rcond_i
536  INTEGER cmp_err_i, piv_growth_i
537  parameter( final_nrm_err_i = 1, final_cmp_err_i = 2,
538  $ berr_i = 3 )
539  parameter( rcond_i = 4, nrm_rcond_i = 5, nrm_err_i = 6 )
540  parameter( cmp_rcond_i = 7, cmp_err_i = 8,
541  $ piv_growth_i = 9 )
542 * ..
543 * .. Local Scalars ..
544  LOGICAL equil, nofact, rcequ
545  INTEGER infequ, j
546  DOUBLE PRECISION amax, bignum, smin, smax, scond, smlnum
547 * ..
548 * .. External Functions ..
549  EXTERNAL lsame, dlamch, zla_syrpvgrw
550  LOGICAL lsame
551  DOUBLE PRECISION dlamch, zla_syrpvgrw
552 * ..
553 * .. External Subroutines ..
554  EXTERNAL zsycon, zsyequb, zsytrf, zsytrs, zlacpy,
556 * ..
557 * .. Intrinsic Functions ..
558  INTRINSIC max, min
559 * ..
560 * .. Executable Statements ..
561 *
562  info = 0
563  nofact = lsame( fact, 'N' )
564  equil = lsame( fact, 'E' )
565  smlnum = dlamch( 'Safe minimum' )
566  bignum = one / smlnum
567  IF( nofact .OR. equil ) THEN
568  equed = 'N'
569  rcequ = .false.
570  ELSE
571  rcequ = lsame( equed, 'Y' )
572  ENDIF
573 *
574 * Default is failure. If an input parameter is wrong or
575 * factorization fails, make everything look horrible. Only the
576 * pivot growth is set here, the rest is initialized in ZSYRFSX.
577 *
578  rpvgrw = zero
579 *
580 * Test the input parameters. PARAMS is not tested until ZSYRFSX.
581 *
582  IF( .NOT.nofact .AND. .NOT.equil .AND. .NOT.
583  $ lsame( fact, 'F' ) ) THEN
584  info = -1
585  ELSE IF( .NOT.lsame(uplo, 'U') .AND.
586  $ .NOT.lsame(uplo, 'L') ) THEN
587  info = -2
588  ELSE IF( n.LT.0 ) THEN
589  info = -3
590  ELSE IF( nrhs.LT.0 ) THEN
591  info = -4
592  ELSE IF( lda.LT.max( 1, n ) ) THEN
593  info = -6
594  ELSE IF( ldaf.LT.max( 1, n ) ) THEN
595  info = -8
596  ELSE IF( lsame( fact, 'F' ) .AND. .NOT.
597  $ ( rcequ .OR. lsame( equed, 'N' ) ) ) THEN
598  info = -10
599  ELSE
600  IF ( rcequ ) THEN
601  smin = bignum
602  smax = zero
603  DO 10 j = 1, n
604  smin = min( smin, s( j ) )
605  smax = max( smax, s( j ) )
606  10 CONTINUE
607  IF( smin.LE.zero ) THEN
608  info = -11
609  ELSE IF( n.GT.0 ) THEN
610  scond = max( smin, smlnum ) / min( smax, bignum )
611  ELSE
612  scond = one
613  END IF
614  END IF
615  IF( info.EQ.0 ) THEN
616  IF( ldb.LT.max( 1, n ) ) THEN
617  info = -13
618  ELSE IF( ldx.LT.max( 1, n ) ) THEN
619  info = -15
620  END IF
621  END IF
622  END IF
623 *
624  IF( info.NE.0 ) THEN
625  CALL xerbla( 'ZSYSVXX', -info )
626  RETURN
627  END IF
628 *
629  IF( equil ) THEN
630 *
631 * Compute row and column scalings to equilibrate the matrix A.
632 *
633  CALL zsyequb( uplo, n, a, lda, s, scond, amax, work, infequ )
634  IF( infequ.EQ.0 ) THEN
635 *
636 * Equilibrate the matrix.
637 *
638  CALL zlaqsy( uplo, n, a, lda, s, scond, amax, equed )
639  rcequ = lsame( equed, 'Y' )
640  END IF
641 
642  END IF
643 *
644 * Scale the right hand-side.
645 *
646  IF( rcequ ) CALL zlascl2( n, nrhs, s, b, ldb )
647 *
648  IF( nofact .OR. equil ) THEN
649 *
650 * Compute the LDL^T or UDU^T factorization of A.
651 *
652  CALL zlacpy( uplo, n, n, a, lda, af, ldaf )
653  CALL zsytrf( uplo, n, af, ldaf, ipiv, work, 5*max(1,n), info )
654 *
655 * Return if INFO is non-zero.
656 *
657  IF( info.GT.0 ) THEN
658 *
659 * Pivot in column INFO is exactly 0
660 * Compute the reciprocal pivot growth factor of the
661 * leading rank-deficient INFO columns of A.
662 *
663  IF ( n.GT.0 )
664  $ rpvgrw = zla_syrpvgrw( uplo, n, info, a, lda, af,
665  $ ldaf, ipiv, rwork )
666  RETURN
667  END IF
668  END IF
669 *
670 * Compute the reciprocal pivot growth factor RPVGRW.
671 *
672  IF ( n.GT.0 )
673  $ rpvgrw = zla_syrpvgrw( uplo, n, info, a, lda, af, ldaf,
674  $ ipiv, rwork )
675 *
676 * Compute the solution matrix X.
677 *
678  CALL zlacpy( 'Full', n, nrhs, b, ldb, x, ldx )
679  CALL zsytrs( uplo, n, nrhs, af, ldaf, ipiv, x, ldx, info )
680 *
681 * Use iterative refinement to improve the computed solution and
682 * compute error bounds and backward error estimates for it.
683 *
684  CALL zsyrfsx( uplo, equed, n, nrhs, a, lda, af, ldaf, ipiv,
685  $ s, b, ldb, x, ldx, rcond, berr, n_err_bnds, err_bnds_norm,
686  $ err_bnds_comp, nparams, params, work, rwork, info )
687 *
688 * Scale solutions.
689 *
690  IF ( rcequ ) THEN
691  CALL zlascl2 (n, nrhs, s, x, ldx )
692  END IF
693 *
694  RETURN
695 *
696 * End of ZSYSVXX
697 *
subroutine zsyrfsx(UPLO, EQUED, N, NRHS, A, LDA, AF, LDAF, IPIV, S, B, LDB, X, LDX, RCOND, BERR, N_ERR_BNDS, ERR_BNDS_NORM, ERR_BNDS_COMP, NPARAMS, PARAMS, WORK, RWORK, INFO)
ZSYRFSX
Definition: zsyrfsx.f:404
subroutine zlascl2(M, N, D, X, LDX)
ZLASCL2 performs diagonal scaling on a vector.
Definition: zlascl2.f:93
subroutine zlacpy(UPLO, M, N, A, LDA, B, LDB)
ZLACPY copies all or part of one two-dimensional array to another.
Definition: zlacpy.f:105
subroutine xerbla(SRNAME, INFO)
XERBLA
Definition: xerbla.f:62
subroutine zsyequb(UPLO, N, A, LDA, S, SCOND, AMAX, WORK, INFO)
ZSYEQUB
Definition: zsyequb.f:138
subroutine zsytrf(UPLO, N, A, LDA, IPIV, WORK, LWORK, INFO)
ZSYTRF
Definition: zsytrf.f:184
double precision function dlamch(CMACH)
DLAMCH
Definition: dlamch.f:65
logical function lsame(CA, CB)
LSAME
Definition: lsame.f:55
subroutine zlaqsy(UPLO, N, A, LDA, S, SCOND, AMAX, EQUED)
ZLAQSY scales a symmetric/Hermitian matrix, using scaling factors computed by spoequ.
Definition: zlaqsy.f:136
double precision function zla_syrpvgrw(UPLO, N, INFO, A, LDA, AF, LDAF, IPIV, WORK)
ZLA_SYRPVGRW computes the reciprocal pivot growth factor norm(A)/norm(U) for a symmetric indefinite m...
Definition: zla_syrpvgrw.f:125
subroutine zsytrs(UPLO, N, NRHS, A, LDA, IPIV, B, LDB, INFO)
ZSYTRS
Definition: zsytrs.f:122
subroutine zsycon(UPLO, N, A, LDA, IPIV, ANORM, RCOND, WORK, INFO)
ZSYCON
Definition: zsycon.f:127

Here is the call graph for this function:

Here is the caller graph for this function: