pub struct Decoder<A: DecoderArithmetic> { /* private fields */ }
Expand description
LDPC belief propagation flooding decoder.
Implementations§
Source§impl<A: DecoderArithmetic> Decoder<A>
impl<A: DecoderArithmetic> Decoder<A>
Sourcepub fn new(h: SparseMatrix, arithmetic: A) -> Self
pub fn new(h: SparseMatrix, arithmetic: A) -> Self
Creates a new flooding LDPC decoder.
The parameter h
indicates the parity check matrix.
Sourcepub fn decode(
&mut self,
llrs: &[f64],
max_iterations: usize,
) -> Result<DecoderOutput, DecoderOutput>
pub fn decode( &mut self, llrs: &[f64], max_iterations: usize, ) -> Result<DecoderOutput, DecoderOutput>
Decodes a codeword.
The parameters are the LLRs for the received codeword and the maximum
number of iterations to perform. If decoding is successful, the function
returns an Ok
containing the (hard decision) on the decoded codeword
and the number of iterations used in decoding. If decoding is not
successful, the function returns an Err
containing the hard decision
on the final decoder LLRs (which still has some bit errors) and the
number of iterations used in decoding (which is equal to
max_iterations
).
Trait Implementations§
Source§impl<A: DecoderArithmetic> LdpcDecoder for Decoder<A>
impl<A: DecoderArithmetic> LdpcDecoder for Decoder<A>
Source§fn decode(
&mut self,
llrs: &[f64],
max_iterations: usize,
) -> Result<DecoderOutput, DecoderOutput>
fn decode( &mut self, llrs: &[f64], max_iterations: usize, ) -> Result<DecoderOutput, DecoderOutput>
Decodes a codeword. Read more
impl<A: DecoderArithmetic> StructuralPartialEq for Decoder<A>
Auto Trait Implementations§
impl<A> Freeze for Decoder<A>where
A: Freeze,
impl<A> RefUnwindSafe for Decoder<A>where
A: RefUnwindSafe,
<A as DecoderArithmetic>::Llr: RefUnwindSafe,
<A as DecoderArithmetic>::CheckMessage: RefUnwindSafe,
<A as DecoderArithmetic>::VarMessage: RefUnwindSafe,
impl<A> Send for Decoder<A>
impl<A> Sync for Decoder<A>where
A: Sync,
<A as DecoderArithmetic>::Llr: Sync,
<A as DecoderArithmetic>::CheckMessage: Sync,
<A as DecoderArithmetic>::VarMessage: Sync,
impl<A> Unpin for Decoder<A>where
A: Unpin,
impl<A> UnwindSafe for Decoder<A>where
A: UnwindSafe,
<A as DecoderArithmetic>::Llr: UnwindSafe,
<A as DecoderArithmetic>::CheckMessage: UnwindSafe,
<A as DecoderArithmetic>::VarMessage: UnwindSafe,
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
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>
Converts
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>
Converts
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