pub trait LdpcDecoder: Debug + Send {
// Required method
fn decode(
&mut self,
llrs: &[f64],
max_iterations: usize,
) -> Result<DecoderOutput, DecoderOutput>;
}
Expand description
Generic LDPC decoder.
This trait is used to form LDPC decoder trait objects, abstracting over the internal implementation decoder.
Required Methods§
Sourcefn 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.
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
).