Skip to content

Commit a003609

Browse files
committed
Import functions from LightGraphs
1 parent 2bec309 commit a003609

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

src/lg/core.jl

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
using LightGraphs
2-
import LightGraphs: AbstractGraph
2+
3+
import LightGraphs: AbstractGraph, add_edge!, rem_edge!, add_vertex!, add_vertices!,
4+
rem_vertex!, zero, is_directed
5+
6+
export StingerLG
37

48
type StingerLG{T} <: AbstractGraph
59
s::Stinger
@@ -46,3 +50,7 @@ end
4650
function zero(s::StingerLG)
4751
StingerLG(Stinger(), 0)
4852
end
53+
54+
is_directed(g::StingerLG) = true
55+
is_directed(::Type{StingerLG}) = true
56+
is_directed(g::Type{StingerLG{T}}) where T = true

src/lg/edges.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ function convert(::Type{Tuple}, edge::StingerLGEdge)
5050
end
5151
end
5252

53+
StingerLGEdge(t::Tuple) = StingerLGEdge(t[1], t[2], 2, 0, 0, 0)
54+
StingerLGEdge(p::Pair) = StingerLGEdge(p.first, p.second, 2, 0, 0, 0)
55+
5356
function createedge(rawedge::StingerEdge, src::Int64)
5457
direction, neighbor = edgeparse(rawedge)
5558
StingerLGEdge(

src/lg/state.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import LightGraphs: nv, ne, vertices, edges, neighbors, in_neighbors, out_neighbors, hasvertex, hasedge
2+
13
function nv(g::StingerLG)
24
g.nv
35
end

0 commit comments

Comments
 (0)