This commit is contained in:
2026-05-07 18:32:36 +02:00
parent 2fcd368e34
commit b7faade0c8
25 changed files with 4209 additions and 4 deletions

38
srctmp/lib.rs Normal file
View File

@ -0,0 +1,38 @@
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};