diff --git a/README.md b/README.md index 99a07eefecea21d2e74e791d88b9ef296e922ac9..b57528145de940305879c56564967518313945a1 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,7 @@ The library deploys lazy-evaluation and is intented for usage on multi-thread ca 2. Completly thread-safe. 3. Compatibility with all C++ distributions defined in the standard library. 4. For each seed, the ```random_iterator::Stream<Distribution, Engine>``` manages up to $`{2}^{32}`$ streams, with length $`{2}^{64}`$. +5. When instantiated to produce 64bit output, like ```double``` ou ```uint64_t```, each stream can provide up to 128EB of data. ## The Latest Version @@ -59,13 +60,41 @@ The RandomIterator User's Guide is available in the following formats: ### Examples: -### Iterating over a stream -```cpp +``` + +#include <random_iterator/Stream.hpp> +#include <random> +#include <iostream> +... + +//generator +random_iterator::philox RNG(0x548c9decbce65295); + +//std distribution + +std::uniform_real_distribution<double> +uniform_dist(0.0, 1.0); +//streams +auto uniform_stream = random_iterator::make_stream( uniform_dist, RNG, 0); + +//using range semantics +for(auto unf : uniform_stream) + std::cout << unf << std::endl; + +//using subscript operator +for(size_t i=0; i < 100; ++i) + std::cout << uniform_stream[i] << std::endl; + +... ``` ## Installation and requirements -## +RandomIterator iterator is a header-only library with no dependences. + +## Licensing + +RandomIterator is released under the GNU General Public License version 3. Please see the file called COPYING.