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

Commit 2c9fb76

Browse files
committed
Rename default_sampling_algo to defaultalgo
1 parent 4158826 commit 2c9fb76

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

src/processes.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,16 @@ Generate `n` realizations of spatial point process `p`
2323
inside geometry or domain `g`. Optionally specify sampling
2424
algorithm `algo` and random number generator `rng`.
2525
"""
26-
Base.rand(rng::Random.AbstractRNG, p::PointProcess, g, n::Int; algo=default_sampling_algorithm(p, g)) =
26+
Base.rand(rng::Random.AbstractRNG, p::PointProcess, g, n::Int; algo=defaultalgo(p, g)) =
2727
[randsingle(rng, p, g, algo) for i in 1:n]
2828

29-
Base.rand(rng::Random.AbstractRNG, p::PointProcess, g; algo=default_sampling_algorithm(p, g)) =
29+
Base.rand(rng::Random.AbstractRNG, p::PointProcess, g; algo=defaultalgo(p, g)) =
3030
randsingle(rng, p, g, algo)
3131

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

35-
Base.rand(p::PointProcess, g; algo=default_sampling_algorithm(p, g)) = rand(Random.GLOBAL_RNG, p, g; algo=algo)
35+
Base.rand(p::PointProcess, g; algo=defaultalgo(p, g)) = rand(Random.GLOBAL_RNG, p, g; algo=algo)
3636

3737
"""
3838
randsingle(rng, p, g, algo)
@@ -43,12 +43,12 @@ Generate a single realization of spatial point process
4343
function randsingle end
4444

4545
"""
46-
default_sampling_algorithm(p, g)
46+
defaultalgo(p, g)
4747
4848
Default sampling algorithm for spatial point process `p`
4949
on geometry or domain `g`.
5050
"""
51-
function default_sampling_algorithm end
51+
function defaultalgo end
5252

5353
# -------------------------
5454
# POINT PATTERN ALGORITHMS

src/processes/binomial.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ end
1313

1414
ishomogeneous(p::BinomialProcess) = true
1515

16-
default_sampling_algorithm(::BinomialProcess, ::Any) = ConstantIntensity()
16+
defaultalgo(::BinomialProcess, ::Any) = ConstantIntensity()
1717

1818
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
@@ -29,7 +29,7 @@ end
2929
ClusterProcess(p::PointProcess, o::PointProcess, gfun::Function) =
3030
ClusterProcess(p, parent -> rand(o, gfun(parent)))
3131

32-
default_sampling_algorithm(::ClusterProcess, ::Any) = nothing
32+
defaultalgo(::ClusterProcess, ::Any) = nothing
3333

3434
function randsingle(rng::Random.AbstractRNG, p::ClusterProcess, g, ::Nothing)
3535
# retrieve parameters

src/processes/poisson.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ ishomogeneous(p::PoissonProcess{<:Function}) = false
2121

2222
ishomogeneous(p::PoissonProcess{<:AbstractVector}) = false
2323

24-
default_sampling_algorithm(::PoissonProcess, ::Any) = ConstantIntensity()
24+
defaultalgo(::PoissonProcess, ::Any) = ConstantIntensity()
2525

26-
default_sampling_algorithm(p::PoissonProcess{<:Function}, g) = LewisShedler(default_lambda_max(p, g))
26+
defaultalgo(p::PoissonProcess{<:Function}, g) = LewisShedler(default_lambda_max(p, g))
2727

2828
function default_lambda_max(p::PoissonProcess{<:Function}, g)
2929
points = sample(g, HomogeneousSampling(10000))

src/processes/union.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ end
1414

1515
ishomogeneous(p::UnionProcess) = ishomogeneous(p.p₁) && ishomogeneous(p.p₂)
1616

17-
default_sampling_algorithm(::UnionProcess, ::Any) = nothing
17+
defaultalgo(::UnionProcess, ::Any) = nothing
1818

1919
function randsingle(rng::Random.AbstractRNG, p::UnionProcess, g, ::Nothing)
2020
pp₁ = rand(rng, p.p₁, g)

0 commit comments

Comments
 (0)