[][src]Trait believer::decoders::Decoder

pub trait Decoder: Send + Sync + Sized {
    type Code;
    type Error;
    type Result: DecodingResult;
    fn for_code(self, code: Self::Code) -> Self;
fn take_code(&mut self) -> Self::Code;
fn decode(&self, error: &Self::Error) -> Self::Result;
fn get_random_error_with_rng<R: Rng>(&self, rng: &mut R) -> Self::Error; fn get_random_error(&self) -> Self::Error { ... }
fn decode_random_error_with_rng<R: Rng>(&self, rng: &mut R) -> Self::Result { ... }
fn decode_random_error(&self) -> Self::Result { ... }
fn simulate_n_iterations_with_rng<R: Rng>(
        &self,
        n_iterations: usize,
        rng: &mut R
    ) -> SimulationResult { ... }
fn simulate_n_iterations(&self, n_iterations: usize) -> SimulationResult { ... }
fn simulate_until_n_events_are_found_with_rng<R: Rng>(
        &self,
        n_events: usize,
        rng: &mut R
    ) -> SimulationResult { ... }
fn simulate_until_n_events_are_found(
        &self,
        n_events: usize
    ) -> SimulationResult { ... } }

An interface to deal with decoders

This is the global decoder trait. For more details, see each decoder implementation.

Associated Types

type Code

The type of code the decoder is using.

type Error

The type of error that the decoder can decode.

type Result: DecodingResult

The type of result the decoder is returning.

Loading content...

Required methods

fn for_code(self, code: Self::Code) -> Self

Creates a new decoder similar to self that use code without changing the other parameter. This consume code.

fn take_code(&mut self) -> Self::Code

Takes the code out of the decoder leaving an empty set of code instead.

fn decode(&self, error: &Self::Error) -> Self::Result

Tries to decode a given error.

fn get_random_error_with_rng<R: Rng>(&self, rng: &mut R) -> Self::Error

Generates a random error with random number generator rng.

Loading content...

Provided methods

fn get_random_error(&self) -> Self::Error

Generates a random error with the default random number generator.

fn decode_random_error_with_rng<R: Rng>(&self, rng: &mut R) -> Self::Result

Generates and decodes a random error.

fn decode_random_error(&self) -> Self::Result

Generates and decodes a random error.

fn simulate_n_iterations_with_rng<R: Rng>(
    &self,
    n_iterations: usize,
    rng: &mut R
) -> SimulationResult

Simulates decoding random error using self for n_iterations with random number generator rng.

fn simulate_n_iterations(&self, n_iterations: usize) -> SimulationResult

Simulates decoding random error using self for n_iterations using the thread random number generator rng.

fn simulate_until_n_events_are_found_with_rng<R: Rng>(
    &self,
    n_events: usize,
    rng: &mut R
) -> SimulationResult

Simulates the decoder until n_events are found with random number generator rng.

That is, simulate until n_events successes and n_events are found.

fn simulate_until_n_events_are_found(&self, n_events: usize) -> SimulationResult

Simulates the decoder until n_events are found with the thread random number generator rng.

That is, simulate until n_events successes and n_events are found.

Loading content...

Implementors

impl Decoder for ErasureDecoder[src]

type Error = Vec<usize>

type Result = ErasureResult

type Code = ParityCheckMatrix

Loading content...