Overloads for scipy.linalg functions #82
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR provides numba overloads for functions in the scipy linalg library, including:
linalg.schur
linalg.qz
linalg.ordqz
linalg.solve_discrete_lyapunov
linalg.solve_continuous_lyapunov
The implementations are modeled on the
numba.np.linalg
implementations, although without special cython wrappers. Instead, i use intrinsics and ctypes as suggested here and here. Functions can be called on all data types supported by LAPACK.It's not completely ready to be merged. For one thing, the overloads from
linalg.overloads
aren't automatically loaded viaimport numba_scipy
. In addition, the function signatures don't exactly match those inscipy.linalg
. Specifically, arguments related to configuring LAPACK functions, such asoverwrite_a
andlwork
inlinalg.schur
, are not supported. Instead, a workspace query is always run in any function that requires a workspace.These functions were admittedly chosen somewhat randomly (based on my personal needs), but it is my hope this PR can serve as a starting point for a conversation about a larger effort to numbfy the
scipy.linalg
package. Notably, #43 and #33 requestlinalg.logm
, which requires schur decomposition, so this PR would be a first step towards meeting those needs. It also suggests an extendable framework that allows more LAPACK wrappers to be easily written and transformed into overloads forlinalg
functions.