qr#

Perform a QR decomposition.

template<typename AType>
__MATX_INLINE__ auto matx::qr(const AType &A)#

Perform QR decomposition on a matrix using housholders reflections.

If rank > 2, operations are batched.

Template Parameters:

AType – Tensor or operator type for output of A input tensors.

Parameters:

A – Input tensor or operator for tensor A input.

Returns:

Operator to generate Q/R outputs

Note

This function is currently not supported with host-based executors (CPU)

Examples#

(mtie(Q, R) = qr(A)).run(exec);
template<typename OpA>
__MATX_INLINE__ auto matx::qr_solver(const OpA &a)#

Perform a QR decomposition on a matrix using cuSolver or a LAPACK host library.

If rank > 2, operations are batched.

Template Parameters:

OpA – Data type of input a tensor or operator

Parameters:

a – Input tensor or operator of shape ... x m x n

Returns:

Operator that produces R/householder vectors and tau tensor outputs.

  • Out - Of shape ... x m x n. The householder vectors are returned in the bottom half and R is returned in the top half.

  • Tau - The scalar factors tau of shape ... x min(m, n).

Note

This function does not return Q explicitly as it only runs geqrf from LAPACK/cuSolver. For full Q/R, use qr_solver on a CUDA executor.

Examples#

(mtie(Av, TauV) = qr_solver(Av)).run(this->exec);