Skip to content

Commit 43a502f

Browse files
committed
Add warning info when parameters do not fit with theory in hard core models
1 parent 77ed4d4 commit 43a502f

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

src/graph/hard_core.jl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ In other words, it can also be viewed as the product distribution ``\operatornam
1616
**See also**
1717
1818
- Section 7.2 of [GuJeLi19](@cite),
19-
- Example 4.1 of [MoKr20](@ref),
19+
- Example 4.1 of [MoKr20](@cite),
2020
- [`PRS.HardCorePointProcess`](@ref), the spatial counterpart of [`PRS.HardCoreGraph`](@ref).
2121
2222
# Example
@@ -116,8 +116,7 @@ function generate_sample_prs(
116116

117117
β_max = 1 / (2 * sqrt(exp(1)) * LG.Δ(pp.graph) - 1)
118118
if pp.β > β_max
119-
@warn "The arguments do not satisfy Theorem 35 of Guo, Jerrum and Liu (2019): partial rejection sampling may not be efficient.
120-
Given `graph`, consider choosing β ≤ $(β_max)"
119+
@warn "The arguments do not satisfy Theorem 35 of Guo, Jerrum and Liu (2019).\nPartial rejection sampling may not be efficient.\nGiven `graph`, consider choosing β ≤ $(β_max)"
121120
end
122121

123122
proba = pp.β / (one(pp.β) + pp.β)

src/spatial/hard_core.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,7 @@ function generate_sample_prs(
203203

204204
β_max = 0.21027 / volume(BallWindow(zeros(dimension(win_)), r/2))
205205
if β > β_max
206-
@warn "The arguments do not satisfy Lemma 6 of Guo and Jerrum (2018): partial rejection sampling may not be efficient.
207-
Given the interaction range `pp.r`, consider choosing β ≤ $(β_max)"
206+
@warn "The arguments do not satisfy Lemma 6 of Guo and Jerrum (2018).\nPartial rejection sampling may not be efficient.\nGiven the interaction range `pp.r`, consider choosing β ≤ $(β_max)"
208207
end
209208

210209
points = generate_sample(rng, HomogeneousPoissonPointProcess(β, win_))

0 commit comments

Comments
 (0)