1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.apache.commons.rng.examples.jmh;
19
20 import org.apache.commons.rng.simple.RandomSource;
21 import org.openjdk.jmh.annotations.Param;
22 import org.openjdk.jmh.annotations.Scope;
23 import org.openjdk.jmh.annotations.Setup;
24 import org.openjdk.jmh.annotations.State;
25
26
27
28
29
30
31 @State(Scope.Benchmark)
32 public class RandomSourceValues {
33
34
35
36
37
38
39
40
41
42 @Param({"JDK",
43 "WELL_512_A",
44 "WELL_1024_A",
45 "WELL_19937_A",
46 "WELL_19937_C",
47 "WELL_44497_A",
48 "WELL_44497_B",
49 "MT",
50 "ISAAC",
51 "SPLIT_MIX_64",
52 "XOR_SHIFT_1024_S",
53 "TWO_CMRES",
54 "MT_64",
55 "MWC_256",
56 "KISS",
57 "XOR_SHIFT_1024_S_PHI",
58 "XO_RO_SHI_RO_64_S",
59 "XO_RO_SHI_RO_64_SS",
60 "XO_SHI_RO_128_PLUS",
61 "XO_SHI_RO_128_SS",
62 "XO_RO_SHI_RO_128_PLUS",
63 "XO_RO_SHI_RO_128_SS",
64 "XO_SHI_RO_256_PLUS",
65 "XO_SHI_RO_256_SS",
66 "XO_SHI_RO_512_PLUS",
67 "XO_SHI_RO_512_SS",
68 "PCG_XSH_RR_32",
69 "PCG_XSH_RS_32",
70 "PCG_RXS_M_XS_64",
71 "PCG_MCG_XSH_RR_32",
72 "PCG_MCG_XSH_RS_32",
73 "MSWS",
74 "SFC_32",
75 "SFC_64",
76 "JSF_32",
77 "JSF_64",
78 "XO_SHI_RO_128_PP",
79 "XO_RO_SHI_RO_128_PP",
80 "XO_SHI_RO_256_PP",
81 "XO_SHI_RO_512_PP",
82 "XO_RO_SHI_RO_1024_PP",
83 "XO_RO_SHI_RO_1024_S",
84 "XO_RO_SHI_RO_1024_SS",
85 })
86 private String randomSourceName;
87
88
89 private RandomSource randomSource;
90
91
92
93
94
95
96 public RandomSource getRandomSource() {
97 return randomSource;
98 }
99
100
101
102
103 @Setup
104 public void setup() {
105 randomSource = RandomSource.valueOf(randomSourceName);
106 }
107 }