Skip to content

Commit

Permalink
More fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
odow committed May 31, 2021
1 parent cdcfe9c commit adbf35e
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 23 deletions.
45 changes: 23 additions & 22 deletions src/Test/UnitTests/attributes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -216,32 +216,33 @@ for attr in (
function $(f)(model::MOI.ModelLike, config::Config{T}) where {T}
MOI.empty!(model)
x = MOI.add_variable(model)
ci = if MOI.supports_constraint(
model,
MOI.ScalarAffineFunction{T},
MOI.GreaterThan{T},
)
MOI.add_constraint(
ci =
if MOI.supports_constraint(
model,
MOI.ScalarAffineFunction(
[MOI.ScalarAffineTerm(one(T), x)],
zero(T),
),
MOI.GreaterThan(zero(T)),
MOI.ScalarAffineFunction{T},
MOI.GreaterThan{T},
)
elseif MOI.supports_constraint(
model,
MOI.VectorOfVariables,
MOI.Nonnegatives,
)
MOI.add_constraint(
MOI.add_constraint(
model,
MOI.ScalarAffineFunction(
[MOI.ScalarAffineTerm(one(T), x)],
zero(T),
),
MOI.GreaterThan(zero(T)),
)
elseif MOI.supports_constraint(
model,
MOI.VectorOfVariables([x]),
MOI.Nonnegatives(1),
MOI.VectorOfVariables,
MOI.Nonnegatives,
)
else
return
end
MOI.add_constraint(
model,
MOI.VectorOfVariables([x]),
MOI.Nonnegatives(1),
)
else
return
end
attribute = MOI.$(attr)()
if MOI.is_set_by_optimize(attribute)
if !config.solve
Expand Down
2 changes: 1 addition & 1 deletion test/Test/unit.jl
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ end
"test_attribute_Silent",
"test_attribute_SimplexIterations",
"test_attribute_SolverName",
"test_attribute_SolveTime",
"test_attribute_SolveTimeSec",
"test_attribute_TerminationStatus",
"test_attribute_TimeLimitSec",
"test_attribute_VariableName",
Expand Down

0 comments on commit adbf35e

Please sign in to comment.