Re: New keyword name for linalg.lu

Robert Kern <[email protected]> Mon, 24 Apr 2023 18:43:09 -0400
Newsgroups gmane.comp.python.scientific.devel
Message-ID <CAF6FJitBtxaDDsicmDunsbCOjzjVxSfufF2gJ10=zf-YyXdA5w@mail.gmail.com>
On Mon, Apr 24, 2023 at 3:23 PM Jake Bowhay <[email protected]> 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

_______________________________________________
SciPy-Dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/scipy-dev.python.org/
Member address: [email protected]