Skip to content

Commit cc12736

Browse files
committed
use mutable on object rather than on datatype
1 parent 574897a commit cc12736

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/Experimental/ShortestPaths/johnson.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ function shortest_paths(g::AbstractGraph{U}, distmx::AbstractMatrix{T}, ::Johnso
2626
#Change when parallel implementation of Bellman Ford available
2727
wt_transform = Graphs.Experimental.ShortestPaths.dists(shortest_paths(g, vertices(g), distmx, BellmanFord()))
2828

29-
if !ismutable(type_distmx) && type_distmx != Graphs.DefaultDistance
29+
if !ismutable(distmx) && type_distmx != Graphs.DefaultDistance
3030
distmx = sparse(distmx) #Change reference, not value
3131
end
3232

@@ -51,7 +51,7 @@ function shortest_paths(g::AbstractGraph{U}, distmx::AbstractMatrix{T}, ::Johnso
5151
dists[:, v] .+= wt_transform[v] #Vertical traversal prefered
5252
end
5353

54-
if ismutable(type_distmx)
54+
if ismutable(distmx)
5555
for e in edges(g)
5656
distmx[src(e), dst(e)] += wt_transform[dst(e)] - wt_transform[src(e)]
5757
end

src/Parallel/shortestpaths/johnson.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ distmx::AbstractMatrix{T}=weights(g)) where T <: Real where U <: Integer
66
#Change when parallel implementation of Bellman Ford available
77
wt_transform = bellman_ford_shortest_paths(g, vertices(g), distmx).dists
88

9-
if !ismutable(type_distmx) && type_distmx != Graphs.DefaultDistance
9+
if !ismutable(distmx) && type_distmx != Graphs.DefaultDistance
1010
distmx = sparse(distmx) #Change reference, not value
1111
end
1212

@@ -28,7 +28,7 @@ distmx::AbstractMatrix{T}=weights(g)) where T <: Real where U <: Integer
2828
dists[:, v] .+= wt_transform[v] #Vertical traversal prefered
2929
end
3030

31-
if ismutable(type_distmx)
31+
if ismutable(distmx)
3232
for e in edges(g)
3333
distmx[src(e), dst(e)] += wt_transform[dst(e)] - wt_transform[src(e)]
3434
end

src/shortestpaths/johnson.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ function johnson_shortest_paths(g::AbstractGraph{U},
3030
#Change when parallel implementation of Bellman Ford available
3131
wt_transform = bellman_ford_shortest_paths(g, vertices(g), distmx).dists
3232

33-
if !ismutable(type_distmx) && type_distmx != Graphs.DefaultDistance
33+
if !ismutable(distmx) && type_distmx != Graphs.DefaultDistance
3434
distmx = sparse(distmx) #Change reference, not value
3535
end
3636

@@ -55,7 +55,7 @@ function johnson_shortest_paths(g::AbstractGraph{U},
5555
dists[:, v] .+= wt_transform[v] #Vertical traversal prefered
5656
end
5757

58-
if ismutable(type_distmx)
58+
if ismutable(distmx)
5959
for e in edges(g)
6060
distmx[src(e), dst(e)] += wt_transform[dst(e)] - wt_transform[src(e)]
6161
end

0 commit comments

Comments
 (0)