Skip to content
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

Eliminate useless allocation for diagonal quasi-Newton operators #337

Conversation

MohamedLaghdafHABIBOULLAH
Copy link
Contributor

@dpo With these changes, push! for diagonal QN operator should no longer allocate memory.

julia> using LinearOperators

julia> D = DiagonalAndrei(ones(2));

julia> s0 = sqrt(3) * ones(2)

julia> y0 = sqrt(2) *ones(2)

julia> @wrappedallocs push!(D, s0, y0)
0

julia> D = DiagonalPSB(ones(2))

julia> @wrappedallocs push!(D, s0, y0)
0

julia> D = SpectralGradient(1., 2);

julia> @wrappedallocs push!(D, s0, y0)
0

Copy link
Contributor

github-actions bot commented Sep 9, 2024

Package name latest stable
CaNNOLeS.jl
DCISolver.jl
FletcherPenaltySolver.jl
JSOSolvers.jl
Krylov.jl
NLPModels.jl
NLPModelsModifiers.jl
PROPACK.jl
Percival.jl
QuadraticModels.jl
SolverTools.jl

@dpo
Copy link
Member

dpo commented Sep 9, 2024

We're still missing @wrappedallocs and unit tests, right?

@MohamedLaghdafHABIBOULLAH
Copy link
Contributor Author

MohamedLaghdafHABIBOULLAH commented Oct 7, 2024

@dpo I have added wrappedallocs and a unit test for the new versions of diagonal push, and I removed the unused iterators

src/DiagonalHessianApproximation.jl Outdated Show resolved Hide resolved
src/DiagonalHessianApproximation.jl Outdated Show resolved Hide resolved
src/DiagonalHessianApproximation.jl Outdated Show resolved Hide resolved
src/DiagonalHessianApproximation.jl Outdated Show resolved Hide resolved
src/DiagonalHessianApproximation.jl Outdated Show resolved Hide resolved
@dpo dpo merged commit ab0de4e into JuliaSmoothOptimizers:main Oct 10, 2024
17 of 39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants