39 lines
1.0 KiB
Rust
39 lines
1.0 KiB
Rust
pub mod channel;
|
|
pub mod code;
|
|
pub mod decoder;
|
|
pub mod encoder;
|
|
pub mod graph;
|
|
pub mod matrix;
|
|
|
|
pub type Gf2 = u8;
|
|
pub type Llr = f64;
|
|
pub type BitVec = Vec<Gf2>;
|
|
|
|
#[derive(Debug, thiserror::Error)]
|
|
pub enum LdpcError {
|
|
#[error("Paramètres invalides : {0}")]
|
|
InvalidParameters(String),
|
|
|
|
#[error("Matrice singulière : impossible d'inverser")]
|
|
SingularMatrix,
|
|
|
|
#[error("Génération échouée après {attempts} tentatives")]
|
|
GenerationFailed { attempts: usize },
|
|
|
|
#[error("Dimension incorrecte : attendu {expected}, reçu {got}")]
|
|
DimensionMismatch { expected: usize, got: usize },
|
|
|
|
#[error("Le vecteur fourni n'est pas un mot de code valide")]
|
|
InvalidCodeword,
|
|
|
|
#[error("Paramètre hors plage : {0}")]
|
|
OutOfRange(String),
|
|
}
|
|
|
|
pub type Result<T> = std::result::Result<T, LdpcError>;
|
|
|
|
pub use channel::Channel;
|
|
pub use code::{CodeTopology, GenerationMethod, LdpcCode, LdpcParams};
|
|
pub use decoder::{Decoder, DecoderConfig, DecoderMethod, DecoderResult};
|
|
pub use encoder::{Encoder, EncodingMethod};
|