C(++)ECCO
C++ Error Control COding: a header-only library for ECC simulations and experiments, modeling complete coding systems across arbitrary finite fields and complex inter-field relationships - Christian Senger <senger@inue.uni-stuttgart.de>
Loading...
Searching...
No Matches
CECCO::TannerGraph< T > Struct Template Reference

Tanner graph of a parity-check matrix. More...

#include <graphs.hpp>

Classes

struct  BP_Workspace
 Workspace for sum-product (belief propagation) decoding. More...

Public Member Functions

 TannerGraph (size_t n)
 Construct a Tanner graph with n variable nodes and no checks.
void add_edge (size_t check, uint32_t var_id, T value)
 Add a check-to-variable edge check --value--> var_id.
void tikz_header (std::ostream &file) const
 Write TikZ style definitions.
void tikz_picture (std::ostream &file, const BP_Workspace *ws) const
 Write one TikZ picture of the Tanner graph.
void export_as_tikz (const std::string &filename, const BP_Workspace *ws) const
 Export a standalone TikZ fragment with workspace beliefs.
void export_as_tikz (const std::string &filename) const
 Export a standalone TikZ fragment without workspace beliefs.

Public Attributes

size_t n
 Number of variable nodes.
std::vector< std::vector< details::CheckEdge< T > > > checks
 Incident edges by check node; checks[i] lists the variables in parity check i.

Detailed Description

template<FieldType T>
struct CECCO::TannerGraph< T >

Tanner graph of a parity-check matrix.

Template Parameters
TField type used for edge labels

Contains n variable nodes and one node per parity-check equation. An edge (check, variable, value) represents a nonzero parity-check coefficient. BP_Workspace provides sum-product decoding state.

Definition at line 938 of file graphs.hpp.

Constructor & Destructor Documentation

◆ TannerGraph()

template<FieldType T>
CECCO::TannerGraph< T >::TannerGraph ( size_t n)
inlineexplicit

Construct a Tanner graph with n variable nodes and no checks.

Definition at line 940 of file graphs.hpp.

Member Function Documentation

◆ add_edge()

template<FieldType T>
void CECCO::TannerGraph< T >::add_edge ( size_t check,
uint32_t var_id,
T value )
inline

Add a check-to-variable edge check --value--> var_id.

Parameters
checkCheck-node index; checks are created on demand
var_idIncident variable-node id
valueParity-check coefficient carried by the edge
Exceptions
std::invalid_argumentif var_id is not a variable node of this graph

Definition at line 950 of file graphs.hpp.

◆ export_as_tikz() [1/2]

template<FieldType T>
void CECCO::TannerGraph< T >::export_as_tikz ( const std::string & filename) const
inline

Export a standalone TikZ fragment without workspace beliefs.

Parameters
filenameOutput filename

Available only for finite fields of size at most 64.

Definition at line 1108 of file graphs.hpp.

◆ export_as_tikz() [2/2]

template<FieldType T>
void CECCO::TannerGraph< T >::export_as_tikz ( const std::string & filename,
const BP_Workspace * ws ) const
inline

Export a standalone TikZ fragment with workspace beliefs.

Parameters
filenameOutput filename
wsOptional decoding workspace; if non-null, posterior beliefs and decisions are shown

Available only for finite fields of size at most 64.

Definition at line 1091 of file graphs.hpp.

◆ tikz_header()

template<FieldType T>
void CECCO::TannerGraph< T >::tikz_header ( std::ostream & file) const
inline

Write TikZ style definitions.

Parameters
fileOutput stream

Definition at line 1019 of file graphs.hpp.

◆ tikz_picture()

template<FieldType T>
void CECCO::TannerGraph< T >::tikz_picture ( std::ostream & file,
const BP_Workspace * ws ) const
inline

Write one TikZ picture of the Tanner graph.

Parameters
fileOutput stream
wsOptional decoding workspace; if non-null, posterior beliefs and decisions are shown

Available only for finite fields of size at most 64.

Definition at line 1031 of file graphs.hpp.

Member Data Documentation

◆ checks

template<FieldType T>
std::vector<std::vector<details::CheckEdge<T> > > CECCO::TannerGraph< T >::checks

Incident edges by check node; checks[i] lists the variables in parity check i.

Definition at line 1117 of file graphs.hpp.

◆ n

template<FieldType T>
size_t CECCO::TannerGraph< T >::n

Number of variable nodes.

Definition at line 1115 of file graphs.hpp.


The documentation for this struct was generated from the following file: