-
Notifications
You must be signed in to change notification settings - Fork 15
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 VectorNonlinearFunction #82
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #82 +/- ##
==========================================
+ Coverage 93.66% 94.09% +0.42%
==========================================
Files 3 3
Lines 379 440 +61
==========================================
+ Hits 355 414 +59
- Misses 24 26 +2
☔ View full report in Codecov by Sentry. |
And here's the JuMP demo julia> using JuMP, PATHSolver
julia> model = Model(PATHSolver.Optimizer)
A JuMP Model
Feasibility problem with:
Variables: 0
Model mode: AUTOMATIC
CachingOptimizer state: EMPTY_OPTIMIZER
Solver name: Path 5.0.03
julia> @variable(model, 0 <= x[1:4] <= 10)
4-element Vector{VariableRef}:
x[1]
x[2]
x[3]
x[4]
julia> @constraints(model, begin
-x[3]^2.0 - x[4] + 2 ⟂ x[1]
x[3]^3.0 - 2x[4]^2.0 + 2 ⟂ x[2]
x[1]^5.0 - x[2] + 2x[3] - 2x[4] - 2 ⟂ x[3]
x[1] + 2x[2]^3.0 - 2x[3] + 4x[4] - 6 ⟂ x[4]
end)
([+(-(*(-1.0, ^(x[3], 2.0)), x[4]), 2.0), x[1]] ∈ MathOptInterface.Complements(2), [+(-(^(x[3], 3.0), *(2.0, ^(x[4], 2.0))), 2.0), x[2]] ∈ MathOptInterface.Complements(2), [-(-(+(-(^(x[1], 5.0), x[2]), 2 x[3]), 2 x[4]), 2.0), x[3]] ∈ MathOptInterface.Complements(2), [-(+(-(+(x[1], *(2.0, ^(x[2], 3.0))), 2 x[3]), 4 x[4]), 6.0), x[4]] ∈ MathOptInterface.Complements(2))
julia> optimize!(model)
Path 5.0.03 (Fri Jun 26 09:58:07 2020)
Written by Todd Munson, Steven Dirkse, Youngdae Kim, and Michael Ferris
Crash Log
major func diff size residual step prox (label)
0 0 9.3949e+00 0.0e+00 (f[ 4])
1 4 3 2 7.7898e+00 4.1e-01 0.0e+00 (f[ 1])
2 5 1 3 1.4635e+00 1.0e+00 0.0e+00 (f[ 3])
3 6 0 3 1.1831e+00 1.0e+00 0.0e+00 (f[ 3])
pn_search terminated: no basis change.
Major Iteration Log
major minor func grad residual step type prox inorm (label)
0 0 7 4 1.1831e+00 I 0.0e+00 1.2e+00 (f[ 3])
1 1 8 5 1.0633e+00 1.0e+00 SO 0.0e+00 1.1e+00 (f[ 3])
2 1 9 6 9.7034e-01 1.0e+00 SO 0.0e+00 9.7e-01 (f[ 3])
3 3 10 7 1.5017e+00 1.0e+00 SO 0.0e+00 1.2e+00 (f[ 4])
4 2 11 8 1.4820e+00 1.0e+00 SO 0.0e+00 1.2e+00 (f[ 4])
5 1 12 9 1.4756e+00 1.0e+00 SO 0.0e+00 1.2e+00 (f[ 4])
6 1 13 10 1.4483e+00 1.0e+00 SO 0.0e+00 1.2e+00 (f[ 4])
7 1 14 11 1.3317e+00 1.0e+00 SO 0.0e+00 1.1e+00 (f[ 4])
8 1 15 12 1.0594e+00 1.0e+00 SO 0.0e+00 1.0e+00 (f[ 4])
9 1 16 13 5.7505e-01 1.0e+00 SO 0.0e+00 5.7e-01 (f[ 4])
10 1 17 14 7.6079e-02 1.0e+00 SO 0.0e+00 7.6e-02 (f[ 4])
11 1 18 15 1.0305e-03 1.0e+00 SO 0.0e+00 1.0e-03 (f[ 4])
12 1 19 16 1.8656e-07 1.0e+00 SO 0.0e+00 1.9e-07 (f[ 4])
Major Iterations. . . . 12
Minor Iterations. . . . 15
Restarts. . . . . . . . 0
Crash Iterations. . . . 3
Gradient Steps. . . . . 0
Function Evaluations. . 19
Gradient Evaluations. . 16
Basis Time. . . . . . . 0.000051
Total Time. . . . . . . 0.001205
Residual. . . . . . . . 1.865551e-07
julia> value.(x)
4-element Vector{Float64}:
1.2847523472583888
0.972916458993744
0.909376156748673
1.173035005537013 |
21b68d2
to
ca10a15
Compare
last_col = 0 | ||
# We need to zero all entries up front in case some rows do not | ||
# appear in the Jacobian. | ||
len .= Cint(0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was a tricky segfault to track down 😄
Closes #87