OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches

Functions

subroutine dsysv (uplo, n, nrhs, a, lda, ipiv, b, ldb, work, lwork, info)
  DSYSV computes the solution to system of linear equations A * X = B for SY matrices
subroutine dsysv_aa (uplo, n, nrhs, a, lda, ipiv, b, ldb, work, lwork, info)
  DSYSV_AA computes the solution to system of linear equations A * X = B for SY matrices
subroutine dsysv_aa_2stage (uplo, n, nrhs, a, lda, tb, ltb, ipiv, ipiv2, b, ldb, work, lwork, info)
  DSYSV_AA_2STAGE computes the solution to system of linear equations A * X = B for SY matrices
subroutine dsysv_rk (uplo, n, nrhs, a, lda, e, ipiv, b, ldb, work, lwork, info)
  DSYSV_RK computes the solution to system of linear equations A * X = B for SY matrices
subroutine dsysv_rook (uplo, n, nrhs, a, lda, ipiv, b, ldb, work, lwork, info)
  DSYSV_ROOK computes the solution to system of linear equations A * X = B for SY matrices
subroutine dsysvx (fact, uplo, n, nrhs, a, lda, af, ldaf, ipiv, b, ldb, x, ldx, rcond, ferr, berr, work, lwork, iwork, info)
  DSYSVX computes the solution to system of linear equations A * X = B for SY matrices
subroutine dsysvxx (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, iwork, info)
 DSYSVXX

Detailed Description

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

Function Documentation

◆ dsysv()

subroutine dsysv ( character uplo,
integer n,
integer nrhs,
double precision, dimension( lda, * ) a,
integer lda,
integer, dimension( * ) ipiv,
double precision, dimension( ldb, * ) b,
integer ldb,
double precision, dimension( * ) work,
integer lwork,
integer info )

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

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

Purpose:
!>
!> DSYSV computes the solution to a real 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 DOUBLE PRECISION 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
!>          DSYTRF.
!> 
[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 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.
!> 
[in,out]B
!>          B is DOUBLE PRECISION 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 DOUBLE PRECISION 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
!>          DSYTRF.
!>          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.

Definition at line 169 of file dsysv.f.

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

◆ dsysv_aa()

subroutine dsysv_aa ( character uplo,
integer n,
integer nrhs,
double precision, dimension( lda, * ) a,
integer lda,
integer, dimension( * ) ipiv,
double precision, dimension( ldb, * ) b,
integer ldb,
double precision, dimension( * ) work,
integer lwork,
integer info )

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

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

Purpose:
!>
!> DSYSV computes the solution to a real 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.
!>
!> Aasen's algorithm is used to factor A as
!>    A = U**T * T * U,  if UPLO = 'U', or
!>    A = L * T * L**T,  if UPLO = 'L',
!> where U (or L) is a product of permutation and unit upper (lower)
!> triangular matrices, and T is symmetric tridiagonal. 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 DOUBLE PRECISION 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 tridiagonal matrix T and the
!>          multipliers used to obtain the factor U or L from the
!>          factorization A = U**T*T*U or A = L*T*L**T as computed by
!>          DSYTRF.
!> 
[in]LDA
!>          LDA is INTEGER
!>          The leading dimension of the array A.  LDA >= max(1,N).
!> 
[out]IPIV
!>          IPIV is INTEGER array, dimension (N)
!>          On exit, it contains the details of the interchanges, i.e.,
!>          the row and column k of A were interchanged with the
!>          row and column IPIV(k).
!> 
[in,out]B
!>          B is DOUBLE PRECISION 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 DOUBLE PRECISION 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,3*N-2), and for
!>          the best performance, LWORK >= MAX(1,N*NB), where NB is
!>          the optimal blocksize for DSYTRF_AA.
!>
!>          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.

Definition at line 160 of file dsysv_aa.f.

