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.
Trait Implementations§
impl Eq for Config
impl StructuralPartialEq for Config
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more