nk 1.0.0
C++ Numerical Computing Runtime
Loading...
Searching...
No Matches
blockcoding.hpp File Reference
#include <memory_resource>
#include <string>
#include <nk/value/value.hpp>

Go to the source code of this file.

Classes

struct  nk::comm::HammgenResult
 Result of hammgen: parity-check / generator matrices and the code dimensions. More...
struct  nk::comm::CyclgenResult
 Result of cyclgen: parity-check / generator matrices and the message length. More...
struct  nk::comm::EncodeResult
 Result of encode: the codeword stream and any zero-padding added. More...
struct  nk::comm::DecodeResult
 Result of decode: the recovered message and error report. More...

Functions

Value nk::comm::gen2par (const Value &mat, std::pmr::memory_resource *mr=nullptr)
 Parity-check matrix from a generator matrix, or vice versa (h = gen2par(g)).
HammgenResult nk::comm::hammgen (long long m, const Value &primPoly=Value::Empty, std::pmr::memory_resource *mr=nullptr)
 Parity-check and generator matrices for a Hamming code ([h, g, n, k] = hammgen(m)).
Value nk::comm::cyclpoly (long long n, long long k, const std::string &opt="", std::pmr::memory_resource *mr=nullptr)
 Generator polynomial(s) for an (n, k) cyclic code (p = cyclpoly(n, k) / cyclpoly(n, k, opt)).
CyclgenResult nk::comm::cyclgen (long long n, const Value &genpoly, const std::string &opt="system", std::pmr::memory_resource *mr=nullptr)
 Parity-check and generator matrices for a cyclic code ([h, g, k] = cyclgen(n, genpoly) / cyclgen(n, genpoly, opt)).
EncodeResult nk::comm::encode (const Value &msg, long long n, long long k, const std::string &method="hamming/binary", const Value &opt=Value::Empty, std::pmr::memory_resource *mr=nullptr)
 Encode a message with a linear block code (code = encode(msg, n, k, method, opt)).
DecodeResult nk::comm::decode (const Value &code, long long n, long long k, const std::string &method="hamming/binary", const Value &opt=Value::Empty, std::pmr::memory_resource *mr=nullptr)
 Decode a linear block code ([msg, err] = decode(code, n, k, method, opt)).
Value nk::comm::syndtable (const Value &H, std::pmr::memory_resource *mr=nullptr)
 Syndrome decoding table (coset-leader lookup) from a parity-check matrix (t = syndtable(H)).