nk 1.0.0
C++ Numerical Computing Runtime
Loading...
Searching...
No Matches
random_source.hpp
Go to the documentation of this file.
1
3// toolboxes/comm/include/nk/comm/source/random_source.hpp
4//
5// Random data sources (randsrc / randerr).
6
7#pragma once
8
9#include <cstddef>
10#include <cstdint>
11#include <memory_resource>
12#include <nk/value/value.hpp>
13
14namespace nk {
15
18 namespace ops { class RngContext; } }
19
20namespace nk::comm {
21
44Value randsrc(::nk::ops::RngContext &rng, size_t m, size_t n, const Value &alphabet,
45 bool have_state, uint32_t state,
46 std::pmr::memory_resource *mr = nullptr);
47
65Value randerr(::nk::ops::RngContext &rng, size_t m, size_t n, const Value &errspec,
66 bool have_state, uint32_t state,
67 std::pmr::memory_resource *mr = nullptr);
68
69
71} // namespace nk::comm
Core MATLAB-compatible multidimensional array and scalar value type.
Definition value.hpp:61
Value randerr(::nk::ops::RngContext &rng, size_t m, size_t n, const Value &errspec, bool have_state, uint32_t state, std::pmr::memory_resource *mr=nullptr)
Generate an m×n binary error pattern (out = randerr(m, n, errors, state)).
Value randsrc(::nk::ops::RngContext &rng, size_t m, size_t n, const Value &alphabet, bool have_state, uint32_t state, std::pmr::memory_resource *mr=nullptr)
Generate an m×n random matrix from a finite alphabet (out = randsrc(m, n, alphabet,...