Struct ldpc_toolbox::decoder::flooding::Decoder
source · 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: Clone + DecoderArithmetic> Clone for Decoder<A>where
A::Llr: Clone,
A::CheckMessage: Clone,
A::VarMessage: Clone,
impl<A: Clone + DecoderArithmetic> Clone for Decoder<A>where A::Llr: Clone, A::CheckMessage: Clone, A::VarMessage: Clone,
source§impl<A: Debug + DecoderArithmetic> Debug for Decoder<A>where
A::Llr: Debug,
A::CheckMessage: Debug,
A::VarMessage: Debug,
impl<A: Debug + DecoderArithmetic> Debug for Decoder<A>where A::Llr: Debug, A::CheckMessage: Debug, A::VarMessage: Debug,
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
source§impl<A: PartialEq + DecoderArithmetic> PartialEq<Decoder<A>> for Decoder<A>where
A::Llr: PartialEq,
A::CheckMessage: PartialEq,
A::VarMessage: PartialEq,
impl<A: PartialEq + DecoderArithmetic> PartialEq<Decoder<A>> for Decoder<A>where A::Llr: PartialEq, A::CheckMessage: PartialEq, A::VarMessage: PartialEq,
impl<A: DecoderArithmetic> StructuralPartialEq for Decoder<A>
Auto Trait Implementations§
impl<A> RefUnwindSafe for Decoder<A>where A: RefUnwindSafe, <A as DecoderArithmetic>::CheckMessage: RefUnwindSafe, <A as DecoderArithmetic>::Llr: RefUnwindSafe, <A as DecoderArithmetic>::VarMessage: RefUnwindSafe,
impl<A> Send for Decoder<A>
impl<A> Sync for Decoder<A>where A: Sync, <A as DecoderArithmetic>::CheckMessage: Sync, <A as DecoderArithmetic>::Llr: 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>::CheckMessage: UnwindSafe, <A as DecoderArithmetic>::Llr: 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