-
Notifications
You must be signed in to change notification settings - Fork 25
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 wrapper (based on LQOI) #27
Changes from 4 commits
b9c81fe
0a07fdb
553b9ea
adf7810
35b982c
da2ad75
9d84bcc
1c60f52
d4042f0
5dfb617
a79e3fd
b86374b
a89e1c3
ea529ee
9aca0f6
07d4e91
3728aaf
0c8fc6d
6957e3c
af551f7
575aff7
4848bbe
8806d61
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
julia 0.6 | ||
Cbc | ||
MathProgBase 0.5 0.8 | ||
LinQuadOptInterface | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,9 @@ export | |
resize, | ||
delete_rows, | ||
add_rows, | ||
add_row, | ||
delete_columns, | ||
add_column, | ||
add_columns, | ||
chg_row_lower, | ||
chg_row_upper, | ||
|
@@ -418,12 +420,36 @@ function add_rows(model::ClpModel, number::Integer, row_lower::Vector{Float64}, | |
@clp_ccall addRows Void (Ptr{Void}, Int32, Ptr{Float64}, Ptr{Float64}, Ptr{Int32}, Ptr{Int32}, Ptr{Float64}) model.p number row_lower row_upper row_starts columns elements | ||
end | ||
|
||
#This function exists in cpp but not c interface | ||
function add_row(model::ClpModel, number_in_row::Integer, columns::Vector{Int32}, elements::Vector{Float64}, | ||
row_lower::Float64, row_upper::Float64) | ||
_row_starts = Vector{Int32}(2) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Naming: variables in the scope of a function shouldn't start with underscores. |
||
_row_starts[1] = 0 | ||
_row_starts[2] = number_in_row | ||
_row_upper = [row_upper] | ||
_row_lower = [row_lower] | ||
add_rows(model, 1, _row_lower, _row_upper, _row_starts, columns, elements) | ||
end | ||
|
||
# Delete columns. | ||
function delete_columns(model::ClpModel, which::Vector{Int32}) | ||
_jl__check_model(model) | ||
@clp_ccall deleteColumns Void (Ptr{Void},Int32,Ptr{Int32}) model.p length(which) which | ||
end | ||
|
||
#This function exists in cpp but not c interface | ||
function add_column(model::ClpModel, number_in_column::Integer, rows::Vector{Int32}, | ||
elements::Vector{Float64}, column_lower::Float64, | ||
column_upper::Float64, objective::Float64) | ||
_column_starts = Vector{Int32}(2) | ||
_column_starts[1] = 0 | ||
_column_starts[2] = number_in_column | ||
_column_upper = [column_upper] | ||
_column_lower = [column_lower] | ||
_objective = [objective] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ditto here, or at least no underscore variable names |
||
add_columns(model, 1, _column_lower, _column_upper, _objective, _column_starts, rows, elements) | ||
end | ||
|
||
# Add columns. | ||
function add_columns(model::ClpModel, number::Integer, column_lower::Vector{Float64}, | ||
column_upper::Vector{Float64}, | ||
|
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 should have a strict bound of
LinQuadOptInterface 0.1 0.2