validateLdpcMinSumConfiguration function
Validates quantized min-sum configuration shared by software and hardware.
Implementation
void validateLdpcMinSumConfiguration({
required int llrWidth,
required int maxIterations,
required int normalizationNumerator,
required int normalizationShift,
required int offset,
}) {
if (llrWidth < 3) {
throw ArgumentError.value(
llrWidth,
'llrWidth',
'Must be at least three.',
);
}
if (maxIterations < 1) {
throw ArgumentError.value(
maxIterations,
'maxIterations',
'Must be positive.',
);
}
if (normalizationShift < 0 ||
normalizationNumerator < 1 ||
normalizationNumerator > (1 << normalizationShift)) {
throw ArgumentError(
'The normalization factor must be in (0, 1] and represented as '
'normalizationNumerator / 2^normalizationShift.',
);
}
if (offset < 0 || offset >= (1 << (llrWidth - 1))) {
throw ArgumentError.value(
offset,
'offset',
'Must fit in the non-negative LLR magnitude range.',
);
}
}