@@ -77,8 +77,12 @@ function generate_sample_prs(
7777 rng = getRNG (rng)
7878 window_ = win === nothing ? window (hc) : win
7979
80- n = rand (rng, Distributions. Poisson (hc. β))
81- points = hcat ((rand (window_; rng= rng) for _ in 1 : n). .. )
80+ n = rand (rng, Distributions. Poisson (hc. β * volume (window_)))
81+ points = Matrix {Float64} (undef, dimension (hc), n)
82+ for x in eachcol (points)
83+ x .= rand (window_; rng= rng)
84+ end
85+
8286 while true
8387 bad = vec (any (pairwise_distances (points) .< hc. r, dims= 2 ))
8488 ! any (bad) && break
@@ -155,11 +159,11 @@ Pairwise distance matrix between columns of `X` and `Y`.
155159Equivalent to `[norm(x - y) for x in X, y in Y]`.
156160"""
157161function pairwise_distances (X, Y)
158- return Distances. pairwise (Distances. Euclidean (1e-8 ), X, Y, dims= 2 )
162+ return Distances. pairwise (Distances. Euclidean (1e-8 ), X, Y; dims= 2 )
159163end
160164
161165function pairwise_distances (X)
162- dist = Distances. pairwise (Distances. Euclidean (1e-8 ), X, dims= 2 )
166+ dist = Distances. pairwise (Distances. Euclidean (1e-8 ), X; dims= 2 )
163167 dist[LA. diagind (dist)] .= Inf
164168 return dist
165169end
0 commit comments