162*
163* -- LAPACK driver routine --
164* -- LAPACK is a software package provided by Univ. of Tennessee, --
165* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
166*
167* .. Scalar Arguments ..
168 CHARACTER UPLO
169 INTEGER INFO, LDA, LDB, LWORK, N, NRHS
170* ..
171* .. Array Arguments ..
172 INTEGER IPIV( * )
173 DOUBLE PRECISION A( LDA, * ), B( LDB, * ), WORK( * )
174* ..
175*
176* =====================================================================
177*
178* .. Local Scalars ..
179 LOGICAL LQUERY
180 INTEGER LWKOPT, LWKOPT_SYTRF, LWKOPT_SYTRS
181* ..
182* .. External Functions ..
183 LOGICAL LSAME
184 INTEGER ILAENV
185 EXTERNAL ilaenv, lsame
186* ..
187* .. External Subroutines ..
188 EXTERNAL xerbla, dsytrf_aa, dsytrs_aa
189* ..
190* .. Intrinsic Functions ..
191 INTRINSIC max
192* ..
193* .. Executable Statements ..
194*
195* Test the input parameters.
196*
197 info = 0
198 lquery = ( lwork.EQ.-1 )
199 IF( .NOT.lsame( uplo, 'U' ) .AND. .NOT.lsame( uplo, 'L' ) ) THEN
200 info = -1
201 ELSE IF( n.LT.0 ) THEN
202 info = -2
203 ELSE IF( nrhs.LT.0 ) THEN
204 info = -3
205 ELSE IF( lda.LT.max( 1, n ) ) THEN
206 info = -5
207 ELSE IF( ldb.LT.max( 1, n ) ) THEN
208 info = -8
209 ELSE IF( lwork.LT.max(2*n, 3*n-2) .AND. .NOT.lquery ) THEN
210 info = -10
211 END IF
212*
213 IF( info.EQ.0 ) THEN
214 CALL dsytrf_aa( uplo, n, a, lda, ipiv, work, -1, info )
215 lwkopt_sytrf = int( work(1) )
216 CALL dsytrs_aa( uplo, n, nrhs, a, lda, ipiv, b, ldb, work,
217 $ -1, info )
218 lwkopt_sytrs = int( work(1) )
219 lwkopt = max( lwkopt_sytrf, lwkopt_sytrs )
220 work( 1 ) = lwkopt
221 END IF
222*
223 IF( info.NE.0 ) THEN
224 CALL xerbla( 'DSYSV_AA ', -info )
225 RETURN
226 ELSE IF( lquery ) THEN
227 RETURN
228 END IF
229*
230* Compute the factorization A = U**T*T*U or A = L*T*L**T.
231*
232 CALL dsytrf_aa( uplo, n, a, lda, ipiv, work, lwork, info )
233 IF( info.EQ.0 ) THEN
234*
235* Solve the system A*X = B, overwriting B with X.
236*
237 CALL dsytrs_aa( uplo, n, nrhs, a, lda, ipiv, b, ldb, work,
238 $ lwork, info )
239*
240 END IF
241*
242 work( 1 ) = lwkopt
243*
244 RETURN
245*
246* End of DSYSV_AA
247*
integer function ilaenv(ispec, name, opts, n1, n2, n3, n4)
ILAENV
Definition ilaenv.f:162
subroutine dsytrs_aa(uplo, n, nrhs, a, lda, ipiv, b, ldb, work, lwork, info)
DSYTRS_AA
Definition dsytrs_aa.f:131
subroutine dsytrf_aa(uplo, n, a, lda, ipiv, work, lwork, info)
DSYTRF_AA
Definition dsytrf_aa.f:132

◆ dsysv_aa_2stage()

subroutine dsysv_aa_2stage ( character uplo,
integer n,
integer nrhs,
double precision, dimension( lda, * ) a,
integer lda,
double precision, dimension( * ) tb,
integer ltb,
integer, dimension( * ) ipiv,
integer, dimension( * ) ipiv2,
double precision, dimension( ldb, * ) b,
integer ldb,
double precision, dimension( * ) work,
integer lwork,
integer info )

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

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

Purpose:
!>
!> DSYSV_AA_2STAGE computes the solution to a real 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.
!>
!> Aasen's 2-stage algorithm is used to factor A as
!>    A = U**T * T * U,  if UPLO = 'U', or
!>    A = L * T * L**T,  if UPLO = 'L',
!> where U (or L) is a product of permutation and unit upper (lower)
!> triangular matrices, and T is symmetric and band. The matrix T is
!> then LU-factored with partial pivoting. The factored form of A
!> is then used to solve the system of equations A * X = B.
!>
!> This is the blocked version of the algorithm, calling Level 3 BLAS.
!> 
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,out]A
!>          A is DOUBLE PRECISION 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, L is stored below (or above) the subdiaonal blocks,
!>          when UPLO  is 'L' (or 'U').
!> 
[in]LDA
!>          LDA is INTEGER
!>          The leading dimension of the array A.  LDA >= max(1,N).
!> 
[out]TB
!>          TB is DOUBLE PRECISION array, dimension (LTB)
!>          On exit, details of the LU factorization of the band matrix.
!> 
[in]LTB
!>          LTB is INTEGER
!>          The size of the array TB. LTB >= 4*N, internally
!>          used to select NB such that LTB >= (3*NB+1)*N.
!>
!>          If LTB = -1, then a workspace query is assumed; the
!>          routine only calculates the optimal size of LTB, 
!>          returns this value as the first entry of TB, and
!>          no error message related to LTB is issued by XERBLA.
!> 
[out]IPIV
!>          IPIV is INTEGER array, dimension (N)
!>          On exit, it contains the details of the interchanges, i.e.,
!>          the row and column k of A were interchanged with the
!>          row and column IPIV(k).
!> 
[out]IPIV2
!>          IPIV2 is INTEGER array, dimension (N)
!>          On exit, it contains the details of the interchanges, i.e.,
!>          the row and column k of T were interchanged with the
!>          row and column IPIV(k).
!> 
[in,out]B
!>          B is DOUBLE PRECISION 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]WORK
!>          WORK is DOUBLE PRECISION workspace of size LWORK
!> 
[in]LWORK
!>          LWORK is INTEGER
!>          The size of WORK. LWORK >= N, internally used to select NB
!>          such that LWORK >= N*NB.
!>
!>          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, band LU factorization failed on i-th column
!> 
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.

