Skip to content
Open
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
14 changes: 0 additions & 14 deletions src/jump_moi_overloads.jl
Original file line number Diff line number Diff line change
Expand Up @@ -251,20 +251,6 @@ end

MOI.constant(func::IndexMappedFunction) = MOI.constant(func.func)

# Support JuMP.coefficient on plain MOI functions returned by native solvers
function JuMP.coefficient(
func::MOI.ScalarAffineFunction{T},
vi::MOI.VariableIndex,
) where {T}
coef = zero(T)
for term in func.terms
if term.variable == vi
coef += term.coefficient
end
end
return coef
end

function JuMP.coefficient(func::IndexMappedFunction, vi::MOI.VariableIndex)
return JuMP.coefficient(func.func, func.index_map[vi])
end
Expand Down
Loading