Skip to content

Commit

Permalink
Allow 64-bit int input in 32-bit system (#93)
Browse files Browse the repository at this point in the history
* Allow 64-bit int input in 32-bit system

* 🚸 Add comment

* Improve comment
  • Loading branch information
blegat authored and mlubin committed Jan 2, 2019
1 parent aa6a13d commit 583cdc0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/MOI_wrapper.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ struct CbcModelFormat
obj::Vector{Float64}
row_lb::Vector{Float64}
row_ub::Vector{Float64}
function CbcModelFormat(num_rows::Int, num_cols::Int)
function CbcModelFormat(num_rows::Integer, num_cols::Integer)
obj = fill(0.0, num_cols)
row_idx = Int[]
col_idx = Int[]
Expand All @@ -32,6 +32,9 @@ struct CbcModelFormat
row_lb = fill(-Inf, num_rows)
row_ub = fill(Inf, num_rows)
constraint_matrix = Tuple{Int,Int,Float64}[]
# An `InexactError` might occur if `num_rows` or `num_cols` is too
# large, e.g., if `num_cols isa Int64` and is larger than 2^31 on a
# 32-bit hardware
new(num_rows, num_cols, row_idx, col_idx, values, col_lb, col_ub,
obj, row_lb, row_ub)
end
Expand Down

0 comments on commit 583cdc0

Please sign in to comment.