Skip to content

Commit 6390709

Browse files
committed
Splitting graph/utils.jl to include some functions only when necessary
1 parent 7131803 commit 6390709

File tree

4 files changed

+18
-17
lines changed

4 files changed

+18
-17
lines changed

src/GeometricFlux.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,6 @@ function __init__()
140140
end
141141
@require SimpleWeightedGraphs = "47aef6b3-ad0c-573a-a1e2-d07658019622" begin
142142
include("graph/weightedgraphs.jl")
143-
include("graph/utils.jl")
144143
end
145144
@require MetaGraphs = "626554b9-1ddb-594c-aa3c-2596fe9399a5" begin
146145
include("graph/metagraphs.jl")

src/graph/simplegraphs.jl

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
1-
using LightGraphs: AbstractSimpleGraph, nv, adjacency_matrix, inneighbors, outneighbors, all_neighbors
1+
using LightGraphs: AbstractSimpleGraph, nv, inneighbors, outneighbors, all_neighbors
22
import LightGraphs: adjacency_matrix
33

4+
## Utils for AbstractSimpleGraph
5+
6+
function adjlist(g::AbstractSimpleGraph)
7+
N = nv(g)
8+
el = Vector{Int}[outneighbors(g, i) for i = 1:N]
9+
return el
10+
end
11+
12+
413
## Linear algebra API for AbstractSimpleGraph
514

615
function degrees(sg::AbstractSimpleGraph, T::DataType=eltype(sg); dir::Symbol=:out)

src/graph/utils.jl

Lines changed: 0 additions & 14 deletions
This file was deleted.

src/graph/weightedgraphs.jl

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
1-
using SimpleWeightedGraphs: AbstractSimpleWeightedGraph, nv
1+
using SimpleWeightedGraphs: AbstractSimpleWeightedGraph, nv, outneighbors
22

3+
## Utils for AbstractSimpleWeightedGraph
4+
5+
function adjlist(g::AbstractSimpleWeightedGraph)
6+
N = nv(g)
7+
el = Vector{Int}[outneighbors(g, i) for i = 1:N]
8+
return el
9+
end
310

411
## Linear algebra API for AbstractSimpleWeightedGraph
512

0 commit comments

Comments
 (0)