Closed bblankrot closed 5 years ago
Changes Missing Coverage | Covered Lines | Changed/Added Lines | % | ||
---|---|---|---|---|---|
src/wrapper.jl | 21 | 22 | 95.45% | ||
<!-- | Total: | 21 | 22 | 95.45% | --> |
Totals | |
---|---|
Change from base Build 19: | 0.06% |
Covered Lines: | 55 |
Relevant Lines: | 57 |
LGTM, thanks!
Replaced the tuple (f, g) with f and g!, where g!(z,x) overwrites z with the gradient at the point x. This prevents the re-allocation of the gradient vector in each iterate. For the example in README.md, this change reduced run time by 10% and halved the allocated memory. The effects are more dramatic as the number of iterations and variables grows.
To maintain backwards compatibility, I left the original wrapper as is (with its test), and added a test for the new wrapper.