use super::{HDPC, LDPC};
use crate::types::{
SubstitutionMethod, CodeParams, CodeType, DegreeSetFn, InactivationStrategy, DecodingConfig, PreInactivation,
};
pub type PrecodePair = (Option<Box<dyn HDPC>>, Option<Box<dyn LDPC>>);
pub trait CodeScheme {
fn get_params(&self) -> CodeParams;
fn code_type(&self) -> CodeType;
fn create_degree_set_fn(&self) -> DegreeSetFn;
fn create_precode(&self) -> PrecodePair;
fn max_inactive_num(&self) -> usize{
self.get_params().h + self.get_params().b
}
fn decoding_config(&self) -> DecodingConfig {
DecodingConfig {
max_inactive_num: self.max_inactive_num(),
num_padding: 0,
pre_inactivation: PreInactivation::YesPre,
inac_strategy: InactivationStrategy::ByIndex,
subs_method: SubstitutionMethod::Direct,
}
}
}