24
24
ne (g:: StaticDiGraph{T, U} ) where T where U = U (length (g. f_vec))
25
25
26
26
# sorted src, dst vectors for forward and backward edgelists.
27
- function StaticDiGraph (nv :: I , f_ss:: AbstractVector , f_ds:: AbstractVector , b_ss:: AbstractVector , b_ds:: AbstractVector ) where {I<: Integer }
27
+ function StaticDiGraph (nvtx :: I , f_ss:: AbstractVector , f_ds:: AbstractVector , b_ss:: AbstractVector , b_ds:: AbstractVector ) where {I<: Integer }
28
28
length (f_ss) == length (f_ds) == length (b_ss) == length (b_ds) || error (" source and destination vectors must be equal length" )
29
- (nv == 0 || length (f_ss) == 0 ) && return StaticDiGraph (UInt8[], UInt8[1 ], UInt8[], UInt8[1 ])
30
- f_ind = [searchsortedfirst (f_ss, x) for x in 1 : nv ]
29
+ (nvtx == 0 || length (f_ss) == 0 ) && return StaticDiGraph (UInt8[], UInt8[1 ], UInt8[], UInt8[1 ])
30
+ f_ind = [searchsortedfirst (f_ss, x) for x in 1 : nvtx ]
31
31
push! (f_ind, length (f_ss)+ 1 )
32
- b_ind = [searchsortedfirst (b_ss, x) for x in 1 : nv ]
32
+ b_ind = [searchsortedfirst (b_ss, x) for x in 1 : nvtx ]
33
33
push! (b_ind, length (b_ss)+ 1 )
34
34
T = mintype (f_ds)
35
35
U = mintype (f_ind)
@@ -42,13 +42,13 @@ function StaticDiGraph(nv::I, f_ss::AbstractVector, f_ds::AbstractVector, b_ss::
42
42
end
43
43
44
44
# sorted src, dst tuples for forward and backward
45
- function StaticDiGraph (nv :: I , f_sd:: Vector{Tuple{T, T}} , b_sd:: Vector{Tuple{T, T}} ) where {T<: Integer ,I<: Integer }
45
+ function StaticDiGraph (nvtx :: I , f_sd:: Vector{Tuple{T, T}} , b_sd:: Vector{Tuple{T, T}} ) where {T<: Integer ,I<: Integer }
46
46
f_ss = [x[1 ] for x in f_sd]
47
47
f_ds = [x[2 ] for x in f_sd]
48
48
b_ss = [x[1 ] for x in b_sd]
49
49
b_ds = [x[2 ] for x in b_sd]
50
50
51
- return StaticDiGraph (nv , f_ss, f_ds, b_ss, b_ds)
51
+ return StaticDiGraph (nvtx , f_ss, f_ds, b_ss, b_ds)
52
52
end
53
53
54
54
function StaticDiGraph (g:: LightGraphs.SimpleGraphs.SimpleDiGraph )
0 commit comments