diff --git a/src/network/advanced.jl b/src/network/advanced.jl index 0bfdb47..70e3040 100644 --- a/src/network/advanced.jl +++ b/src/network/advanced.jl @@ -26,7 +26,7 @@ function compute_advanced_data(data::NetworkData{T,V}, idx = findfirst(x -> x < 1, j) idx != nothing && throw("Indices no good") - m = max(i[end], j[end]) + m = max(maximum(i), maximum(j)) A = sparse(i,j,v,m,m) A = A + A' diff --git a/src/network/pairwise.jl b/src/network/pairwise.jl index 0ab890b..7997d25 100644 --- a/src/network/pairwise.jl +++ b/src/network/pairwise.jl @@ -42,7 +42,7 @@ function compute_graph_data(data::NetworkData{T,V}, cfg)::GraphProblem{T,V} wher idx = findfirst(x -> x < 1, j) idx != nothing && throw("Indices no good") - m = max(i[end], j[end]) + m = max(maximum(i), maximum(j)) A = sparse(i,j,v,m,m) A = A + A'