Skip to content

Commit

Permalink
Fix preconditioner unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
mertkipcak committed Oct 9, 2024
1 parent a57d43b commit 56e276a
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,9 @@ end
function DiagPrecon(x)
H = Matrix(hess(nlp, x))
λmin = minimum(eigvals(H))
Diagonal(H + λmin * I)
Diagonal(H + (λmin+1e-6)*I )
end
M = DiagPrecon(x0)
function LinearAlgebra.ldiv!(y, M::Diagonal, x)
y .= M \ x
end
function callback(nlp, solver, stats)
M[:] = DiagPrecon(solver.x)
end
Expand Down

0 comments on commit 56e276a

Please sign in to comment.