Skip to content

Commit de09057

Browse files
authored
Bug fix: Degree matrix build as sparse directly
- The previous implementation builds an intermediate dense matrix for `degree_matrix` formation.
1 parent e500596 commit de09057

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)