Definition at line 185 of file dsysv_aa_2stage.f.

188*
189* -- LAPACK computational routine --
190* -- LAPACK is a software package provided by Univ. of Tennessee, --
191* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
192*
193 IMPLICIT NONE
194*
195* .. Scalar Arguments ..
196 CHARACTER UPLO
197 INTEGER N, NRHS, LDA, LDB, LTB, LWORK, INFO
198* ..
199* .. Array Arguments ..
200 INTEGER IPIV( * ), IPIV2( * )
201 DOUBLE PRECISION A( LDA, * ), B( LDB, * ), TB( * ), WORK( * )
202* ..
203*
204* =====================================================================
205*
206* .. Local Scalars ..
207 LOGICAL UPPER, TQUERY, WQUERY
208 INTEGER LWKOPT
209* ..
210* .. External Functions ..
211 LOGICAL LSAME
212 EXTERNAL lsame
213* ..
214* .. External Subroutines ..
216 $ xerbla
217* ..
218* .. Intrinsic Functions ..
219 INTRINSIC max
220* ..
221* .. Executable Statements ..
222*
223* Test the input parameters.
224*
225 info = 0
226 upper = lsame( uplo, 'U' )
227 wquery = ( lwork.EQ.-1 )
228 tquery = ( ltb.EQ.-1 )
229 IF( .NOT.upper .AND. .NOT.lsame( uplo, 'L' ) ) THEN
230 info = -1
231 ELSE IF( n.LT.0 ) THEN
232 info = -2
233 ELSE IF( nrhs.LT.0 ) THEN
234 info = -3
235 ELSE IF( lda.LT.max( 1, n ) ) THEN
236 info = -5
237 ELSE IF( ltb.LT.( 4*n ) .AND. .NOT.tquery ) THEN
238 info = -7
239 ELSE IF( ldb.LT.max( 1, n ) ) THEN
240 info = -11
241 ELSE IF( lwork.LT.n .AND. .NOT.wquery ) THEN
242 info = -13
243 END IF
244*
245 IF( info.EQ.0 ) THEN
246 CALL dsytrf_aa_2stage( uplo, n, a, lda, tb, -1, ipiv,
247 $ ipiv2, work, -1, info )
248 lwkopt = int( work(1) )
249 END IF
250*
251 IF( info.NE.0 ) THEN
252 CALL xerbla( 'DSYSV_AA_2STAGE', -info )
253 RETURN
254 ELSE IF( wquery .OR. tquery ) THEN
255 RETURN
256 END IF
257*
258*
259* Compute the factorization A = U**T*T*U or A = L*T*L**T.
260*
261 CALL dsytrf_aa_2stage( uplo, n, a, lda, tb, ltb, ipiv, ipiv2,
262 $ work, lwork, info )
263 IF( info.EQ.0 ) THEN
264*
265* Solve the system A*X = B, overwriting B with X.
266*
267 CALL dsytrs_aa_2stage( uplo, n, nrhs, a, lda, tb, ltb, ipiv,
268 $ ipiv2, b, ldb, info )
269*
270 END IF
271*
272 work( 1 ) = lwkopt
273*
274 RETURN
275*
276* End of DSYSV_AA_2STAGE
277*
subroutine dsytrf_aa_2stage(uplo, n, a, lda, tb, ltb, ipiv, ipiv2, work, lwork, info)
DSYTRF_AA_2STAGE
subroutine dsytrs_aa_2stage(uplo, n, nrhs, a, lda, tb, ltb, ipiv, ipiv2, b, ldb, info)
DSYTRS_AA_2STAGE

◆ dsysv_rk()

subroutine dsysv_rk ( character uplo,
integer n,
integer nrhs,
double precision, dimension( lda, * ) a,
integer lda,
double precision, dimension( * ) e,
integer, dimension( * ) ipiv,
double precision, dimension( ldb, * ) b,
integer ldb,
double precision, dimension( * ) work,
integer lwork,
integer info )

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

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

