Struct ldpc_toolbox::mackay_neal::Config
source · pub struct Config {
pub nrows: usize,
pub ncols: usize,
pub wr: usize,
pub wc: usize,
pub backtrack_cols: usize,
pub backtrack_trials: usize,
pub min_girth: Option<usize>,
pub girth_trials: usize,
pub fill_policy: FillPolicy,
}Expand description
Configuration for the MacKay-Neal construction.
This configuration is used to set the parameters of the LDPC code to construct as well as some options that affect the exectution of the algorithm.
Fields§
§nrows: usizeNumber of rows of the parity check matrix.
ncols: usizeNumber of columns of the parity check matrix.
wr: usizeMaximum row weight of the parity check matrix.
wc: usizeColumn weight of the parity check matrix.
backtrack_cols: usizeNumber of columns to backtrack when there are not enough available columns with weight smaller than the maximum row weight.
backtrack_trials: usizeNumber of times to attempt backtracking before aborting.
min_girth: Option<usize>Minimum girth of the Tanner graph; None indicates that
no constraints are imposed on the girth.
girth_trials: usizeNumber of times to re-try generating a column to satisfy the minimum girth constraint before aborting.
fill_policy: FillPolicyPolicy used to select the rows to fill.
Implementations§
source§impl Config
impl Config
sourcepub fn run(&self, seed: u64) -> Result<SparseMatrix>
pub fn run(&self, seed: u64) -> Result<SparseMatrix>
Runs the MacKay-Neal algorith using a random seed seed.
sourcepub fn search(
&self,
start_seed: u64,
max_tries: u64
) -> Option<(u64, SparseMatrix)>
pub fn search( &self, start_seed: u64, max_tries: u64 ) -> Option<(u64, SparseMatrix)>
Searches for a seed for a successful MacKay-Neal construction by trying several seeds.
The search is performed in parallel using a parallel iterator
from the rayon crate. This function returns the successful seed
and the corresponding parity check matrix, if one is found, or
None otherwise.