Skip to content

Commit

Permalink
Clarify undefined behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
gdalle committed Apr 6, 2023
1 parent 344b7ee commit 8788527
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/simpleweighteddigraph.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ SimpleWeightedDiGraph(adjmx; permute) # from adjacency matrix, possibly transpo
SimpleWeightedDiGraph(sources, destinations, weights) # from list of edges
```
Use `methods(SimpleWeightedDiGraph)` for the full list of constructors.
When building a new graph from a list of edges, you must avoid repeating `(src, dst)` pairs in the list: this can lead to undefined behavior.
When building a new graph from a list of edges, be aware that repeating `(src, dst)` pairs may lead to undefined behavior (e.g. due to floating point errors during weight addition).
"""
mutable struct SimpleWeightedDiGraph{T<:Integer,U<:Real} <: AbstractSimpleWeightedGraph{T,U}
weights::SparseMatrixCSC{U,T}
Expand Down
2 changes: 1 addition & 1 deletion src/simpleweightedgraph.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ SimpleWeightedGraph(adjmx) # from adjacency matrix
SimpleWeightedGraph(sources, destinations, weights) # from list of edges
```
Use `methods(SimpleWeightedGraph)` for the full list of constructors.
When building a new graph from a list of edges, you must avoid repeating `(src, dst)` pairs in the list: this can lead to undefined behavior.
When building a new graph from a list of edges, be aware that repeating `(src, dst)` pairs may lead to undefined behavior (e.g. due to floating point errors during weight addition).
"""
mutable struct SimpleWeightedGraph{T<:Integer,U<:Real} <: AbstractSimpleWeightedGraph{T,U}
weights::SparseMatrixCSC{U,T}
Expand Down

0 comments on commit 8788527

Please sign in to comment.