Add 'xo-randomgen/' from commit '44a31724ec'
git-subtree-dir: xo-randomgen git-subtree-mainline:57170366dagit-subtree-split:44a31724ec
This commit is contained in:
commit
ae78de305f
21 changed files with 788 additions and 0 deletions
24
xo-randomgen/example/ex1/ex1.cpp
Normal file
24
xo-randomgen/example/ex1/ex1.cpp
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
/* @file ex1.cpp */
|
||||
|
||||
#include "xo/randomgen/xoshiro256.hpp"
|
||||
#include <algorithm>
|
||||
#include <iostream>
|
||||
|
||||
using namespace xo;
|
||||
using namespace xo::rng;
|
||||
|
||||
int
|
||||
main(int argc, char ** argv) {
|
||||
xoshiro256ss rng{123456789};
|
||||
|
||||
std::array<std::uint64_t, 20> v;
|
||||
|
||||
std::generate(v.begin(), v.end(), rng);
|
||||
|
||||
for (std::uint64_t i=0; i<v.size(); ++i)
|
||||
std::cout << "v[" << i << "]: " << v[i] << std::endl;
|
||||
|
||||
return 0;
|
||||
} /*main*/
|
||||
|
||||
/* end ex1.cpp */
|
||||
Loading…
Add table
Add a link
Reference in a new issue