code: public static LUDecomposition<FloatMatrix> lu(FloatMatrix A) {
        int[] ipiv = new int[min(A.rows, A.columns)];
        FloatMatrix result = A.dup();
        NativeBlas.sgetrf(A.rows, A.columns, result.data, 0, A.rows, ipiv, 0);
  
        // collect result
        FloatMatrix l = new FloatMatrix(A.rows, min(A.rows, A.columns));
        FloatMatrix u = new FloatMatrix(min(A.columns, A.rows), A.columns);
        decomposeLowerUpper(result, l, u);
        FloatMatrix p = Permutations.permutationFloatMatrixFromPivotIndices(A.rows, ipiv);
        return new LUDecomposition<FloatMatrix>(l, u, p);
    }
docs: Compute LU Decomposition of a general matrix.
  
  Computes the LU decomposition using GETRF. Returns three matrices L, U, P,
  where L is lower diagonal, U is upper diagonal, and P is a permutation
  matrix such that A = P * L * U.
  
  @param A general matrix
  @return An LUDecomposition object.