Developer Reference for Intel® oneAPI Math Kernel Library for C
?sysvx
Uses the diagonal pivoting factorization to compute the solution to the system of linear equations with a real or complex symmetric coefficient matrix A, and provides error bounds on the solution.
Syntax
lapack_int LAPACKE_ssysvx ( intmatrix_layout , charfact , charuplo , lapack_intn , lapack_intnrhs , const float*a , lapack_intlda , float*af , lapack_intldaf , lapack_int*ipiv , const float*b , lapack_intldb , float*x , lapack_intldx , float*rcond , float*ferr , float*berr );
lapack_int LAPACKE_dsysvx ( intmatrix_layout , charfact , charuplo , lapack_intn , lapack_intnrhs , const double*a , lapack_intlda , double*af , lapack_intldaf , lapack_int*ipiv , const double*b , lapack_intldb , double*x , lapack_intldx , double*rcond , double*ferr , double*berr );
lapack_int LAPACKE_csysvx ( intmatrix_layout , charfact , charuplo , lapack_intn , lapack_intnrhs , const lapack_complex_float*a , lapack_intlda , lapack_complex_float*af , lapack_intldaf , lapack_int*ipiv , const lapack_complex_float*b , lapack_intldb , lapack_complex_float*x , lapack_intldx , float*rcond , float*ferr , float*berr );
lapack_int LAPACKE_zsysvx ( intmatrix_layout , charfact , charuplo , lapack_intn , lapack_intnrhs , const lapack_complex_double*a , lapack_intlda , lapack_complex_double*af , lapack_intldaf , lapack_int*ipiv , const lapack_complex_double*b , lapack_intldb , lapack_complex_double*x , lapack_intldx , double*rcond , double*ferr , double*berr );
Include Files
mkl.h
Description
ssysvx dsysvx csysvx zsysvx sysvx
The routine uses the diagonal pivoting factorization to compute the solution to a real or complex system of linear equations A*X = B , where A is a n -by- n symmetric matrix, the columns of matrix B are individual right-hand sides, and the columns of X are the corresponding solutions.
Error bounds on the solution and a condition estimate are also provided.
The routine ?sysvx performs the following steps:
If fact = 'N' , the diagonal pivoting method is used to factor the matrix A . The form of the factorization is A = U*D*U^{T} or A = L*D*L^{T} , 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.
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.
The system of equations is solved for X using the factored form of A .
Iterative refinement is applied to improve the computed solution matrix and calculate error bounds and backward error estimates for it.
Input Parameters
matrix_layout
Specifies whether matrix storage layout is row major ( LAPACK_ROW_MAJOR ) or column major ( LAPACK_COL_MAJOR ).
fact
Must be ‘F’ or ‘N’ .
Specifies whether or not the factored form of the matrix A has been supplied on entry.
If fact = 'F' : on entry, af and ipiv contain the factored form of A . Arrays a , af , and ipiv will not be modified.
If fact = 'N' , the matrix A will be copied to af and factored.
uplo
Must be ‘U’ or ‘L’ .
Indicates whether the upper or lower triangular part of A is stored:
If uplo = 'U' , the upper triangle of A is stored.
If uplo = 'L' , the lower triangle of A is stored.
n
The order of matrix A ; n ≥ 0.
nrhs
The number of right-hand sides, the number of columns in B; nrhs≥ 0 .
a , af , b , work
Arrays: a (size max(1, lda * n )) , af (size max(1, ldaf * n )) , b of size max(1, ldb * nrhs ) for column major layout and max(1, ldb * n ) for row major layout .
The array a contains the upper or the lower triangular part of the symmetric matrix A (see uplo ).
The array af is an input argument if fact = 'F' . It 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 ?sytrf (Computes the Bunch-Kaufman factorization of a symmetric matrix.) .
The array b contains the matrix B whose columns are the right-hand sides for the systems of equations.
lda
The leading dimension of a ; lda≥ max(1, n) .
ldaf
The leading dimension of af ; ldaf≥ max(1, n) .
ldb
The leading dimension of b ; ldb≥ max(1, n)ldb ≥ max(1, n ) for column major layout and ldb ≥ nrhs for row major layout .
ipiv
Array, size at least max(1, n) . The array ipiv is an input argument if fact = 'F' . It contains details of the interchanges and the block structure of D , as determined by ?sytrf (Computes the Bunch-Kaufman factorization of a symmetric matrix.) .
If ipiv(i) = k > 0ipiv[i-1] = k > 0 , then d_{ii} is a 1-by-1 diagonal block, and the i -th row and column of A was interchanged with the k -th row and column.
If uplo = 'U' and ipiv[i] = ipiv[i-1] = -m < 0 , then D has a 2-by-2 block in rows/columns i and i+1 , and ( i )-th row and column of A was interchanged with the m -th row and column.
If uplo = 'L' and ipiv[i] = ipiv[i-1] = -m < 0 , then D has a 2-by-2 block in rows/columns i and i+1 , and ( i+1 )-th row and column of A was interchanged with the m -th row and column.
ldx
The leading dimension of the output array x ; ldx≥ max(1, n)ldx ≥ max(1, n ) for column major layout and ldx ≥ nrhs for row major layout .
lwork
The size of the work array.
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 . See Application Notes below for details and for the suggested value of lwork .
iwork
Workspace array, size at least max(1, n) ; used in real flavors only.
rwork
Workspace array, size at least max(1, n) ; used in complex flavors only.
Output Parameters
x
Array, size max(1, ldx * nrhs ) for column major layout and max(1, ldx * n ) for row major layout .
If info = 0 or info = n+1 , the array x contains the solution matrix X to the system of equations.
af , ipiv
These arrays are output arguments if fact = 'N' .
See the description of af , ipiv in Input Arguments section.
rcond
An 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.
ferr
Array, size at least max(1, nrhs) . Contains the estimated forward error bound for each solution vector xj (the j -th column of the solution matrix X ). If xtrue is the true solution corresponding to xj , ferr[j-1] is an estimated upper bound for the magnitude of the largest element in ( xj - xtrue ) divided by the magnitude of the largest element in xj . The estimate is as reliable as the estimate for rcond , and is almost always a slight overestimate of the true error.
berr
Array, size at least max(1, nrhs) . Contains the component-wise relative backward error for each solution vector xj , that is, the smallest relative change in any element of A or B that makes xj an exact solution.
work (1)
If info =0, on exit work(1) contains the minimum value of lwork required for optimum performance. Use this lwork for subsequent runs.
Return Values
This function returns a value info .
If info = 0 , the execution is successful.
If info = -i , parameter i had an illegal value.
If info = i , and i≤n , then d_{ii} is exactly zero. The factorization has been completed, but the block diagonal matrix D is exactly singular, so the solution and error bounds could not be computed; rcond = 0 is returned.
If info = i , and i = n + 1, then 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.
LAPACK 95 Interface Notes
There exist FORTRAN 77 and FORTRAN 95 interfaces for this routine. See the Intel® oneMKL Fortran Developer Reference for details.
Application Notes
The value of lwork must be at least max(1,m*n) , where for real flavors m = 3 and for complex flavors m = 2 . For better performance, try using lwork = max(1, m*n, n*blocksize) , where blocksize is the optimal block size for ?sytrf .
If you are in doubt how much workspace to supply, use a generous value of lwork for the first run or set lwork = -1 .
If you choose the first option and set any of admissible lwork sizes, which is no less than the minimal value described, the routine completes the task, though probably not so fast as with a recommended workspace, and provides the recommended workspace in the first element of the corresponding array work on exit. Use this value ( work(1) ) for subsequent runs.
If you set lwork = -1 , the routine returns immediately and provides the recommended workspace in the first element of the corresponding array ( work ). This operation is called a workspace query.
Note that if you set lwork to less than the minimal required value and not -1, the routine returns immediately with an error exit and does not provide any information on the recommended workspace.