# hetrf¶

Computes the Bunch-Kaufman factorization of a complex Hermitian matrix.

Description

hetrf supports the following precisions.

T

std::complex<float>

std::complex<double>

The routine computes the factorization of a complex Hermitian matrix $$A$$ using the Bunch-Kaufman diagonal pivoting method. The form of the factorization is:

• if upper_lower=uplo::upper, $$A$$ = $$UDU^{H}$$

• if upper_lower=uplo::lower, $$A$$ = $$LDL^{H}$$

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 Hermitian block-diagonal matrix with $$1 \times 1$$ and $$2 \times 2$$ diagonal blocks. $$U$$ and $$L$$ have $$2 \times 2$$ unit diagonal blocks corresponding to the $$2 \times 2$$ blocks of $$D$$.

## hetrf (Buffer Version)¶

Syntax

namespace oneapi::mkl::lapack {
void hetrf(cl::sycl::queue &queue, oneapi::mkl::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 $$A$$ is stored and how $$A$$ is factored:

If upper_lower=uplo::upper, the buffer a stores the upper triangular part of the matrix $$A$$, and $$A$$ is factored as $$UDU^H$$.

If upper_lower=uplo::lower, the buffer a stores the lower triangular part of the matrix $$A$$, and $$A$$ is factored as $$LDL^H$$.

n

The order of matrix $$A$$ ($$0 \le n$$).

a

The buffer a, size $$\max(1,\text{lda} \cdot n)$$. The buffer a contains either the upper or the lower triangular part of the matrix $$A$$ (see upper_lower). The second dimension of a must be at least $$\max(1, n)$$.

lda

The leading dimension of a.

Buffer holding scratchpad memory to be used by the routine for storing intermediate results.

Size of scratchpad memory as a number of floating point elements of type T. Size should not be less than the value returned by hetrf_scratchpad_size function.

Output Parameters

a

The upper or lower triangular part of a is overwritten by details of the block-diagonal matrix $$D$$ and the multipliers used to obtain the factor $$U$$ (or $$L$$).

ipiv

Buffer, size at least $$\max(1, n)$$. Contains details of the interchanges and the block structure of $$D$$. If $$\text{ipiv}(i)=k>0$$, then $$d_{ii}$$ is a $$1 \times 1$$ block, and the $$i$$-th row and column of $$A$$ was interchanged with the $$k$$-th row and column.

If upper_lower=oneapi::mkl::uplo::upper and $$\text{ipiv}(i)=\text{ipiv}(i-1)=-m<0$$, then $$D$$ has a $$2 \times 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.

If upper_lower=oneapi::mkl::uplo::lower and $$\text{ipiv}(i)=\text{ipiv}(i+1)=-m<0$$, then $$D$$ has a $$2 \times 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.

Throws

This routine shall throw the following exceptions if the associated condition is detected. An implementation may throw additional implementation-specific exception(s) in case of error conditions not covered here.

oneapi::mkl::unimplemented

oneapi::mkl::unsupported_device

oneapi::mkl::lapack::invalid_argument

oneapi::mkl::lapack::computation_error

Exception is thrown in case of problems during calculations. The info code of the problem can be obtained by info() method of exception object:

If info = -i, the $$i$$-th parameter had an illegal value.

If $$\text{info}=i$$, $$d_{ii}$$ is 0. The factorization has been completed, but $$D$$ is exactly singular. Division by 0 will occur if you use $$D$$ for solving a system of linear equations.

If info equals to value passed as scratchpad size, and detail() returns non zero, then passed scratchpad is of insufficient size, and required size should not be less than value return by detail() method of exception object.

## hetrf (USM Version)¶

Syntax

namespace oneapi::mkl::lapack {
cl::sycl::event hetrf(cl::sycl::queue &queue, oneapi::mkl::uplo upper_lower, std::int64_t n, T *a, std::int64_t lda, int_64 *ipiv, T *scratchpad, std::int64_t scratchpad_size, const std::vector<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 $$A$$ is stored and how $$A$$ is factored:

If upper_lower=uplo::upper, the array a stores the upper triangular part of the matrix $$A$$, and $$A$$ is factored as $$UDU^H$$.

If upper_lower=uplo::lower, the array a stores the lower triangular part of the matrix $$A$$, and $$A$$ is factored as $$LDL^H$$.

n

The order of matrix $$A$$ ($$0 \le n$$).

a

The pointer to $$A$$, size $$\max(1,\text{lda} \cdot n)$$, containing either the upper or the lower triangular part of the matrix $$A$$ (see upper_lower). The second dimension of a must be at least $$\max(1, n)$$.

lda

The leading dimension of a.

Pointer to scratchpad memory to be used by the routine for storing intermediate results.

Size of scratchpad memory as a number of floating point elements of type T. Size should not be less than the value returned by hetrf_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 $$D$$ and the multipliers used to obtain the factor $$U$$ (or $$L$$).

ipiv

Pointer to array of size at least $$\max(1, n)$$. Contains details of the interchanges and the block structure of $$D$$. If $$\text{ipiv}(i)=k>0$$, then $$d_{ii}$$ is a $$1 \times 1$$ block, and the $$i$$-th row and column of $$A$$ was interchanged with the $$k$$-th row and column.

If upper_lower=oneapi::mkl::uplo::upper and $$\text{ipiv}(i)=\text{ipiv}(i-1)=-m<0$$, then $$D$$ has a $$2 \times 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.

If upper_lower=oneapi::mkl::uplo::lower and $$\text{ipiv}(i)=\text{ipiv}(i+1)=-m<0$$, then $$D$$ has a $$2 \times 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.

Throws

This routine shall throw the following exceptions if the associated condition is detected. An implementation may throw additional implementation-specific exception(s) in case of error conditions not covered here.

oneapi::mkl::unimplemented

oneapi::mkl::unsupported_device

oneapi::mkl::lapack::invalid_argument

oneapi::mkl::lapack::computation_error

Exception is thrown in case of problems during calculations. The info code of the problem can be obtained by info() method of exception object:

If info = -i, the $$i$$-th parameter had an illegal value.

If $$\text{info}=i$$, $$d_{ii}$$ is 0. The factorization has been completed, but $$D$$ is exactly singular. Division by 0 will occur if you use $$D$$ for solving a system of linear equations.

If info equals to value passed as scratchpad size, and detail() returns non zero, then passed scratchpad is of insufficient size, and required size should not be less than value return by detail() method of exception object.

Return Values

Output event to wait on to ensure computation is complete.

Parent topic: LAPACK Linear Equation Routines