Skip to content
Open
Show file tree
Hide file tree
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
3 changes: 1 addition & 2 deletions src/simpleweighteddigraph.jl
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,9 @@ Graphs.inneighbors(g::SimpleWeightedDiGraph, v::Integer) = g.weights[v, :].nzind
# add_edge! will overwrite weights.
function Graphs.add_edge!(g::SimpleWeightedDiGraph, e::SimpleWeightedGraphEdge)
T = eltype(g)
U = weighttype(g)
s_, d_, w = Tuple(e)

if w == zero(U)
if iszero(w)
@warn "Note: adding edges with a zero weight to this graph type has no effect." maxlog =
1 _id = :swd_add_edge_zero
return false
Expand Down
3 changes: 1 addition & 2 deletions src/simpleweightedgraph.jl
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,9 @@ Graphs.inneighbors(g::SimpleWeightedGraph, x...) = outneighbors(g, x...)
# add_edge! will overwrite weights.
function Graphs.add_edge!(g::SimpleWeightedGraph, e::SimpleWeightedGraphEdge)
T = eltype(g)
U = weighttype(g)
s_, d_, w = Tuple(e)

if w == zero(U)
if iszero(w)
@warn "Note: adding edges with a zero weight to this graph type has no effect." maxlog =
1 _id = :swg_add_edge_zero
return false
Expand Down
Loading