-
Notifications
You must be signed in to change notification settings - Fork 63
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
WIP: MOI #139
Closed
Closed
WIP: MOI #139
Changes from 1 commit
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
881f701
Begin MOI rewrite
odow 5a5395c
constraints
odow c098adf
objectives
odow 744d084
more MOI
odow 29b7ee5
Much changes
odow e8ada4e
Passing Linear1
odow 48b90de
Improve status
odow 68721dc
Tidy up and comment
odow 64e0b57
Add integer
odow bc280b1
Spurious segfaults with sos
odow d964a82
Fails on SOS1 test
odow eadbf46
sos constraint sets and functions
odow 441470b
Add solve attributes
odow c551729
More attributes
odow 9632b1d
Most of quadratic basics
odow 072d102
add new qp test
odow c729976
addlinearconstraints!
odow 0971612
fix solve attributes
odow e5b940a
Turn off screen printing and bundle tests
odow 2763835
Rejig constants, params, and status
odow fdeef48
Add defines for CPLEX12.7
odow bada1f9
Set variable warm starts
odow 3e14070
tidy up more
odow 7c15b15
Handle quad->linear objectives
odow 3a23910
Fix bug in chgcoltyp
odow a500672
add vector bounds
odow b21eb6e
Add interval constraints
odow 92a9594
modifying interval constraints
odow 19bef32
rejig tolerances for tests
odow 862c316
Reenable old code
odow cb01a5c
Enable certificates
odow 239c921
can return infeasible primal solutions
odow 630e182
Fix wherefrom in callbacks
odow c293732
Add transformconstraint
odow 01b9f4e
tidy inclusion of 12.7.1 files
odow 75738b0
Add canmodify and candelete
odow 3425a7d
Tidy handling of infeasibility
odow 1e7416f
Add cantransformconstraint
odow File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
function cpx_add_constraint!(model::Model, cols::Vector{Int}, coefficients::Vector{Float64}, sense::Cchar, rhs::Float64) | ||
@assert length(cols) == length(coefficients) | ||
nnz = Cint(length(cols)) | ||
@cpx_ccall(addrows, Cint, ( | ||
Ptr{Void}, # environment | ||
Ptr{Void}, # problem | ||
Cint, # num new cols | ||
Cint, # num new rows | ||
Cint, # num non-zeros | ||
Ptr{Cdouble}, # rhs | ||
Ptr{Cchar}, # sense | ||
Ptr{Cint}, # matrix start | ||
Ptr{Cint}, # matrix index | ||
Ptr{Cdouble}, # matrix values | ||
Ptr{Ptr{Cchar}}, # col names | ||
Ptr{Ptr{Cchar}} # row names | ||
), | ||
model.env.ptr, model.lp, 0, Cint(1), nnz, [rhs], [sense], [Cint(0)], Cint.(cols-1), coefficients, C_NULL, C_NULL) | ||
end | ||
|
||
function cpx_number_constraints(model::Model) | ||
ncons = @cpx_ccall(getnumrows, Cint, ( | ||
Ptr{Void}, | ||
Ptr{Void} | ||
), | ||
model.env.ptr, model.lp) | ||
return ncons | ||
end | ||
|
||
function get_rhs(model::Model) | ||
ncons = cpx_number_constraints(model) | ||
rhs = Vector{Cdouble}(ncons) | ||
@cpx_ccall_error(model.env, getrhs, Cint, ( | ||
Ptr{Void}, | ||
Ptr{Void}, | ||
Ptr{Cdouble}, | ||
Cint, | ||
Cint | ||
), | ||
model.env.ptr, model.lp, rhs, 0, ncons-1) | ||
return rhs | ||
end | ||
|
||
function cpx_get_rhs(model::Model, row::Int) | ||
rhs = Vector{Cdouble}(1) | ||
@cpx_ccall_error(model.env, getrhs, Cint, ( | ||
Ptr{Void}, | ||
Ptr{Void}, | ||
Ptr{Cdouble}, | ||
Cint, | ||
Cint | ||
), | ||
model.env.ptr, model.lp, rhs, Cint(row-1), Cint(row-1)) | ||
return rhs[1] | ||
end |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Why do we need
variable_mapping
andvariable_references
, cant we just usekeys(variable_mapping)
?