You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Found by someone at UoA. If I find their GitHub handle, I'll edit here.
julia>using Gurobi
julia>import MathOptInterface as MOI
julia> model = Gurobi.Optimizer()
sense : minimize
number of variables =0
number of linear constraints =0
number of quadratic constraints =0
number of sos constraints =0
number of non-zero coeffs =0
number of non-zero qp objective terms =0
number of non-zero qp constraint terms =0
julia> x = MOI.add_variable(model)
MOI.VariableIndex(1)
julia> c = [MOI.add_constraint(model, i * x, MOI.LessThan(i)) for i in [1.0, 2.0]]
2-element Vector{MathOptInterface.ConstraintIndex{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.LessThan{Float64}}}:
MathOptInterface.ConstraintIndex{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.LessThan{Float64}}(2)
MathOptInterface.ConstraintIndex{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.LessThan{Float64}}(3)
julia> MOI.optimize!(model)
Gurobi Optimizer version 10.0.0 build v10.0.0rc2 (mac64[x86])
CPU model:Intel(R) Core(TM) i5-8259U CPU @ 2.30GHz
Thread count:4 physical cores, 8 logical processors, using up to 8 threads
Optimize a model with 2 rows, 1 columns and 2 nonzeros
Model fingerprint:0x04ae1447
Coefficient statistics:
Matrix range [1e+00, 2e+00]
Objective range [0e+00, 0e+00]
Bounds range [0e+00, 0e+00]
RHS range [1e+00, 2e+00]
Presolve removed 2 rows and 1 columns
Presolve time:0.00s
Presolve: All rows and columns removed
Iteration Objective Primal Inf. Dual Inf. Time
00.0000000e+000.000000e+000.000000e+000s
Solved in0 iterations and 0.00 seconds (0.00 work units)
Optimal objective 0.000000000e+00
User-callback calls 31, time in user-callback 0.00 sec
julia> MOI.delete(model, c[1])
julia> MOI.modify(model, c[2], MOI.ScalarCoefficientChange(x, 4.0))
julia> MOI.optimize!(model)
Gurobi Optimizer version 10.0.0 build v10.0.0rc2 (mac64[x86])
CPU model:Intel(R) Core(TM) i5-8259U CPU @ 2.30GHz
Thread count:4 physical cores, 8 logical processors, using up to 8 threads
Optimize a model with 1 rows, 1 columns and 1 nonzeros
Model fingerprint:0x742efd99
Coefficient statistics:
Matrix range [2e+00, 2e+00]
Objective range [0e+00, 0e+00]
Bounds range [0e+00, 0e+00]
RHS range [2e+00, 2e+00]
Presolve removed 1 rows and 1 columns
Presolve time:0.00s
Presolve: All rows and columns removed
Iteration Objective Primal Inf. Dual Inf. Time
00.0000000e+000.000000e+000.000000e+000s
Solved in0 iterations and 0.00 seconds (0.00 work units)
Optimal objective 0.000000000e+00
User-callback calls 31, time in user-callback 0.00 sec
julia>GRBwrite(model, "bug.lp")
0
julia>print(read("bug.lp", String))
\ LP format -for model browsing. Use MPS format to capture full model detail.
Minimize
Subject To
R1:2 C0 <=2
Bounds
C0 free
End
R1 should be 4 C0 <= 2
The text was updated successfully, but these errors were encountered:
Found by someone at UoA. If I find their GitHub handle, I'll edit here.
R1 should be
4 C0 <= 2
The text was updated successfully, but these errors were encountered: