Skip to content
This repository has been archived by the owner on Oct 31, 2024. It is now read-only.

Improve the performance of LBroyden #42

Closed
ChrisRackauckas opened this issue Feb 11, 2023 · 4 comments
Closed

Improve the performance of LBroyden #42

ChrisRackauckas opened this issue Feb 11, 2023 · 4 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@ChrisRackauckas
Copy link
Member

#41

https://github.com/SciML/SimpleNonlinearSolve.jl/blob/main/src/lbroyden.jl#L47-L49
https://github.com/SciML/SimpleNonlinearSolve.jl/blob/main/src/lbroyden.jl#L61-L62
https://github.com/SciML/SimpleNonlinearSolve.jl/blob/main/src/lbroyden.jl#L64-L66
https://github.com/SciML/SimpleNonlinearSolve.jl/blob/main/src/lbroyden.jl#L71

These all allocate. We can instead allocate once and make those all in-place. There's no need for a NonlinearSolve.jl version because it's still a rather straightforward method (no Jacobians), and this is really the only tweak that needs to be done.

@ChrisRackauckas ChrisRackauckas added enhancement New feature or request good first issue Good for newcomers labels Feb 11, 2023
@avik-pal
Copy link
Member

If someone needs a reference to a non-allocating version https://github.com/SciML/DeepEquilibriumNetworks.jl/blob/998c8b64ec9920a49cd59f2d98a43b308e26f632/src/solvers/discrete/limited_memory_broyden.jl (the code there is a bit clunky)

@ChrisRackauckas
Copy link
Member Author

this is being handled?

@avik-pal
Copy link
Member

Let's keep the implementation here as it is. I will pull the improvements into NonlinearSolve.jl

@avik-pal
Copy link
Member

SciML/NonlinearSolve.jl#257 fixes this

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants