-
Notifications
You must be signed in to change notification settings - Fork 178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
linalg: Matrix Inverse #828
Conversation
As far as this is my first review for |
Great idea @loiseaujc, thanks!
|
From Fortran Monthly call:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @perazz . On overall LGTM. Here are some suggestions.
Co-authored-by: Jeremie Vandenplas <jeremie.vandenplas@gmail.com>
Co-authored-by: Jeremie Vandenplas <jeremie.vandenplas@gmail.com>
Co-authored-by: Jeremie Vandenplas <jeremie.vandenplas@gmail.com>
Co-authored-by: Jeremie Vandenplas <jeremie.vandenplas@gmail.com>
Co-authored-by: Jeremie Vandenplas <jeremie.vandenplas@gmail.com>
Thanks a lot @loiseaujc @jvdp1 @jalvesz for the reviews - I believe I've addressed all your comments (see linked commits in each comment). In d0af9be I've introduced a tiny behavior change: On exceptions raised when the operator interface (
So please do let me know if you also like this update. |
Given your idea to enable the operator interface to run through the computation without stopping in case of singular matrices I just suggested a small addition to the documentation. This change seems reasonable to me as even a scalar division would not stop the program but also simply return a NaN. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @perazz . LGTM. I think it could be merged.
Co-authored-by: Jeremie Vandenplas <jeremie.vandenplas@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thank you @perazz
Thank you all, I will merge this now. |
Compute the multiplicative inverse of a$A \cdot A^{-1} = A^{-1} \cdot A = I_n$ .
real
orcomplex
square matrix:Based on LAPACK General factorization (
*GETRF
) and inversion (*GETRI
).exclude unsupportedxdp
subroutine
interfacePrior art
B = inv(A)
inv(A, overwrite_a=False, check_finite=True)
.i.A
Proposed implementation
B = inv(A [, err])
function interfacecall invert(A [, pivot] [, err])
in-place (no-allocation) subroutine interface (optionalpivot
array).inv.A
operator interfacecc: @jalvesz @jvdp1 @loiseaujc @fortran-lang/stdlib