Skip to content

Commit 2c4d157

Browse files
authored
Update graphs.jl
1 parent ddf5819 commit 2c4d157

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/graphs.jl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using Graphs, OMEinsumContractionOrders, StatsBase
1+
using Graphs, OMEinsumContractionOrders
2+
import StatsBase
23

34
"""
45
is_independent_set(g::SimpleGraph, vertices)
@@ -28,7 +29,7 @@ function random_diagonal_coupled_graph(m::Int, n::Int, ρ::Real)
2829
end
2930
function generate_mask(Nx::Int, Ny::Int, natoms::Int)
3031
mask = zeros(Bool, Nx, Ny)
31-
mask[sample(1:Nx*Ny, natoms; replace=false)] .= true
32+
mask[StatsBase.sample(1:Nx*Ny, natoms; replace=false)] .= true
3233
return mask
3334
end
3435

@@ -56,4 +57,4 @@ function unitdisk_graph(locs::AbstractVector, unit::Real)
5657
end
5758
end
5859
return g
59-
end
60+
end

0 commit comments

Comments
 (0)