Trait DecoderArithmetic

Source
pub trait DecoderArithmetic: Debug + Send {
    type Llr: Debug + Copy + Default + Send;
    type CheckMessage: Debug + Copy + Default + Send;
    type VarMessage: Debug + Copy + Default + Send;
    type VarLlr: Debug + Copy + Default + Send;

    // Required methods
    fn input_llr_quantize(&self, llr: f64) -> Self::Llr;
    fn llr_hard_decision(&self, llr: Self::Llr) -> bool;
    fn llr_to_var_message(&self, llr: Self::Llr) -> Self::VarMessage;
    fn llr_to_var_llr(&self, llr: Self::Llr) -> Self::VarLlr;
    fn var_llr_to_llr(&self, var_llr: Self::VarLlr) -> Self::Llr;
    fn send_check_messages<F>(
        &mut self,
        var_messages: &[Message<Self::VarMessage>],
        send: F,
    )
       where F: FnMut(SentMessage<Self::CheckMessage>);
    fn send_var_messages<F>(
        &mut self,
        input_llr: Self::Llr,
        check_messages: &[Message<Self::CheckMessage>],
        send: F,
    ) -> Self::Llr
       where F: FnMut(SentMessage<Self::VarMessage>);
    fn update_check_messages_and_vars(
        &mut self,
        check_messages: &mut [SentMessage<Self::CheckMessage>],
        vars: &mut [Self::VarLlr],
    );
}
Expand description

LDPC decoder arithmetic.

This trait models generic arithmetic rules for a belief propagation LDPC decoder. The trait defines the data types to use for LLRs and messages, and how to compute the check node and variable node messages.

The LDPC decoders are generic over objects implementing this trait.

The methods in this trait depend on &self or &mut self so that the decoder arithmetic object can have an internal state implement lookup tables, caching, etc.

Required Associated Types§

Source

type Llr: Debug + Copy + Default + Send

LLR.

Defines the type used to represent LLRs.

Source

type CheckMessage: Debug + Copy + Default + Send

Check node message.

Defines the type used to represent check node messages.

Source

type VarMessage: Debug + Copy + Default + Send

Variable node message.

Defines the type used to represent variable node messages.

Source

type VarLlr: Debug + Copy + Default + Send

Variable LLR.

Defines the type used to represent variable node LLRs in the horizontal layered schedule.

Required Methods§

Source

fn input_llr_quantize(&self, llr: f64) -> Self::Llr

Quantization function for input LLRs.

Defines how the channel LLRs (the input to the decoder) are quantized and represented internally as a Self::Llr.

Source

fn llr_hard_decision(&self, llr: Self::Llr) -> bool

Hard decision on LLRs.

Returns the hard decision bit corresponding to an LLR.

Source

fn llr_to_var_message(&self, llr: Self::Llr) -> Self::VarMessage

Transform LLR to variable message.

Defines how to transform an LLR into a variable message. This is used in the first iteration of the belief propagation algorithm, where the variable messages are simply the channel LLRs.

Source

fn llr_to_var_llr(&self, llr: Self::Llr) -> Self::VarLlr

Transform LLR to variable LLR.

Defines how to transform an LLR into a variable node LLR.

Source

fn var_llr_to_llr(&self, var_llr: Self::VarLlr) -> Self::Llr

Transform variable LLR to LLR.

Defines how to transform a variable LLR into an LLR.

Source

fn send_check_messages<F>( &mut self, var_messages: &[Message<Self::VarMessage>], send: F, )
where F: FnMut(SentMessage<Self::CheckMessage>),

Send check messages from a check node.

This function is called with the list of variable messages arriving to a check node, and closure that must be called to send each check message outgoing from that check node.

This function should compute the values of the check node messages and call the send closure for each of the variable nodes connected to the check node being processed.

Source

fn send_var_messages<F>( &mut self, input_llr: Self::Llr, check_messages: &[Message<Self::CheckMessage>], send: F, ) -> Self::Llr
where F: FnMut(SentMessage<Self::VarMessage>),

Send variable messages from a variable node.

This function is called with the channel LLR corresponding to a variable node, a list of check messages arriving to that variable node, and closure that must be called to send each variable message outgoing from that variable node.

This function should compute the values of the variable node messages and call the send closure for each of the check nodes connected to the variable node being processed.

Additionally, the function returns the new LLR for this variable node.

Source

fn update_check_messages_and_vars( &mut self, check_messages: &mut [SentMessage<Self::CheckMessage>], vars: &mut [Self::VarLlr], )

Update check messages and variable values for a check node.

This function is used in the horizontal layered decoder. It is called with the messages sent by a check node and the list of LLRs of all the variables. The function computes and updates the new check messages and the new variable LLRs (for the variables directly connected to this check messages).

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl DecoderArithmetic for Aminstarf32

Source§

impl DecoderArithmetic for Aminstarf64

Source§

impl DecoderArithmetic for Aminstari8

Source§

impl DecoderArithmetic for Aminstari8Deg1Clip

Source§

impl DecoderArithmetic for Aminstari8Jones

Source§

impl DecoderArithmetic for Aminstari8JonesDeg1Clip

Source§

impl DecoderArithmetic for Aminstari8JonesPartialHardLimit

Source§

impl DecoderArithmetic for Aminstari8JonesPartialHardLimitDeg1Clip

Source§

impl DecoderArithmetic for Aminstari8PartialHardLimit

Source§

impl DecoderArithmetic for Aminstari8PartialHardLimitDeg1Clip

Source§

impl DecoderArithmetic for Minstarapproxf32

Source§

impl DecoderArithmetic for Minstarapproxf64

Source§

impl DecoderArithmetic for Minstarapproxi8

Source§

impl DecoderArithmetic for Minstarapproxi8Deg1Clip

Source§

impl DecoderArithmetic for Minstarapproxi8Jones

Source§

impl DecoderArithmetic for Minstarapproxi8JonesDeg1Clip

Source§

impl DecoderArithmetic for Minstarapproxi8JonesPartialHardLimit

Source§

impl DecoderArithmetic for Minstarapproxi8JonesPartialHardLimitDeg1Clip

Source§

impl DecoderArithmetic for Minstarapproxi8PartialHardLimit

Source§

impl DecoderArithmetic for Minstarapproxi8PartialHardLimitDeg1Clip

Source§

impl DecoderArithmetic for Phif32

Source§

impl DecoderArithmetic for Phif64

Source§

impl DecoderArithmetic for Tanhf32

Source§

impl DecoderArithmetic for Tanhf64