Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name = "Xpress"
uuid = "9e70acf3-d6c9-5be6-b5bd-4e2c73e3e054"
authors = ["Joaquim Dias Garcia <[email protected]>, Dheepak Krishnamurthy <[email protected]>, Jose Daniel Lara <[email protected]>"]
url = "https://github.com/jump-dev/Xpress.jl"
version = "0.13.2"
version = "0.14.0"

[deps]
Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
Expand All @@ -11,7 +11,7 @@ MathOptInterface = "b8f27783-ece8-5eb3-8dc8-9495eed66fee"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"

[compat]
MathOptInterface = "~0.9.20"
MathOptInterface = "0.10.5"
julia = "1"

[extras]
Expand Down
509 changes: 284 additions & 225 deletions src/MOI/MOI_wrapper.jl

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions test/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
*.log
*.prt
14 changes: 7 additions & 7 deletions test/Derivative/DerivativeExample.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ mutable struct DispachModel
c_demand # Constraint of the generation by the demand
end

#Simple Model of Thermal Generation Dispatch by Constraints with MOI.SingleVariable
function GenerateModel_SingleVariable()
#Simple Model of Thermal Generation Dispatch by Constraints with MOI.VariableIndex
function GenerateModel_VariableIndex()
# Parameters
d = 45.0 # Demand
I = 3 # Number of generators
Expand All @@ -33,10 +33,10 @@ function GenerateModel_SingleVariable()
c_limit_inf = Vector{Any}(undef, I + 1) # Lower limit constraints
c_limit_sup = Vector{Any}(undef, I) # Upper limit constraints
for i in 1:I
c_limit_inf[i] = MOI.add_constraint(optimizer, MOI.SingleVariable(g[i]), MOI.GreaterThan(0.0))
c_limit_sup[i] = MOI.add_constraint(optimizer, MOI.SingleVariable(g[i]), MOI.LessThan(g_sup[i]))
c_limit_inf[i] = MOI.add_constraint(optimizer, g[i], MOI.GreaterThan(0.0))
c_limit_sup[i] = MOI.add_constraint(optimizer, g[i], MOI.LessThan(g_sup[i]))
end
c_limit_inf[I+1] = MOI.add_constraint(optimizer, MOI.SingleVariable(Df), MOI.GreaterThan(0.0))
c_limit_inf[I+1] = MOI.add_constraint(optimizer, Df, MOI.GreaterThan(0.0))

c_demand = MOI.add_constraint(optimizer,
MOI.ScalarAffineFunction(MOI.ScalarAffineTerm.(ones(I+1),[g;Df]), 0.0),
Expand Down Expand Up @@ -158,8 +158,8 @@ end
#Initialization of Parameters
@testset "Results" begin
@testset "Single_Variable" begin
#Generate model by SingleVariable
model1 = GenerateModel_SingleVariable()
#Generate model by VariableIndex
model1 = GenerateModel_VariableIndex()
#Get the results of models with the DiffOpt Forward context
@testset "Forward" begin
resultForward = Forward(model1)
Expand Down
6 changes: 1 addition & 5 deletions test/MathOptInterface/MOI_callbacks.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ using Random
using Test

const MOI = MathOptInterface
const MOIT = MathOptInterface.Test

const MOIT = MOI.Test
const MOIU = MOI.Utilities

function callback_simple_model()
model = Xpress.Optimizer(
Expand Down Expand Up @@ -43,7 +39,7 @@ function callback_knapsack_model()

N = 30
x = MOI.add_variables(model, N)
MOI.add_constraints(model, MOI.SingleVariable.(x), MOI.ZeroOne())
MOI.add_constraints(model, x, MOI.ZeroOne())
MOI.set.(model, MOI.VariablePrimalStart(), x, 0.0)
Random.seed!(1)
item_weights, item_values = rand(N), rand(N)
Expand Down
Loading