lu

Contents

lu#

Perform an LU factorization.

template<typename OpA>
__MATX_INLINE__ auto matx::lu(const OpA &a)#

Performs an LU factorization using partial pivoting with row interchanges. The factorization has the form A = P * L * U.

The input and output tensors may be the same tensor, in which case the input is overwritten.

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 a tensor containing L and U and another containing the pivot indices.

  • Out - A tensor of shape ... x m x n containing both L and U. L can be extracted from the bottom half (the unit diagonals are not stored in Out), and U can be extracted from the top half with the diagonals.

  • Piv - The tensor of pivot indices with shape ... x min(m, n). For \( 0 \leq i < \min(m, n) \), row i was interchanged with row \( Piv(..., i) - 1 \). It must be of type int64_t for cuda matx::lapack_int_t for host.

Examples#

(mtie(Av, PivV) =  lu(Av)).run(this->exec);