Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Test] update for generic coefficient types #1667

Merged
merged 1 commit into from
Nov 19, 2021
Merged
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
24 changes: 13 additions & 11 deletions src/Test/test_basic_constraint.jl
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,16 @@ _set(::Type{MOI.RootDetConeTriangle}) = MOI.RootDetConeTriangle(3)
_set(::Type{MOI.RootDetConeSquare}) = MOI.RootDetConeSquare(3)
_set(::Type{MOI.Complements}) = MOI.Complements(2)

function _set(::Type{MOI.Indicator{MOI.ACTIVATE_ON_ONE,MOI.LessThan{Float64}}})
return MOI.Indicator{MOI.ACTIVATE_ON_ONE}(MOI.LessThan(3.0))
function _set(
::Type{MOI.Indicator{MOI.ACTIVATE_ON_ONE,MOI.LessThan{T}}},
) where {T}
return MOI.Indicator{MOI.ACTIVATE_ON_ONE}(MOI.LessThan(convert(T, 3)))
end

function _set(
::Type{MOI.Indicator{MOI.ACTIVATE_ON_ONE,MOI.GreaterThan{Float64}}},
)
return MOI.Indicator{MOI.ACTIVATE_ON_ONE}(MOI.GreaterThan(3.0))
::Type{MOI.Indicator{MOI.ACTIVATE_ON_ONE,MOI.GreaterThan{T}}},
) where {T}
return MOI.Indicator{MOI.ACTIVATE_ON_ONE}(MOI.GreaterThan(convert(T, 3)))
end

function _basic_constraint_test_helper(
Expand Down Expand Up @@ -285,26 +287,26 @@ end

function test_basic_VectorAffineFunction_Indicator_LessThan(
model::MOI.ModelLike,
config::Config,
)
config::Config{T},
) where {T}
_basic_constraint_test_helper(
model,
config,
MOI.VectorAffineFunction,
MOI.Indicator{MOI.ACTIVATE_ON_ONE,MOI.LessThan{Float64}},
MOI.Indicator{MOI.ACTIVATE_ON_ONE,MOI.LessThan{T}},
)
return
end

function test_basic_VectorAffineFunction_Indicator_GreaterThan(
model::MOI.ModelLike,
config::Config,
)
config::Config{T},
) where {T}
_basic_constraint_test_helper(
model,
config,
MOI.VectorAffineFunction,
MOI.Indicator{MOI.ACTIVATE_ON_ONE,MOI.GreaterThan{Float64}},
MOI.Indicator{MOI.ACTIVATE_ON_ONE,MOI.GreaterThan{T}},
)
return
end