Skip to main content

lu_factorize

Function lu_factorize 

Source
pub fn lu_factorize<T: GpuFloat>(
    handle: &mut SolverHandle,
    a: &mut DeviceBuffer<T>,
    n: u32,
    lda: u32,
    pivots: &mut DeviceBuffer<i32>,
) -> SolverResult<LuResult>
Expand description

Performs LU factorization with partial pivoting in-place.

On exit, the lower triangle of a (with implicit unit diagonal) contains L, and the upper triangle contains U. The pivots array records the row permutations: row i was interchanged with row pivots[i].

The matrix is stored in column-major order with leading dimension lda.

§Arguments

  • handle — solver handle.
  • a — matrix buffer (n x n, column-major, lda stride), modified in-place.
  • n — matrix dimension.
  • lda — leading dimension (>= n).
  • pivots — output pivot indices buffer (length >= n).

§Returns

LuResult with info == 0 on success, info > 0 if singular.

§Errors

Returns SolverError if dimensions are invalid or a kernel launch fails.