QInchworm.scrambled_sobol
QInchworm.scrambled_sobol
— ModuleThis module contains a modified and extended version of Sobol.jl
's code written by Steven G. Johnson.
The extensions include those mentioned in Sobol.jl issue #31.
- Support for scrambled Sobol points (implementation of the scrambling is taken from SciPy).
- Inclusion of the initial point in the Sobol sequence.
skip!(... ; exact=false)
now skips $2^m$ points.
QInchworm.scrambled_sobol.ScrambledSobolSeq
— Typemutable struct ScrambledSobolSeq{D}
Scrambled Sobol low-discrepancy sequence of dimension D
.
Fields
m::Matrix{UInt32}
: Direction numbers, array of size (D
, 32)x::Vector{UInt32}
: Previous sequence point $x = x_n$, array of lengthD
n::UInt32
: Number of sequence points generated so far
QInchworm.scrambled_sobol.ScrambledSobolSeq
— MethodScrambledSobolSeq(
D::Int64;
scramble_rng
) -> QInchworm.scrambled_sobol.ScrambledSobolSeq
Create a scrambled Sobol sequence of dimension D
using the Random Number Generator scramble_rng
to generate scrambling parameters. The sequence remains unscrambled if no RNG is provided.
Base.ndims
— Methodndims(
s::QInchworm.scrambled_sobol.ScrambledSobolSeq{D}
) -> Int64
Dimension D
of a scrambled Sobol sequence.
ndims(s::QInchworm.utility.RandomSeq{RNG, D}) -> Int64
Dimension D
of a random sequence.
ndims(
_::QInchworm.qmc_integrate.AbstractDomainTransform{D}
) -> Any
Return the number of dimensions $d$ of a domain transformation $[0, 1]^d \mapsto \mathscr{D}$.
QInchworm.scrambled_sobol.next!
— Functionnext!(
s::QInchworm.scrambled_sobol.ScrambledSobolSeq,
x::AbstractVector{<:AbstractFloat}
) -> AbstractVector{<:AbstractFloat}
Generate the next point $\mathbf{x}\in[0, 1]^D$ of the sequence s
and write it into the array x
.
next!(
s::QInchworm.scrambled_sobol.ScrambledSobolSeq
) -> Vector{Float64}
Generate and return the next point $\mathbf{x}\in[0, 1]^D$ of the sequence s
.
next!(
s::QInchworm.utility.RandomSeq,
x::AbstractVector{<:AbstractFloat}
) -> AbstractVector{<:AbstractFloat}
Generate the next point $\mathbf{x}\in[0, 1)^D$ of the random sequence s
and write it into the array x
.
next!(s::QInchworm.utility.RandomSeq) -> Vector{Float64}
Generate and return the next point $\mathbf{x}\in[0, 1)^D$ of the sequence s
.
QInchworm.scrambled_sobol.skip!
— Functionskip!(
s::QInchworm.scrambled_sobol.ScrambledSobolSeq,
n::Integer,
x;
exact
) -> QInchworm.scrambled_sobol.ScrambledSobolSeq
Skip a number of points in the sequence s
using a preallocated buffer x
.
skip!(s, n, x)
skips the next $2^m$ points such that $2^m < n \leq 2^{m+1}$.skip!(s, n, x, exact=true)
skips the next $n$ points.
skip!(
s::QInchworm.scrambled_sobol.ScrambledSobolSeq,
n::Integer;
exact
) -> QInchworm.scrambled_sobol.ScrambledSobolSeq
Skip a number of points in the sequence s
.
skip!(s, n)
skips the next $2^m$ points such that $2^m < n \leq 2^{m+1}$.skip!(s, n, exact=true)
skips the next $n$ points.
skip!(
s::QInchworm.utility.RandomSeq,
n::Integer,
x;
exact
) -> QInchworm.utility.RandomSeq
Skip a number of points in the random sequence s
using a preallocated buffer x
.
skip!(s, n, x)
skips the next $2^m$ points such that $2^m < n \leq 2^{m+1}$.skip!(s, n, x, exact=true)
skips the next $n$ points.
skip!(
s::QInchworm.utility.RandomSeq,
n::Integer;
exact
) -> QInchworm.utility.RandomSeq
Skip a number of points in the random sequence s
.
skip!(s, n)
skips the next $2^m$ points such that $2^m < n \leq 2^{m+1}$.skip!(s, n, exact=true)
skips the next $n$ points.