Purpose:
!> DSYSV_RK computes the solution to a real 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 bounded Bunch-Kaufman (rook) diagonal pivoting method is used
!> to factor A as
!>    A = P*U*D*(U**T)*(P**T),  if UPLO = 'U', or
!>    A = P*L*D*(L**T)*(P**T),  if UPLO = 'L',
!> where U (or L) is unit upper (or lower) triangular matrix,
!> U**T (or L**T) is the transpose of U (or L), P is a permutation
!> matrix, P**T is the transpose of P, and D is symmetric and block
!> diagonal with 1-by-1 and 2-by-2 diagonal blocks.
!>
!> DSYTRF_RK is called to compute the factorization of a real
!> symmetric matrix.  The factored form of A is then used to solve
!> the system of equations A * X = B by calling BLAS3 routine DSYTRS_3.
!> 
Parameters
[in]UPLO
!>          UPLO is CHARACTER*1
!>          Specifies whether the upper or lower triangular part of the
!>          symmetric matrix A is stored:
!>          = '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 DOUBLE PRECISION 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, diagonal of the block diagonal
!>          matrix D and factors U or L  as computed by DSYTRF_RK:
!>            a) ONLY diagonal elements of the symmetric block diagonal
!>               matrix D on the diagonal of A, i.e. D(k,k) = A(k,k);
!>               (superdiagonal (or subdiagonal) elements of D
!>                are stored on exit in array E), and
!>            b) If UPLO = 'U': factor U in the superdiagonal part of A.
!>               If UPLO = 'L': factor L in the subdiagonal part of A.
!>
!>          For more info see the description of DSYTRF_RK routine.
!> 
[in]LDA
!>          LDA is INTEGER
!>          The leading dimension of the array A.  LDA >= max(1,N).
!> 
[out]E
!>          E is DOUBLE PRECISION array, dimension (N)
!>          On exit, contains the output computed by the factorization
!>          routine DSYTRF_RK, i.e. the superdiagonal (or subdiagonal)
!>          elements of the symmetric block diagonal matrix D
!>          with 1-by-1 or 2-by-2 diagonal blocks, where
!>          If UPLO = 'U': E(i) = D(i-1,i), i=2:N, E(1) is set to 0;
!>          If UPLO = 'L': E(i) = D(i+1,i), i=1:N-1, E(N) is set to 0.
!>
!>          NOTE: For 1-by-1 diagonal block D(k), where
!>          1 <= k <= N, the element E(k) is set to 0 in both
!>          UPLO = 'U' or UPLO = 'L' cases.
!>
!>          For more info see the description of DSYTRF_RK routine.
!> 
[out]IPIV
!>          IPIV is INTEGER array, dimension (N)
!>          Details of the interchanges and the block structure of D,
!>          as determined by DSYTRF_RK.
!>
!>          For more info see the description of DSYTRF_RK routine.
!> 
[in,out]B
!>          B is DOUBLE PRECISION 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 DOUBLE PRECISION array, dimension ( MAX(1,LWORK) ).
!>          Work array used in the factorization stage.
!>          On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
!> 
[in]LWORK
!>          LWORK is INTEGER
!>          The length of WORK.  LWORK >= 1. For best performance
!>          of factorization stage LWORK >= max(1,N*NB), where NB is
!>          the optimal blocksize for DSYTRF_RK.
!>
!>          If LWORK = -1, then a workspace query is assumed;
!>          the routine only calculates the optimal size of the WORK
!>          array for factorization stage, 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 = -k, the k-th argument had an illegal value
!>
!>          > 0: If INFO = k, the matrix A is singular, because:
!>                 If UPLO = 'U': column k in the upper
!>                 triangular part of A contains all zeros.
!>                 If UPLO = 'L': column k in the lower
!>                 triangular part of A contains all zeros.
!>
!>               Therefore D(k,k) is exactly zero, and superdiagonal
!>               elements of column k of U (or subdiagonal elements of
!>               column k of L ) are all zeros. The factorization has
!>               been completed, but the block diagonal matrix D is
!>               exactly singular, and division by zero will occur if
!>               it is used to solve a system of equations.
!>
!>               NOTE: INFO only stores the first occurrence of
!>               a singularity, any subsequent occurrence of singularity
!>               is not stored in INFO even though the factorization
!>               always completes.
!> 
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Contributors:
!>
!>  December 2016,  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 226 of file dsysv_rk.f.

