#[non_exhaustive]pub enum CheckRule {
SumProduct,
NormalizedMinSum(f64),
OffsetMinSum(f64),
}Expand description
The check-node rule of the decoder.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
SumProduct
Sum-product (belief propagation, exact).
NormalizedMinSum(f64)
Min-sum scaled by $\alpha$ (1 for plain min-sum, 0.75 to 0.8 typically).
OffsetMinSum(f64)
Min-sum with the offset $\beta$ subtracted from the magnitudes.
Implementations§
Source§impl CheckRule
impl CheckRule
Sourcepub fn from_name(rule: &str, alpha: f64) -> Result<CheckRule>
pub fn from_name(rule: &str, alpha: f64) -> Result<CheckRule>
The rule of a name: sum_product, min_sum (plain), normalized_min_sum
(scaled by alpha) or offset_min_sum (offset alpha), case-insensitive.
§Errors
Error::Config for another name.
Sourcepub fn name(self) -> &'static str
pub fn name(self) -> &'static str
The name of the rule, as CheckRule::from_name reads it (min_sum is the
normalised min-sum of scale 1).
§Examples
use comnum_fec::ldpc::{CheckRule, DEFAULT_RULE};
assert_eq!(DEFAULT_RULE.name(), "sum_product");
assert_eq!(CheckRule::from_name("min_sum", 0.5)?.name(), "normalized_min_sum");Trait Implementations§
impl Copy for CheckRule
impl StructuralPartialEq for CheckRule
Auto Trait Implementations§
impl Freeze for CheckRule
impl RefUnwindSafe for CheckRule
impl Send for CheckRule
impl Sync for CheckRule
impl Unpin for CheckRule
impl UnsafeUnpin for CheckRule
impl UnwindSafe for CheckRule
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
Mutably borrows from an owned value. Read more