-
Notifications
You must be signed in to change notification settings - Fork 181
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: solve #806
linalg: solve #806
Conversation
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. @perazz, thanks for your efforts, stdlib
gradually has a user-friendly, high-level BLAS API.
Co-authored-by: ZUO Zhihua <[email protected]>
Co-authored-by: ZUO Zhihua <[email protected]>
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. Here are a few suggestions/comments.
Co-authored-by: Jeremie Vandenplas <[email protected]>
Co-authored-by: Jeremie Vandenplas <[email protected]>
Co-authored-by: Jeremie Vandenplas <[email protected]>
Co-authored-by: Jeremie Vandenplas <[email protected]>
Co-authored-by: Jeremie Vandenplas <[email protected]>
Co-authored-by: Jeremie Vandenplas <[email protected]>
@jvdp1 @zoziha I've implemented a call solve_lu(a,b,x,pivot=ipiv,overwrite_a=.true.,err=err)
Please, let me know what you think of this approach, I will complete the documentation for this after we've defined the final version. Thanks! |
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, and it is almost ready to be merged. Nice addition!
Dear all @jvdp1 @jalvesz @zoziha I've documented the subroutine interface and added a no-allocation example. |
Thanks a lot @jvdp1 |
Linear system solution$Ax=b$ , for both 1-rhs (
b(:)
) or n-rhs (b(:,:)
) cases, based on LAPACK*GESV
functions.xdp
pure subroutine
interfacePrior art:
solve(a, b)
solve(a, b, lower=False, overwrite_a=False, overwrite_b=False, check_finite=True, assume_a='gen', transposed=False)
lu_solve(a, b, transpose=False)
Proposed implementation:
pure
(onlyintent(in)
arguments)intent(out)
error handler,a
can be overwritten)Example calls:
x = solve(a,b)
-> simplestpure
callx = solve(a,b,overwrite_a=.false.,err)
-> expert call:logical(lk), optional, intent(in) :: overwrite_a
= option to avoid internal allocation, but destroy input matrixa
. Default:.false.
type(linalg_state_type), intent(out) :: err
= return state variablecc: @jvdp1 @zoziha @jalvesz @fortran-lang/stdlib: I believe this is ready for consideration.