# hammersley

hammersley, a MATLAB code which computes elements of a Hammersley Quasi Monte Carlo (QMC) sequence using a simple interface.

A more sophisticated library is available in HAMMERSLEY_ADVANCED, but I find this simple version to be preferable for everyday use!

The standard M-dimensional Hammersley sequence based on N is simply composed of a first component of successive fractions 0/N, 1/N, ..., N/N, paired with M-1 1-dimensional van der Corput sequences, using as bases the first M-1 primes.

The HAMMERSLEY function will return the M-dimensional element of this sequence with index I.

The HAMMERSLEY_SEQUENCE function will return the M-dimensional elements of this sequence with indices I1 through I2.

The HAMMERSLEY_INVERSE function accepts an M-dimensional value, presumably computed by HAMMERSLEY, and returns its original index I.

### Languages:

hammersley is available in a C version and a C++ version and a FORTRAN90 version and a MATLAB version and a Python version.

### Related Data and Programs:

cvt, a MATLAB code which computes elements of a Centroidal Voronoi Tessellation.

faure, a MATLAB code which computes elements of a Faure sequence.

halton, a MATLAB code which computes elements of a Halton Quasi Monte Carlo (QMC) sequence.

latin_center, a MATLAB code which computes elements of a Latin Hypercube dataset, choosing center points.

latin_edge, a MATLAB code which computes elements of a Latin Hypercube dataset, choosing edge points.

latin_random, a MATLAB code which computes elements of a Latin Hypercube dataset, choosing points at random.

lattice_rule, a MATLAB code which approximates multidimensional integrals using lattice rules.

niederreiter2, a MATLAB code which computes elements of a Niederreiter sequence using base 2.

sobol, a MATLAB code which computes elements of a Sobol sequence.

uniform, a MATLAB code which computes elements of a uniform pseudorandom sequence.

van_der_corput, a MATLAB code which computes elements of a 1D van der Corput Quasi Monte Carlo (QMC) sequence using a simple interface.

### Reference:

1. John Hammersley, Monte Carlo methods for solving multivariable problems, Proceedings of the New York Academy of Science, Volume 86, 1960, pages 844-874.
{"ft_lang_label":"__label__en","ft_lang_prob":0.73989403,"math_prob":0.8026938,"size":2127,"snap":"2021-43-2021-49","text_gpt3_token_len":473,"char_repetition_ratio":0.19500707,"word_repetition_ratio":0.21383648,"special_character_ratio":0.19087917,"punctuation_ratio":0.11968085,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9915736,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2021-10-26T02:16:00Z\",\"WARC-Record-ID\":\"<urn:uuid:e44cfc74-6ebd-46cf-b247-bc6898afc8a0>\",\"Content-Length\":\"6313\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:b71c7dc4-77dd-4426-ad16-26e649f28ea8>\",\"WARC-Concurrent-To\":\"<urn:uuid:c29ed50c-e9e6-48ad-83b9-c39f14f09041>\",\"WARC-IP-Address\":\"144.174.16.102\",\"WARC-Target-URI\":\"https://people.sc.fsu.edu/~jburkardt/m_src/hammersley/hammersley.html\",\"WARC-Payload-Digest\":\"sha1:TSE5KD7KGD7TLRWG5MACZXANQVAWSV3X\",\"WARC-Block-Digest\":\"sha1:HVWWNEI724H5STS5CKPILETVANW35LCG\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2021/CC-MAIN-2021-43/CC-MAIN-2021-43_segments_1634323587794.19_warc_CC-MAIN-20211026011138-20211026041138-00399.warc.gz\"}"}