Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
5 changes: 1 addition & 4 deletions src/Bridges/Constraint/bridges/VectorizeBridge.jl
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,7 @@ function bridge_constraint(
scalar_f::G,
set::MOI.Utilities.ScalarLinearSet{T},
) where {T,F,S,G}
scalar_const = MOI.constant(scalar_f, T)
if !iszero(scalar_const)
throw(MOI.ScalarFunctionConstantNotZero{T,G,typeof(set)}(scalar_const))
end
MOI.throw_if_scalar_and_constant_not_zero(scalar_f, typeof(set))
set_const = MOI.constant(set)
vector_f = MOI.Utilities.operate(
vcat,
Expand Down
8 changes: 2 additions & 6 deletions src/Utilities/mockoptimizer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -181,12 +181,8 @@
) where {T}
if !mock.add_con_allowed
throw(MOI.AddConstraintNotAllowed{typeof(func),typeof(set)}())
elseif mock.scalar_function_constant_non_zero && !iszero(func.constant)
throw(
MOI.ScalarFunctionConstantNotZero{T,typeof(func),typeof(set)}(
func.constant,
),
)
elseif mock.scalar_function_constant_non_zero
MOI.throw_if_scalar_and_constant_not_zero(func, typeof(S))

Check warning on line 185 in src/Utilities/mockoptimizer.jl

View check run for this annotation

Codecov / codecov/patch

src/Utilities/mockoptimizer.jl#L185

Added line #L185 was not covered by tests
Comment thread
blegat marked this conversation as resolved.
Outdated
end
ci = MOI.add_constraint(mock.inner_model, xor_indices(func), set)
return xor_index(ci)
Expand Down
Loading