From ae1da325f9e9795a72550c11085d5e817c19bc7c Mon Sep 17 00:00:00 2001 From: mbesancon Date: Fri, 29 Dec 2017 11:07:30 -0500 Subject: [PATCH] updated generator syntax --- src/lp.jl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lp.jl b/src/lp.jl index bbf53f9..14c4cc3 100644 --- a/src/lp.jl +++ b/src/lp.jl @@ -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 @@ -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.")