-
Notifications
You must be signed in to change notification settings - Fork 94
Closed
Labels
Description
From this simple example:
using JuMP
using HiGHS
using Profile
using PProf
function add_var()
model = direct_model(HiGHS.Optimizer())
@variable(model, 1 <= x[i in 1:10000] <= 2)
return nothing
end
add_var()
Profile.clear()
@profile add_var()
pprof()
we get:
So, almost 2/3 of the time is spent on adding the bounds.
But, similar to many other solvers, HiGHS would be able to do both in a single call:
Highs_addCol(model, 0.0, -Inf, Inf, 0, C_NULL, C_NULL)
One idea would be:
Create the function(s):
MOI.Utilities.add_variable(s)_and_bounds_constraints
The fallback would be add_variable(s)
+ add_constraint(s)
But solvers could choose to implement this function, and JuMP would always use it (which would work, thanks to the fallback).