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
11 changes: 1 addition & 10 deletions src/bridge.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ If the expanded expression cannot be converted to `F`, an error is thrown.
"""
struct FunctionGeneratorBridge{T,F,S} <: MOI.Bridges.Constraint.AbstractBridge
constraints::Vector{MOI.ConstraintIndex{F,S}}
func::FunctionGenerator{F}
end

function MOI.Bridges.Constraint.bridge_constraint(
Expand All @@ -42,7 +41,7 @@ function MOI.Bridges.Constraint.bridge_constraint(
)
push!(constraints, ci)
end
return FunctionGeneratorBridge{T,F,S}(constraints, func)
return FunctionGeneratorBridge{T,F,S}(constraints)
end

function MOI.supports_constraint(
Expand Down Expand Up @@ -88,14 +87,6 @@ function MOI.get(
return copy(bridge.constraints)
end

function MOI.get(
::MOI.ModelLike,
::MOI.ConstraintFunction,
bridge::FunctionGeneratorBridge,
)
return copy(bridge.func)
end

function MOI.get(
::MOI.ModelLike,
::MOI.ConstraintSet,
Expand Down
3 changes: 3 additions & 0 deletions test/bridge.jl
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ function test_runtests_simple()
)
end
end,
cannot_unbridge = true,
)
end

Expand Down Expand Up @@ -122,6 +123,7 @@ function test_runtests_equality()
)
end
end,
cannot_unbridge = true,
)
end

Expand Down Expand Up @@ -187,6 +189,7 @@ function test_runtests_consecutive()
MOI.GreaterThan(2.0),
)
end,
cannot_unbridge = true,
)
end

Expand Down
Loading