Closed perazz closed 1 month ago
@jvdp1 @zoziha I've implemented a pure subroutine
interface, that looks like this:
call solve_lu(a,b,x,pivot=ipiv,overwrite_a=.true.,err=err)
solve_lu
a good name? I've chosen this because it follows the same pattern as solve_lstsq
in the least-squares interfacepure
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!
@jvdp1 @zoziha I've implemented a
pure subroutine
interface
Great! Thanks @perazz. LGTM
- Is
solve_lu
a good name? I've chosen this because it follows the same pattern assolve_lstsq
in the least-squares interface
LGTM. it makes sense and gives some info on how it is solves.
Dear all @jvdp1 @jalvesz @zoziha I've documented the subroutine interface and added a no-allocation example.
I believe this should be ready now. pivot
is the only pre-allocated array needed in this case. I suggest we wait until we have the full picture (what pre-allocated arrays do svd
, eig
, etc. need? ) so we can create a linalg_storage
type a posteriori
Thank you @perazz . I will merge it. As discussed here, I will prepare a new release today/tomorrow.
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)
710 cc @zoziha
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.