228*
229* -- LAPACK driver routine --
230* -- LAPACK is a software package provided by Univ. of Tennessee, --
231* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
232*
233* .. Scalar Arguments ..
234 CHARACTER UPLO
235 INTEGER INFO, LDA, LDB, LWORK, N, NRHS
236* ..
237* .. Array Arguments ..
238 INTEGER IPIV( * )
239 DOUBLE PRECISION A( LDA, * ), B( LDB, * ), E( * ), WORK( * )
240* ..
241*
242* =====================================================================
243*
244* .. Local Scalars ..
245 LOGICAL LQUERY
246 INTEGER LWKOPT
247* ..
248* .. External Functions ..
249 LOGICAL LSAME
250 EXTERNAL lsame
251* ..
252* .. External Subroutines ..
253 EXTERNAL xerbla, dsytrf_rk, dsytrs_3
254* ..
255* .. Intrinsic Functions ..
256 INTRINSIC max
257* ..
258* .. Executable Statements ..
259*
260* Test the input parameters.
261*
262 info = 0
263 lquery = ( lwork.EQ.-1 )
264 IF( .NOT.lsame( uplo, 'U' ) .AND. .NOT.lsame( uplo, 'L' ) ) THEN
265 info = -1
266 ELSE IF( n.LT.0 ) THEN
267 info = -2
268 ELSE IF( nrhs.LT.0 ) THEN
269 info = -3
270 ELSE IF( lda.LT.max( 1, n ) ) THEN
271 info = -5
272 ELSE IF( ldb.LT.max( 1, n ) ) THEN
273 info = -9
274 ELSE IF( lwork.LT.1 .AND. .NOT.lquery ) THEN
275 info = -11
276 END IF
277*
278 IF( info.EQ.0 ) THEN
279 IF( n.EQ.0 ) THEN
280 lwkopt = 1
281 ELSE
282 CALL dsytrf_rk( uplo, n, a, lda, e, ipiv, work, -1, info )
283 lwkopt = work(1)
284 END IF
285 work( 1 ) = lwkopt
286 END IF
287*
288 IF( info.NE.0 ) THEN
289 CALL xerbla( 'DSYSV_RK ', -info )
290 RETURN
291 ELSE IF( lquery ) THEN
292 RETURN
293 END IF
294*
295* Compute the factorization A = P*U*D*(U**T)*(P**T) or
296* A = P*U*D*(U**T)*(P**T).
297*
298 CALL dsytrf_rk( uplo, n, a, lda, e, ipiv, work, lwork, info )
299*
300 IF( info.EQ.0 ) THEN
301*
302* Solve the system A*X = B with BLAS3 solver, overwriting B with X.
303*
304 CALL dsytrs_3( uplo, n, nrhs, a, lda, e, ipiv, b, ldb, info )
305*
306 END IF
307*
308 work( 1 ) = lwkopt
309*
310 RETURN
311*
312* End of DSYSV_RK
313*
subroutine dsytrf_rk(uplo, n, a, lda, e, ipiv, work, lwork, info)
DSYTRF_RK computes the factorization of a real symmetric indefinite matrix using the bounded Bunch-Ka...
Definition dsytrf_rk.f:259
subroutine dsytrs_3(uplo, n, nrhs, a, lda, e, ipiv, b, ldb, info)
DSYTRS_3
Definition dsytrs_3.f:165

◆ dsysv_rook()

subroutine dsysv_rook ( character uplo,
integer n,
integer nrhs,
double precision, dimension( lda, * ) a,
integer lda,
integer, dimension( * ) ipiv,
double precision, dimension( ldb, * ) b,
integer ldb,
double precision, dimension( * ) work,
integer lwork,
integer info )

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

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

Purpose:
!>
!> DSYSV_ROOK computes the solution to a real 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.
!>
!> DSYTRF_ROOK is called to compute the factorization of a real
!> symmetric matrix A using the bounded Bunch-Kaufman () diagonal
!> pivoting method.
!>
!> The factored form of A is then used to solve the system
!> of equations A * X = B by calling DSYTRS_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 DOUBLE PRECISION 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
!>          DSYTRF_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 DSYTRF_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 DOUBLE PRECISION 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 DOUBLE PRECISION 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
!>          DSYTRF_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.
Contributors:
!>
!>   April 2012, 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 202 of file dsysv_rook.f.

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

◆ dsysvx()

subroutine dsysvx ( character fact,
character uplo,
integer n,
integer nrhs,
double precision, dimension( lda, * ) a,
integer lda,
double precision, dimension( ldaf, * ) af,
integer ldaf,
integer, dimension( * ) ipiv,
double precision, dimension( ldb, * ) b,
integer ldb,
double precision, dimension( ldx, * ) x,
integer ldx,
double precision rcond,
double precision, dimension( * ) ferr,
double precision, dimension( * ) berr,
double precision, dimension( * ) work,
integer lwork,
integer, dimension( * ) iwork,
integer info )

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

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

Purpose:
!>
!> DSYSVX uses the diagonal pivoting factorization to compute the
!> solution to a real 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.  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 DOUBLE PRECISION 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 DOUBLE PRECISION 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]B
!>          B is DOUBLE PRECISION 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 DOUBLE PRECISION 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 DOUBLE PRECISION 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,3*N), and for best
!>          performance, when FACT = 'N', LWORK >= max(1,3*N,N*NB), where
!>          NB is the optimal blocksize for DSYTRF.
!>
!>          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]IWORK
!>          IWORK is INTEGER 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.

Definition at line 281 of file dsysvx.f.

