pub struct LabelHalves { /* private fields */ }Expand description
The metrics of one symbol over the two halves of its labels for one bit: the label
$i$ of a point is in half $b$ when bit shift of $i$ is $b$, and every half keeps its
largest metric $\mu_{b}$ and the sum $s_{b} = \sum_{i} e^{\ell_{i} - \mu_{b}}$, so that
$$ \ln \sum_{i \in b} e^{\ell_{i}} = \mu_{b} + \ln s_{b}, \qquad L = \mu_{0} + \ln s_{0} - \mu_{1} - \ln s_{1} $$
(with max-log, $\mu_{b}$ and $\mu_{0} - \mu_{1}$). The kernel of the bitwise demapper
(Constellation::llr), of the bitwise closed forms (crate::theory) and of the
bit-metric rates of comnum_metrics: the metric row $\ell_{i}$ (a log-likelihood plus
a log-prior) is theirs, the sums are these.
§Examples
use comnum_mapping::demapper::LabelHalves;
use comnum_math::Jacobian;
// four labels, bit 1 (the most significant): halves {0, 1} and {2, 3}
let h = LabelHalves::new(&[0.0, -1.0, -3.0, -2.0], 1, Jacobian::Exact);
assert!((h.log_sum(0) - (1.0 + (-1f64).exp()).ln()).abs() < 1e-15);
assert_eq!(LabelHalves::new(&[0.0, -1.0, -3.0, -2.0], 1, Jacobian::MaxLog).llr(), 2.0);Implementations§
Source§impl LabelHalves
impl LabelHalves
Sourcepub fn new(metric: &[f64], shift: usize, jacobian: Jacobian) -> LabelHalves
pub fn new(metric: &[f64], shift: usize, jacobian: Jacobian) -> LabelHalves
The halves of the metric row metric (one value per label) for bit shift of
the labels; with Jacobian::MaxLog, the maxima only.