sytrf¶
Computes the Bunch-Kaufman factorization of a symmetric matrix.
sytrf supports the following precisions.
T
float
double
std::complex<float>
std::complex<double>
Description
The routine computes the factorization of a real/complex symmetric
matrix A using the Bunch-Kaufman diagonal pivoting method. The
form of the factorization is:
if
upper_lower=uplo::upper,A=U*D*UTif
upper_lower=uplo::lower,A=L*D*LT
where A is the input matrix, U and L are products of
permutation and triangular matrices with unit diagonal (upper
triangular for U and lower triangular for L), and D is a
symmetric block-diagonal matrix with 1-by-1 and 2-by-2 diagonal
blocks. U and L have 2-by-2 unit diagonal blocks
corresponding to the 2-by-2 blocks of D.
sytrf (BUFFER Version)¶
Syntax
-
void
onemkl::lapack::sytrf(cl::sycl::queue &queue, onemkl::uplo upper_lower, std::int64_t n, cl::sycl::buffer<T, 1> &a, std::int64_t lda, cl::sycl::buffer<int_64, 1> &ipiv, cl::sycl::buffer<T, 1> &scratchpad, std::int64_t scratchpad_size)¶
Input Parameters
- queue
The queue where the routine should be executed.
- upper_lower
Indicates whether the upper or lower triangular part of
Ais stored and howAis factored:If
upper_lower=uplo::upper, the buffer a stores the upper triangular part of the matrixA, andAis factored asU*D*UT.If
upper_lower=uplo::lower, the buffer a stores the lower triangular part of the matrixA, andAis factored asL*D*LT.- n
The order of matrix
A(0≤n).- a
The buffer
a, size max(1,lda*n). The bufferacontains either the upper or the lower triangular part of the matrixA(seeupper_lower). The second dimension ofamust be at leastmax(1, n).- lda
The leading dimension of
a.- scratchpad_size
Size of scratchpad memory as a number of floating point elements of type T. Size should not be less than the value returned by sytrf_scratchpad_size function.
Output Parameters
- a
The upper or lower triangular part of a is overwritten by details of the block-diagonal matrix
Dand the multipliers used to obtain the factorU(orL).- ipiv
Buffer, size at least
max(1, n). Contains details of the interchanges and the block structure ofD. Ifipiv(i)=k>0, thendii is a 1-by-1 block, and thei-th row and column ofAwas interchanged with thek-th row and column.If
upper_lower=onemkl::uplo::upperandipiv(i)=ipiv(i-1)=-m<0, thenDhas a 2-by-2 block in rows/columnsiandi-1, and (i-1)-th row and column ofAwas interchanged with them-th row and column.If
upper_lower=onemkl::uplo::lowerandipiv(i)=ipiv(i+1)=-m<0, thenDhas a 2-by-2 block in rows/columnsiandi+1, and (i+1)-th row and column ofAwas interchanged with them-th row and column.- scratchpad
Buffer holding scratchpad memory to be used by routine for storing intermediate results.
Throws
- onemkl::lapack::exception
Exception is thrown in case of problems happened during calculations. The
infocode of the problem can be obtained by get_info() method of exception object:If
info=-i, thei-th parameter had an illegal value.If
info=i,dii is 0. The factorization has been completed, butDis exactly singular. Division by 0 will occur if you useDfor solving a system of linear equations.If
infoequals to value passed as scratchpad size, andget_detail()returns non zero, then passed scratchpad is of insufficient size, and required size should not be less than value return byget_detail()method of exception object.
sytrf (USM Version)¶
Syntax
-
cl::sycl::event
onemkl::lapack::sytrf(cl::sycl::queue &queue, onemkl::uplo upper_lower, std::int64_t n, T *a, std::int64_t lda, int_64 *ipiv, T *scratchpad, std::int64_t scratchpad_size, const cl::sycl::vector_class<cl::sycl::event> &events = {})¶
Input Parameters
- queue
The queue where the routine should be executed.
- upper_lower
Indicates whether the upper or lower triangular part of
Ais stored and howAis factored:If
upper_lower=uplo::upper, the array a stores the upper triangular part of the matrixA, andAis factored asU*D*UT.If
upper_lower=uplo::lower, the array a stores the lower triangular part of the matrixA, andAis factored asL*D*LT.- n
The order of matrix
A(0≤n).- a
The pointer to
A, size max(1,lda*n), containing either the upper or the lower triangular part of the matrixA(seeupper_lower). The second dimension ofamust be at leastmax(1, n).- lda
The leading dimension of
a.- scratchpad_size
Size of scratchpad memory as a number of floating point elements of type T. Size should not be less than the value returned by sytrf_scratchpad_size function.
- events
List of events to wait for before starting computation. Defaults to empty list.
Output Parameters
- a
The upper or lower triangular part of a is overwritten by details of the block-diagonal matrix
Dand the multipliers used to obtain the factorU(orL).- ipiv
Pointer to array of size at least
max(1, n). Contains details of the interchanges and the block structure ofD. Ifipiv(i)=k>0, thendii is a 1-by-1 block, and thei-th row and column ofAwas interchanged with thek-th row and column.If
upper_lower=onemkl::uplo::upperandipiv(i)=ipiv(i-1)=-m<0, thenDhas a 2-by-2 block in rows/columnsiandi-1, and (i-1)-th row and column ofAwas interchanged with them-th row and column.If
upper_lower=onemkl::uplo::lowerandipiv(i)=ipiv(i+1)=-m<0, thenDhas a 2-by-2 block in rows/columnsiandi+1, and (i+1)-th row and column ofAwas interchanged with them-th row and column.- scratchpad
Pointer to scratchpad memory to be used by routine for storing intermediate results.
Throws
- onemkl::lapack::exception
Exception is thrown in case of problems happened during calculations. The
infocode of the problem can be obtained by get_info() method of exception object:If
info=-i, thei-th parameter had an illegal value.If
info=i,dii is 0. The factorization has been completed, butDis exactly singular. Division by 0 will occur if you useDfor solving a system of linear equations.If
infoequals to value passed as scratchpad size, andget_detail()returns non zero, then passed scratchpad is of insufficient size, and required size should not be less than value return byget_detail()method of exception object.
Return Values
Output event to wait on to ensure computation is complete.
Parent topic: LAPACK Linear Equation Routines