On Mon, Apr 24, 2023 at 3:23 PM Jake Bowhay <jb9.bowhay@gmail.com> wrote:
Potentially stupid question but with the new keyword how does this differ from lu_factor?
The primary purpose of `lu_factor` is to provide a packed representation of the decomposition that can be passed essentially opaquely to `lu_solve` so it can do the solve efficiently. While one can disentangle them into their P, L, and U with other functions, `lu_factor` keeps things in exactly the format that LAPACK needs to do `lu_solve` efficiently. Getting the P, L, and U separately is the main purpose of `lu`. Sometimes, you want to do other things with those individually than just do efficient solves. We have the same pattern of division of labor with `cho_factor/cho_solve` and `cholesky`, for example. As for the pivot matrix format, it's usually at least as convenient to have the permutation indices as it is to have the full matrix, so that would still fit within `lu`'s purpose, IMO. -- Robert Kern