Skip to content
This repository has been archived by the owner on Oct 22, 2021. It is now read-only.

Commit

Permalink
updated generator syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
matbesancon committed Dec 29, 2017
1 parent 5bd0231 commit ae1da32
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ function maximum_weight_maximal_matching(g::Graph, w::Dict{Edge,T}; solver = GLP
end
end
if length(idx) > 0
@constraint(model, sum{x[id], id=idx} == 1)
@constraint(model, sum(x[id] for id = idx) == 1)
end
end

Expand All @@ -75,11 +75,11 @@ function maximum_weight_maximal_matching(g::Graph, w::Dict{Edge,T}; solver = GLP
end

if length(idx) > 0
@constraint(model, sum{x[id], id=idx} <= 1)
@constraint(model, sum(x[id] for id = idx) <= 1)
end
end

@objective(model, Max, sum{c * x[edgemap[e]], (e,c)=w})
@objective(model, Max, sum(c * x[edgemap[e]] for (e,c) = w))

status = solve(model)
status != :Optimal && error("JuMP solver failed to find optimal solution.")
Expand Down

0 comments on commit ae1da32

Please sign in to comment.