284*
285* -- LAPACK driver routine --
286* -- LAPACK is a software package provided by Univ. of Tennessee, --
287* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
288*
289* .. Scalar Arguments ..
290 CHARACTER FACT, UPLO
291 INTEGER INFO, LDA, LDAF, LDB, LDX, LWORK, N, NRHS
292 DOUBLE PRECISION RCOND
293* ..
294* .. Array Arguments ..
295 INTEGER IPIV( * ), IWORK( * )
296 DOUBLE PRECISION A( LDA, * ), AF( LDAF, * ), B( LDB, * ),
297 $ BERR( * ), FERR( * ), WORK( * ), X( LDX, * )
298* ..
299*
300* =====================================================================
301*
302* .. Parameters ..
303 DOUBLE PRECISION ZERO
304 parameter( zero = 0.0d+0 )
305* ..
306* .. Local Scalars ..
307 LOGICAL LQUERY, NOFACT
308 INTEGER LWKOPT, NB
309 DOUBLE PRECISION ANORM
310* ..
311* .. External Functions ..
312 LOGICAL LSAME
313 INTEGER ILAENV
314 DOUBLE PRECISION DLAMCH, DLANSY
315 EXTERNAL lsame, ilaenv, dlamch, dlansy
316* ..
317* .. External Subroutines ..
318 EXTERNAL dlacpy, dsycon, dsyrfs, dsytrf, dsytrs, xerbla
319* ..
320* .. Intrinsic Functions ..
321 INTRINSIC max
322* ..
323* .. Executable Statements ..
324*
325* Test the input parameters.
326*
327 info = 0
328 nofact = lsame( fact, 'N' )
329 lquery = ( lwork.EQ.-1 )
330 IF( .NOT.nofact .AND. .NOT.lsame( fact, 'F' ) ) THEN
331 info = -1
332 ELSE IF( .NOT.lsame( uplo, 'U' ) .AND. .NOT.lsame( uplo, 'L' ) )
333 $ THEN
334 info = -2
335 ELSE IF( n.LT.0 ) THEN
336 info = -3
337 ELSE IF( nrhs.LT.0 ) THEN
338 info = -4
339 ELSE IF( lda.LT.max( 1, n ) ) THEN
340 info = -6
341 ELSE IF( ldaf.LT.max( 1, n ) ) THEN
342 info = -8
343 ELSE IF( ldb.LT.max( 1, n ) ) THEN
344 info = -11
345 ELSE IF( ldx.LT.max( 1, n ) ) THEN
346 info = -13
347 ELSE IF( lwork.LT.max( 1, 3*n ) .AND. .NOT.lquery ) THEN
348 info = -18
349 END IF
350*
351 IF( info.EQ.0 ) THEN
352 lwkopt = max( 1, 3*n )
353 IF( nofact ) THEN
354 nb = ilaenv( 1, 'DSYTRF', uplo, n, -1, -1, -1 )
355 lwkopt = max( lwkopt, n*nb )
356 END IF
357 work( 1 ) = lwkopt
358 END IF
359*
360 IF( info.NE.0 ) THEN
361 CALL xerbla( 'DSYSVX', -info )
362 RETURN
363 ELSE IF( lquery ) THEN
364 RETURN
365 END IF
366*
367 IF( nofact ) THEN
368*
369* Compute the factorization A = U*D*U**T or A = L*D*L**T.
370*
371 CALL dlacpy( uplo, n, n, a, lda, af, ldaf )
372 CALL dsytrf( uplo, n, af, ldaf, ipiv, work, lwork, info )
373*
374* Return if INFO is non-zero.
375*
376 IF( info.GT.0 )THEN
377 rcond = zero
378 RETURN
379 END IF
380 END IF
381*
382* Compute the norm of the matrix A.
383*
384 anorm = dlansy( 'I', uplo, n, a, lda, work )
385*
386* Compute the reciprocal of the condition number of A.
387*
388 CALL dsycon( uplo, n, af, ldaf, ipiv, anorm, rcond, work, iwork,
389 $ info )
390*
391* Compute the solution vectors X.
392*
393 CALL dlacpy( 'Full', n, nrhs, b, ldb, x, ldx )
394 CALL dsytrs( uplo, n, nrhs, af, ldaf, ipiv, x, ldx, info )
395*
396* Use iterative refinement to improve the computed solutions and
397* compute error bounds and backward error estimates for them.
398*
399 CALL dsyrfs( uplo, n, nrhs, a, lda, af, ldaf, ipiv, b, ldb, x,
400 $ ldx, ferr, berr, work, iwork, info )
401*
402* Set INFO = N+1 if the matrix is singular to working precision.
403*
404 IF( rcond.LT.dlamch( 'Epsilon' ) )
405 $ info = n + 1
406*
407 work( 1 ) = lwkopt
408*
409 RETURN
410*
411* End of DSYSVX
412*
subroutine dlacpy(uplo, m, n, a, lda, b, ldb)
DLACPY copies all or part of one two-dimensional array to another.
Definition dlacpy.f:103
double precision function dlansy(norm, uplo, n, a, lda, work)
DLANSY returns the value of the 1-norm, or the Frobenius norm, or the infinity norm,...
Definition dlansy.f:122
subroutine dsycon(uplo, n, a, lda, ipiv, anorm, rcond, work, iwork, info)
DSYCON
Definition dsycon.f:130
subroutine dsyrfs(uplo, n, nrhs, a, lda, af, ldaf, ipiv, b, ldb, x, ldx, ferr, berr, work, iwork, info)
DSYRFS
Definition dsyrfs.f:191
double precision function dlamch(cmach)
DLAMCH
Definition dlamch.f:69

◆ dsysvxx()

subroutine dsysvxx ( character fact,
character uplo,
integer n,
integer nrhs,
double precision, dimension( lda, * ) a,
integer lda,
double precision, dimension( ldaf, * ) af,
integer ldaf,
integer, dimension( * ) ipiv,
character equed,
double precision, dimension( * ) s,
double precision, dimension( ldb, * ) b,
integer ldb,
double precision, 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,
double precision, dimension( * ) work,
integer, dimension( * ) iwork,
integer info )

DSYSVXX

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

Purpose:
!>
!>    DSYSVXX uses the diagonal pivoting factorization to compute the
!>    solution to a double precision 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. DSYSVXX 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.
!>
!>    DSYSVXX 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
!>    DSYSVXX 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 DSYSVXX 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 DOUBLE PRECISION 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 DOUBLE PRECISION 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 DOUBLE PRECISION 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 DOUBLE PRECISION 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 
!>     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  boolean. Trust the answer if the
!>              reciprocal condition number is less than the threshold
!>              sqrt(n) * dlamch('Epsilon').
!>
!>     err = 2  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 . 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 < 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  boolean. Trust the answer if the
!>              reciprocal condition number is less than the threshold
!>              sqrt(n) * dlamch('Epsilon').
!>
!>     err = 2  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 . 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 <= 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 < 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 DOUBLE PRECISION array, dimension (4*N)
!> 
[out]IWORK
!>          IWORK is INTEGER array, dimension (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.

Definition at line 501 of file dsysvxx.f.

505*
506* -- LAPACK driver routine --
507* -- LAPACK is a software package provided by Univ. of Tennessee, --
508* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
509*
510* .. Scalar Arguments ..
511 CHARACTER EQUED, FACT, UPLO
512 INTEGER INFO, LDA, LDAF, LDB, LDX, N, NRHS, NPARAMS,
513 $ N_ERR_BNDS
514 DOUBLE PRECISION RCOND, RPVGRW
515* ..
516* .. Array Arguments ..
517 INTEGER IPIV( * ), IWORK( * )
518 DOUBLE PRECISION A( LDA, * ), AF( LDAF, * ), B( LDB, * ),
519 $ X( LDX, * ), WORK( * )
520 DOUBLE PRECISION S( * ), PARAMS( * ), BERR( * ),
521 $ ERR_BNDS_NORM( NRHS, * ),
522 $ ERR_BNDS_COMP( NRHS, * )
523* ..
524*
525* ==================================================================
526*
527* .. Parameters ..
528 DOUBLE PRECISION ZERO, ONE
529 parameter( zero = 0.0d+0, one = 1.0d+0 )
530 INTEGER FINAL_NRM_ERR_I, FINAL_CMP_ERR_I, BERR_I
531 INTEGER RCOND_I, NRM_RCOND_I, NRM_ERR_I, CMP_RCOND_I
532 INTEGER CMP_ERR_I, PIV_GROWTH_I
533 parameter( final_nrm_err_i = 1, final_cmp_err_i = 2,
534 $ berr_i = 3 )
535 parameter( rcond_i = 4, nrm_rcond_i = 5, nrm_err_i = 6 )
536 parameter( cmp_rcond_i = 7, cmp_err_i = 8,
537 $ piv_growth_i = 9 )
538* ..
539* .. Local Scalars ..
540 LOGICAL EQUIL, NOFACT, RCEQU
541 INTEGER INFEQU, J
542 DOUBLE PRECISION AMAX, BIGNUM, SMIN, SMAX, SCOND, SMLNUM
543* ..
544* .. External Functions ..
545 EXTERNAL lsame, dlamch, dla_syrpvgrw
546 LOGICAL LSAME
547 DOUBLE PRECISION DLAMCH, DLA_SYRPVGRW
548* ..
549* .. External Subroutines ..
550 EXTERNAL dsyequb, dsytrf, dsytrs,
552* ..
553* .. Intrinsic Functions ..
554 INTRINSIC max, min
555* ..
556* .. Executable Statements ..
557*
558 info = 0
559 nofact = lsame( fact, 'N' )
560 equil = lsame( fact, 'E' )
561 smlnum = dlamch( 'Safe minimum' )
562 bignum = one / smlnum
563 IF( nofact .OR. equil ) THEN
564 equed = 'N'
565 rcequ = .false.
566 ELSE
567 rcequ = lsame( equed, 'Y' )
568 ENDIF
569*
570* Default is failure. If an input parameter is wrong or
571* factorization fails, make everything look horrible. Only the
572* pivot growth is set here, the rest is initialized in DSYRFSX.
573*
574 rpvgrw = zero
575*
576* Test the input parameters. PARAMS is not tested until DSYRFSX.
577*
578 IF( .NOT.nofact .AND. .NOT.equil .AND. .NOT.
579 $ lsame( fact, 'F' ) ) THEN
580 info = -1
581 ELSE IF( .NOT.lsame(uplo, 'U') .AND.
582 $ .NOT.lsame(uplo, 'L') ) THEN
583 info = -2
584 ELSE IF( n.LT.0 ) THEN
585 info = -3
586 ELSE IF( nrhs.LT.0 ) THEN
587 info = -4
588 ELSE IF( lda.LT.max( 1, n ) ) THEN
589 info = -6
590 ELSE IF( ldaf.LT.max( 1, n ) ) THEN
591 info = -8
592 ELSE IF( lsame( fact, 'F' ) .AND. .NOT.
593 $ ( rcequ .OR. lsame( equed, 'N' ) ) ) THEN
594 info = -10
595 ELSE
596 IF ( rcequ ) THEN
597 smin = bignum
598 smax = zero
599 DO 10 j = 1, n
600 smin = min( smin, s( j ) )
601 smax = max( smax, s( j ) )
602 10 CONTINUE
603 IF( smin.LE.zero ) THEN
604 info = -11
605 ELSE IF( n.GT.0 ) THEN
606 scond = max( smin, smlnum ) / min( smax, bignum )
607 ELSE
608 scond = one
609 END IF
610 END IF
611 IF( info.EQ.0 ) THEN
612 IF( ldb.LT.max( 1, n ) ) THEN
613 info = -13
614 ELSE IF( ldx.LT.max( 1, n ) ) THEN
615 info = -15
616 END IF
617 END IF
618 END IF
619*
620 IF( info.NE.0 ) THEN
621 CALL xerbla( 'DSYSVXX', -info )
622 RETURN
623 END IF
624*
625 IF( equil ) THEN
626*
627* Compute row and column scalings to equilibrate the matrix A.
628*
629 CALL dsyequb( uplo, n, a, lda, s, scond, amax, work, infequ )
630 IF( infequ.EQ.0 ) THEN
631*
632* Equilibrate the matrix.
633*
634 CALL dlaqsy( uplo, n, a, lda, s, scond, amax, equed )
635 rcequ = lsame( equed, 'Y' )
636 END IF
637 END IF
638*
639* Scale the right-hand side.
640*
641 IF( rcequ ) CALL dlascl2( n, nrhs, s, b, ldb )
642*
643 IF( nofact .OR. equil ) THEN
644*
645* Compute the LDL^T or UDU^T factorization of A.
646*
647 CALL dlacpy( uplo, n, n, a, lda, af, ldaf )
648 CALL dsytrf( uplo, n, af, ldaf, ipiv, work, 5*max(1,n), info )
649*
650* Return if INFO is non-zero.
651*
652 IF( info.GT.0 ) THEN
653*
654* Pivot in column INFO is exactly 0
655* Compute the reciprocal pivot growth factor of the
656* leading rank-deficient INFO columns of A.
657*
658 IF ( n.GT.0 )
659 $ rpvgrw = dla_syrpvgrw(uplo, n, info, a, lda, af,
660 $ ldaf, ipiv, work )
661 RETURN
662 END IF
663 END IF
664*
665* Compute the reciprocal pivot growth factor RPVGRW.
666*
667 IF ( n.GT.0 )
668 $ rpvgrw = dla_syrpvgrw( uplo, n, info, a, lda, af, ldaf,
669 $ ipiv, work )
670*
671* Compute the solution matrix X.
672*
673 CALL dlacpy( 'Full', n, nrhs, b, ldb, x, ldx )
674 CALL dsytrs( uplo, n, nrhs, af, ldaf, ipiv, x, ldx, info )
675*
676* Use iterative refinement to improve the computed solution and
677* compute error bounds and backward error estimates for it.
678*
679 CALL dsyrfsx( uplo, equed, n, nrhs, a, lda, af, ldaf, ipiv,
680 $ s, b, ldb, x, ldx, rcond, berr, n_err_bnds, err_bnds_norm,
681 $ err_bnds_comp, nparams, params, work, iwork, info )
682*
683* Scale solutions.
684*
685 IF ( rcequ ) THEN
686 CALL dlascl2 ( n, nrhs, s, x, ldx )
687 END IF
688*
689 RETURN
690*
691* End of DSYSVXX
692*
subroutine dlascl2(m, n, d, x, ldx)
DLASCL2 performs diagonal scaling on a vector.
Definition dlascl2.f:90
subroutine dlaqsy(uplo, n, a, lda, s, scond, amax, equed)
DLAQSY scales a symmetric/Hermitian matrix, using scaling factors computed by spoequ.
Definition dlaqsy.f:133
subroutine dsyrfsx(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, iwork, info)
DSYRFSX
Definition dsyrfsx.f:402
double precision function dla_syrpvgrw(uplo, n, info, a, lda, af, ldaf, ipiv, work)
DLA_SYRPVGRW computes the reciprocal pivot growth factor norm(A)/norm(U) for a symmetric indefinite m...
subroutine dsyequb(uplo, n, a, lda, s, scond, amax, work, info)
DSYEQUB
Definition dsyequb.f:131
#define min(a, b)
Definition macros.h:20