Skip to content

Commit

Permalink
Fix #25
Browse files Browse the repository at this point in the history
  • Loading branch information
IainNZ committed Oct 29, 2014
1 parent 34a1d5a commit 5dd86cd
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/grb_params.jl
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,16 @@ function set_int_param!(env::Env, name::ASCIIString, v::Integer)
end
end

function set_int_param!(env::Env, name::ASCIIString, v::Real)
# User may have tried to use Inf or 1e100 or something of that
# nature to set this parameter, but as it is Int it will fail.
if v >= 2000000000 # GRB_MAXINT
set_int_param!(env, name, 2000000000)
else
error("The parameter $name must be an integer")
end
end

function set_dbl_param!(env::Env, name::ASCIIString, v::Real)
ret = @grb_ccall(setdblparam, Cint, (Ptr{Void}, Ptr{Cchar}, Float64),
env, name, v)
Expand Down

0 comments on commit 5dd86cd

Please sign in to comment.