Skip to content

Commit 7cdd286

Browse files
authored
Merge pull request #15 from fcdimitr/patch-1
Bug fix: Degree matrix build as sparse directly
2 parents fa2d38c + de09057 commit 7cdd286

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/overrides.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ function degree_matrix(g::AbstractSimpleWeightedGraph, T::DataType=weighttype(g)
2424
else
2525
d = vec(sum(g.weights, dims=1))
2626
end
27-
return SparseMatrixCSC(T.(diagm(0=>d)))
27+
return spdiagm( 0 => T.(d) )
2828
end
2929

3030
function adjacency_matrix(g::AbstractSimpleWeightedGraph, T::DataType=weighttype(g); dir::Symbol=:out)

0 commit comments

Comments
 (0)