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

Add support for MOI.BarrierIterations #389

Merged
merged 3 commits into from
Oct 11, 2023
Merged

Add support for MOI.BarrierIterations #389

merged 3 commits into from
Oct 11, 2023

Conversation

odow
Copy link
Member

@odow odow commented Oct 11, 2023

Closes #388

@codecov
Copy link

codecov bot commented Oct 11, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (f7ea9de) 94.02% compared to head (ed46111) 94.06%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #389      +/-   ##
==========================================
+ Coverage   94.02%   94.06%   +0.04%     
==========================================
  Files           4        4              
  Lines         920      927       +7     
==========================================
+ Hits          865      872       +7     
  Misses         55       55              
Files Coverage Δ
src/MOI_wrapper.jl 93.16% <100.00%> (+0.08%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

@ojwoodford ojwoodford left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for doing this. Thought I'd comment. Hope it's useful.

src/MOI_wrapper.jl Outdated Show resolved Hide resolved
src/MOI_wrapper.jl Outdated Show resolved Hide resolved
src/MOI_wrapper.jl Outdated Show resolved Hide resolved
src/MOI_wrapper.jl Outdated Show resolved Hide resolved
src/MOI_wrapper.jl Outdated Show resolved Hide resolved
model.barrier_iterations = 0
function _moi_callback(args...)
# iter_count is args[2]
model.barrier_iterations = args[2]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docs say that this method is called exactly once per iteration during convergence, so I guess it is save to do this:

https://coin-or.github.io/Ipopt/classIpopt_1_1TNLP.html#a2f962a4c43464adb7928771af84503d6

@odow odow merged commit 35a2055 into master Oct 11, 2023
14 checks passed
@odow odow deleted the od/barrier-iterations branch October 11, 2023 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Get number of iterations after optimization
2 participants