Skip to content

Commit ae1da32

Browse files
committed
updated generator syntax
1 parent 5bd0231 commit ae1da32

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/lp.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ function maximum_weight_maximal_matching(g::Graph, w::Dict{Edge,T}; solver = GLP
6262
end
6363
end
6464
if length(idx) > 0
65-
@constraint(model, sum{x[id], id=idx} == 1)
65+
@constraint(model, sum(x[id] for id = idx) == 1)
6666
end
6767
end
6868

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

7777
if length(idx) > 0
78-
@constraint(model, sum{x[id], id=idx} <= 1)
78+
@constraint(model, sum(x[id] for id = idx) <= 1)
7979
end
8080
end
8181

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

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

0 commit comments

Comments
 (0)