+ xoshiro256ss (copied from kalman project)
This commit is contained in:
parent
e2533d7ae6
commit
fadbcd7b54
12 changed files with 1130 additions and 0 deletions
2
example/CMakeLists.txt
Normal file
2
example/CMakeLists.txt
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
add_subdirectory(ex1)
|
||||
add_subdirectory(ex2)
|
||||
2
example/ex1/CMakeLists.txt
Normal file
2
example/ex1/CMakeLists.txt
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
add_executable(ex1 ex1.cpp)
|
||||
xo_include_options(ex1)
|
||||
26
example/ex1/ex1.cpp
Normal file
26
example/ex1/ex1.cpp
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
/* @file ex1.cpp */
|
||||
|
||||
#include "randomgen/xoshiro256.hpp"
|
||||
#include <algorithm>
|
||||
#include <iostream>
|
||||
//#include <array>
|
||||
//#include <cstdint>
|
||||
|
||||
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 */
|
||||
3
example/ex2/CMakeLists.txt
Normal file
3
example/ex2/CMakeLists.txt
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
add_executable(ex2 ex2.cpp)
|
||||
xo_include_options(ex2)
|
||||
xo_indentlog_dependency(ex2)
|
||||
16
example/ex2/ex2.cpp
Normal file
16
example/ex2/ex2.cpp
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
/* @file ex2.cpp */
|
||||
|
||||
#include "randomgen/xoshiro256.hpp"
|
||||
#include "randomgen/random_seed.hpp"
|
||||
|
||||
using namespace xo;
|
||||
using namespace xo::rng;
|
||||
|
||||
int
|
||||
main(int argc, char ** argv) {
|
||||
Seed<xoshiro256ss> seed;
|
||||
|
||||
xoshiro256ss eng(seed);
|
||||
} /*main*/
|
||||
|
||||
/* end ex2.cpp */
|
||||
Loading…
Add table
Add a link
Reference in a new issue