File tree Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Load Diff Large diffs are not rendered by default.
Original file line number Diff line number Diff line change
1
+ #include < fstream>
2
+
3
+ /*
4
+ Scales range limited set of random seeds to the full range of
5
+ unsigned 64 bit integer, which the std rgen expects.
6
+
7
+ Provide a unique set of 10000 integers between 0 and 42007935
8
+ in a text file set1.txt. Format expected as you get it from
9
+ random.org without comma delimiters and unordered.
10
+ */
11
+
12
+ int main () {
13
+ using namespace std ;
14
+
15
+ ifstream infile;
16
+ ofstream outfile;
17
+ infile.open (" set1.txt" );
18
+ outfile.open (" set1_out.txt" );
19
+
20
+ uint_fast64_t factor = 65537 ;
21
+ factor *= 6700417 ;
22
+ for (int i=0 ; i<10000 ; ++i) {
23
+ uint_fast64_t seed;
24
+ infile >> seed;
25
+ seed *= factor;
26
+ outfile << seed;
27
+ outfile << " " ;
28
+ }
29
+ infile.close ();
30
+ outfile.close ();
31
+
32
+ return 0 ;
33
+ }
You can’t perform that action at this time.
0 commit comments