Skip to content
This repository was archived by the owner on Nov 6, 2023. It is now read-only.

Commit 4158826

Browse files
committed
Rename rand_single -> randsingle
1 parent ed1e69e commit 4158826

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

src/processes.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,23 +24,23 @@ inside geometry or domain `g`. Optionally specify sampling
2424
algorithm `algo` and random number generator `rng`.
2525
"""
2626
Base.rand(rng::Random.AbstractRNG, p::PointProcess, g, n::Int; algo=default_sampling_algorithm(p, g)) =
27-
[rand_single(rng, p, g, algo) for i in 1:n]
27+
[randsingle(rng, p, g, algo) for i in 1:n]
2828

2929
Base.rand(rng::Random.AbstractRNG, p::PointProcess, g; algo=default_sampling_algorithm(p, g)) =
30-
rand_single(rng, p, g, algo)
30+
randsingle(rng, p, g, algo)
3131

3232
Base.rand(p::PointProcess, g, n::Int; algo=default_sampling_algorithm(p, g)) =
3333
rand(Random.GLOBAL_RNG, p, g, n; algo=algo)
3434

3535
Base.rand(p::PointProcess, g; algo=default_sampling_algorithm(p, g)) = rand(Random.GLOBAL_RNG, p, g; algo=algo)
3636

3737
"""
38-
rand_single(rng, p, g, algo)
38+
randsingle(rng, p, g, algo)
3939
4040
Generate a single realization of spatial point process
4141
`p` inside geometry or domain `g` with sampling `algo`.
4242
"""
43-
function rand_single end
43+
function randsingle end
4444

4545
"""
4646
default_sampling_algorithm(p, g)

src/processes/binomial.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ ishomogeneous(p::BinomialProcess) = true
1515

1616
default_sampling_algorithm(::BinomialProcess, ::Any) = ConstantIntensity()
1717

18-
rand_single(rng::Random.AbstractRNG, p::BinomialProcess, g, ::ConstantIntensity) =
18+
randsingle(rng::Random.AbstractRNG, p::BinomialProcess, g, ::ConstantIntensity) =
1919
PointSet(sample(rng, g, HomogeneousSampling(p.n)))

src/processes/cluster.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ ClusterProcess(p::PointProcess, o::PointProcess, gfun::Function) =
3131

3232
default_sampling_algorithm(::ClusterProcess, ::Any) = nothing
3333

34-
function rand_single(rng::Random.AbstractRNG, p::ClusterProcess, g, ::Nothing)
34+
function randsingle(rng::Random.AbstractRNG, p::ClusterProcess, g, ::Nothing)
3535
# retrieve parameters
3636
Dim = embeddim(g)
3737
T = coordtype(g)

src/processes/poisson.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ end
3535
# HOMOGENEOUS CASE
3636
#------------------
3737

38-
function rand_single(rng::Random.AbstractRNG, p::PoissonProcess{<:Real}, g, ::ConstantIntensity)
38+
function randsingle(rng::Random.AbstractRNG, p::PoissonProcess{<:Real}, g, ::ConstantIntensity)
3939
# simulate number of points
4040
λ = p.λ
4141
V = measure(g)
@@ -49,18 +49,18 @@ end
4949
# INHOMOGENEOUS CASE
5050
#--------------------
5151

52-
function rand_single(rng::Random.AbstractRNG, p::PoissonProcess{<:Function}, g, algo::LewisShedler)
52+
function randsingle(rng::Random.AbstractRNG, p::PoissonProcess{<:Function}, g, algo::LewisShedler)
5353
# simulate a homogeneous process
54-
pp = rand_single(rng, PoissonProcess(algo.λmax), g, ConstantIntensity())
54+
pp = randsingle(rng, PoissonProcess(algo.λmax), g, ConstantIntensity())
5555

5656
# thin point pattern
5757
isnothing(pp) ? nothing : PointSet(collect(thin(pp, RandomThinning(x -> p.λ(x) / algo.λmax))))
5858
end
5959

60-
rand_single(rng::Random.AbstractRNG, p::PoissonProcess{<:Function}, d::Domain, algo::ConstantIntensity) =
61-
rand_single(rng, PoissonProcess(p.λ.(centroid.(d))), d, algo)
60+
randsingle(rng::Random.AbstractRNG, p::PoissonProcess{<:Function}, d::Domain, algo::ConstantIntensity) =
61+
randsingle(rng, PoissonProcess(p.λ.(centroid.(d))), d, algo)
6262

63-
function rand_single(rng::Random.AbstractRNG, p::PoissonProcess{<:AbstractVector}, d::Domain, algo::ConstantIntensity)
63+
function randsingle(rng::Random.AbstractRNG, p::PoissonProcess{<:AbstractVector}, d::Domain, algo::ConstantIntensity)
6464
# simulate number of points
6565
λ = p.λ
6666
V = measure.(d)

src/processes/union.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ ishomogeneous(p::UnionProcess) = ishomogeneous(p.p₁) && ishomogeneous(p.p₂)
1616

1717
default_sampling_algorithm(::UnionProcess, ::Any) = nothing
1818

19-
function rand_single(rng::Random.AbstractRNG, p::UnionProcess, g, ::Nothing)
19+
function randsingle(rng::Random.AbstractRNG, p::UnionProcess, g, ::Nothing)
2020
pp₁ = rand(rng, p.p₁, g)
2121
pp₂ = rand(rng, p.p₂, g)
2222
PointSet([collect(pp₁); collect(pp₂)])

0 commit comments

Comments
 (0)