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

Commit

Permalink
Merge pull request #20 from JuliaGraphs/sbromberger/out_in_edges
Browse files Browse the repository at this point in the history
remove all references to out_/in_edges
  • Loading branch information
sbromberger authored Mar 7, 2018
2 parents 5dfb32d + dffeda8 commit 2c54093
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 20 deletions.
20 changes: 1 addition & 19 deletions src/SimpleWeightedGraphs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import LightGraphs:
_NI, _insert_and_dedup!, AbstractGraph, AbstractEdge, AbstractEdgeIter,
src, dst, edgetype, nv, ne, vertices, edges, is_directed,
add_vertex!, add_edge!, rem_vertex!, rem_edge!,
has_vertex, has_edge, inneighbors, outneighbors, out_edges, in_edges,
has_vertex, has_edge, inneighbors, outneighbors,
indegree, outdegree, degree, has_self_loops, num_self_loops,

add_vertices!, adjacency_matrix, weights, connected_components,
Expand All @@ -28,8 +28,6 @@ export
weight,
weighttype,
get_weight,
out_edges,
in_edges,
WGraph,
WDiGraph,
SWGFormat
Expand Down Expand Up @@ -125,22 +123,6 @@ end

get_weight(g::AbstractSimpleWeightedGraph, u::Integer, v::Integer) = g.weights[v, u]

function out_edges(g::AbstractSimpleWeightedGraph, u::Integer)
T = eltype(g)
mat = g.weights
neighs = outneighbors(g, u)
return [SimpleWeightedEdge(T(u), v, get_weight(g, u, v)) for v in neighs]
end

function in_edges(g::AbstractSimpleWeightedGraph, v::Integer)
T = eltype(g)
mat = g.weights
neighs = inneighbors(g, v)
return [SimpleWeightedEdge(u, T(v), get_weight(g, u, v)) for u in neighs]
end



zero(g::T) where T<:AbstractSimpleWeightedGraph = T()

# TODO: manipulte SparseMatrixCSC directly
Expand Down
1 change: 0 additions & 1 deletion test/simpleweightedgraph.jl
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ importall SimpleWeightedGraphs
@test @inferred(nv(g)) == 4
@test @inferred(outneighbors(g)) == inneighbors(g)
@test @inferred(outneighbors(g,2)) == inneighbors(g,2) == neighbors(g,2)
@test @inferred(out_edges(g, 2)) == reverse.(in_edges(g, 2))
@test @inferred(has_edge(g, 2, 3))
@test @inferred(has_edge(g, 3, 2))

Expand Down

0 comments on commit 2c54093

Please sign in to comment.