20 August 2016 09:07:26 PM HAMMERSLEY_PRB: C++ version Test the HAMMERSLEY library. HAMMERSLEY_TEST HAMMERSLEY returns the I-th element of an M-dimensional Hammersley sequence. I HAMMERSLEY(I) Use M = 1 N = 16 0 0 1 0.0625 2 0.125 3 0.1875 4 0.25 5 0.3125 6 0.375 7 0.4375 8 0.5 9 0.5625 10 0.625 Use M = 2 N = 16 0 0 0 1 0.0625 0.5 2 0.125 0.25 3 0.1875 0.75 4 0.25 0.125 5 0.3125 0.625 6 0.375 0.375 7 0.4375 0.875 8 0.5 0.0625 9 0.5625 0.5625 10 0.625 0.3125 Use M = 3 N = 16 0 0 0 0 1 0.0625 0.5 0.333333 2 0.125 0.25 0.666667 3 0.1875 0.75 0.111111 4 0.25 0.125 0.444444 5 0.3125 0.625 0.777778 6 0.375 0.375 0.222222 7 0.4375 0.875 0.555556 8 0.5 0.0625 0.888889 9 0.5625 0.5625 0.037037 10 0.625 0.3125 0.37037 HAMMERSLEY_INVERSE_TEST HAMMERSLEY_INVERSE inverts an element of a Hammersley sequence. I R=HAMMERSLEY(I,3) HAMMERSLEY_INVERSE(R,3) 0 0 0 0 0 1 0.0625 0.5 0.333333 1 2 0.125 0.25 0.666667 2 3 0.1875 0.75 0.111111 3 4 0.25 0.125 0.444444 4 5 0.3125 0.625 0.777778 5 6 0.375 0.375 0.222222 6 7 0.4375 0.875 0.555556 7 8 0.5 0.0625 0.888889 8 9 0.5625 0.5625 0.037037 9 10 0.625 0.3125 0.37037 10 HAMMERSLEY_SEQUENCE_TEST HAMMERSLEY_SEQUENCE returns the elements I1 through I2 of an M-dimensional Hammersley sequence. HAMMERSLEY_SEQUENCE(0,10,1,N,R): R: Col: 0 1 2 3 4 Row 0: 0 0.0625 0.125 0.1875 0.25 Col: 5 6 7 8 9 Row 0: 0.3125 0.375 0.4375 0.5 0.5625 Col: 10 Row 0: 0.625 HAMMERSLEY_SEQUENCE(0,10,2,N,R): R: Col: 0 1 2 3 4 Row 0: 0 0.0625 0.125 0.1875 0.25 1: 0 0.5 0.25 0.75 0.125 Col: 5 6 7 8 9 Row 0: 0.3125 0.375 0.4375 0.5 0.5625 1: 0.625 0.375 0.875 0.0625 0.5625 Col: 10 Row 0: 0.625 1: 0.3125 HAMMERSLEY_SEQUENCE(0,10,3,N,R): R: Col: 0 1 2 3 4 Row 0: 0 0.0625 0.125 0.1875 0.25 1: 0 0.5 0.25 0.75 0.125 2: 0 0.333333 0.666667 0.111111 0.444444 Col: 5 6 7 8 9 Row 0: 0.3125 0.375 0.4375 0.5 0.5625 1: 0.625 0.375 0.875 0.0625 0.5625 2: 0.777778 0.222222 0.555556 0.888889 0.037037 Col: 10 Row 0: 0.625 1: 0.3125 2: 0.37037 HAMMERSLEY_SEQUENCE(10,0,3,N,R): R: Col: 0 1 2 3 4 Row 0: 0.625 0.5625 0.5 0.4375 0.375 1: 0.3125 0.5625 0.0625 0.875 0.375 2: 0.37037 0.037037 0.888889 0.555556 0.222222 Col: 5 6 7 8 9 Row 0: 0.3125 0.25 0.1875 0.125 0.0625 1: 0.625 0.125 0.75 0.25 0.5 2: 0.777778 0.444444 0.111111 0.666667 0.333333 Col: 10 Row 0: 0 1: 0 2: 0 HAMMERSLEY_PRB: Normal end of execution. 20 August 2016 09:07:26 PM