Skip to content

Commit

Permalink
Fix preconditioner unit test (#283)
Browse files Browse the repository at this point in the history
  • Loading branch information
mertkipcak authored Oct 11, 2024
1 parent a57d43b commit bc2d115
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 bc2d115

Please sign in to comment.