@@ -24,9 +24,13 @@ This is an independent implementation, originally by Steven G. Johnson, of the
2424algorithm for generation of Sobol sequences in up to 21201 dimensions
2525described in:
2626
27- * P. Bratley and B. L. Fox, Algorithm 659, * ACM Trans. Math. Soft.*
28- ** 14** (1), pp. 88-100 (1988).
29- * S. Joe and F. Y. Kuo, * ACM Trans. Math. Soft* ** 29** (1), 49-57 (2003).
27+ * P. Bratley and B. L. Fox, [ Algorithm 659: Implementing Sobol's quasirandom sequence generator] [ bratley88 ] ,
28+ * ACM Trans. Math. Soft.* ** 14** (1), pp. 88-100 (1988), [ doi:10.1145/42288.214372] [ bratley88 ] .
29+ * S. Joe and F. Y. Kuo, [ Remark on algorithm 659: Implementing Sobol's quasirandom sequence generator] [ joe03 ] ,
30+ * ACM Trans. Math. Soft* ** 29** (1), 49-57 (2003), [ doi:10.1145/641876.641879] [ joe03 ] .
31+
32+ [ bratley88 ] : https://dl.acm.org/citation.cfm?id=214372
33+ [ joe03 ] : https://dl.acm.org/citation.cfm?id=641879
3034
3135Originally implemented in C in 2007 as
3236[ part of] ( https://github.com/stevengj/nlopt/blob/master/util/sobolseq.c ) the
@@ -58,24 +62,24 @@ In practical applications, however, this point is rarely reached.
5862
5963To initialize a Sobol sequence ` s ` in ` N ` dimensions (` 0 < N < 21201 ` ), use
6064the ` SobolSeq ` constructor:
61- ```
65+ ``` julia
6266using Sobol
6367s = SobolSeq (N)
6468```
6569Then
66- ```
70+ ``` julia
6771x = next! (s)
6872```
6973returns the next point (a ` Vector{Float64} ` ) in the sequence; each point
7074lies in the hypercube [ 0,1] <sup >N</sup >. You can also compute the next
7175point in-place with
72- ```
76+ ``` julia
7377next! (s, x)
7478```
7579where ` x ` should be a ` Vector ` of length ` N ` of some floating-point type (e.g. ` Float64 ` , ` Float32 ` , or ` BigFloat ` ).
7680
7781You can also use a ` SobolSeq ` as an iterator in Julia:
78- ```
82+ ``` julia
7983for x in SobolSeq (N)
8084 ...
8185end
@@ -85,7 +89,7 @@ call `break` (or similar) in the loop body at some point of your choosing.
8589
8690We also provide a different ` SobolSeq ` constructor to provide
8791an ` N ` -dimensional Sobol sequence rescaled to an arbitrary hypercube:
88- ```
92+ ``` julia
8993s = SobolSeq (lb, ub)
9094```
9195where ` lb ` and ` ub ` are arrays (or other iterables) of length ` N ` , giving
@@ -95,15 +99,15 @@ the lower and upper bounds of the hypercube, respectively. For example,
9599If you know in advance the number ` n ` of points that you plan to
96100generate, some authors suggest that better uniformity can be attained
97101by first skipping the initial portion of the LDS (and in particular,
98- the first power of two smaller than ` n ` ; see Joe and Kuo, 2003). This
102+ the first power of two smaller than ` n ` ; see [ Joe and Kuo, 2003] [ joe03 ] ). This
99103facility is provided by:
100- ```
104+ ``` julia
101105skip (s, n)
102106```
103107
104108Skipping exactly ` n ` elements is also possible:
105109
106- ```
110+ ``` julia
107111skip (s, n, exact= true )
108112```
109113
@@ -113,7 +117,7 @@ Here is a simple example, generating 1024 points in two dimensions and
113117plotting them with the [ PyPlot] ( https://github.com/stevengj/PyPlot.jl )
114118package. Note the highly uniform, nonrandom distribution of points in
115119the [ 0,1] ×[ 0,1] unit square!
116- ```
120+ ``` julia
117121using Sobol
118122using PyPlot
119123s = SobolSeq (2 )
0 commit comments