Skip to content

Commit d7b4d47

Browse files
committed
corrected nv name conflict
1 parent b6414a0 commit d7b4d47

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

src/staticdigraph.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ end
2424
ne(g::StaticDiGraph{T, U}) where T where U = U(length(g.f_vec))
2525

2626
# 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}
2828
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]
3131
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]
3333
push!(b_ind, length(b_ss)+1)
3434
T = mintype(f_ds)
3535
U = mintype(f_ind)
@@ -42,13 +42,13 @@ function StaticDiGraph(nv::I, f_ss::AbstractVector, f_ds::AbstractVector, b_ss::
4242
end
4343

4444
# 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}
4646
f_ss = [x[1] for x in f_sd]
4747
f_ds = [x[2] for x in f_sd]
4848
b_ss = [x[1] for x in b_sd]
4949
b_ds = [x[2] for x in b_sd]
5050

51-
return StaticDiGraph(nv, f_ss, f_ds, b_ss, b_ds)
51+
return StaticDiGraph(nvtx, f_ss, f_ds, b_ss, b_ds)
5252
end
5353

5454
function StaticDiGraph(g::LightGraphs.SimpleGraphs.SimpleDiGraph)

src/staticgraph.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,21 @@ end
1212

1313
# sorted src, dst vectors
1414
# note: this requires reverse edges included in the sorted vector.
15-
function StaticGraph(nv::I, ss::AbstractVector, ds::AbstractVector) where {I<:Integer}
15+
function StaticGraph(nvtx::I, ss::AbstractVector, ds::AbstractVector) where {I<:Integer}
1616
length(ss) != length(ds) && error("source and destination vectors must be equal length")
17-
(nv == 0 || length(ss) == 0) && return StaticGraph(UInt8[], UInt8[1])
18-
f_ind = [searchsortedfirst(ss, x) for x in 1:nv]
17+
(nvtx == 0 || length(ss) == 0) && return StaticGraph()
18+
f_ind = [searchsortedfirst(ss, x) for x in 1:nvtx]
1919
push!(f_ind, length(ss)+1)
2020
T = mintype(ds)
2121
U = mintype(f_ind)
2222
return StaticGraph{T, U}(convert(Vector{T},ds), convert(Vector{U}, f_ind))
2323
end
2424

2525
# sorted src, dst tuples
26-
function StaticGraph(nv::I, sd::Vector{Tuple{T, T}}) where {T<:Integer, I<:Integer}
26+
function StaticGraph(nvtx::I, sd::Vector{Tuple{T, T}}) where {T<:Integer, I<:Integer}
2727
ss = [x[1] for x in sd]
2828
ds = [x[2] for x in sd]
29-
return StaticGraph(nv, ss, ds)
29+
return StaticGraph(nvtx, ss, ds)
3030
end
3131

3232
function StaticGraph(g::LightGraphs.SimpleGraphs.SimpleGraph)

0 commit comments

Comments
 (0)