pub struct Sign<E: IntegerElement, Bd: Bound, const BLK: usize, K: SymbolCode = u16> { /* private fields */ }Expand description
Weights in {-1, +1}, one bit per element, with no table at all.
The Packed<Grid<2>,8> spelling of the same decode (CK-13) tabulates but
can never answer Enumerable::as_index_stream: a packed byte’s index is
a mixed-radix decomposition of it, so the tabulated traversal builds the
index stream it gathers from. Measured, that build is a fifth to a third of
the work at a one-row tile (ANALYSIS.md, “What the missing index stream
costs the sign composition”). This tier spells the same decode with the
code being the index — Code = u16, one bit per element of the block
— so the operand’s own memory is the stream and there is nothing to
build. CK-11 pins the two spellings byte for byte.
The codebook is the constant {-1, +1}, so there is nothing to borrow and
no lifetime: the decode is a bit test. Bit t of the code is element
t; set is +1, clear is -1, low bit first — the order Packed
reads its sub-codes in (CK-03), so a Sign code spells the block the
composition spells from the same byte value. The convention is normative:
the encoder side is out of tree, and this decode is the whole contract
with it.
Implementations§
Source§impl<E: IntegerElement, Bd: Bound, const BLK: usize, K: SymbolCode> Sign<E, Bd, BLK, K>
impl<E: IntegerElement, Bd: Bound, const BLK: usize, K: SymbolCode> Sign<E, Bd, BLK, K>
Trait Implementations§
Source§impl<E: Clone + IntegerElement, Bd: Clone + Bound, const BLK: usize, K: Clone + SymbolCode> Clone for Sign<E, Bd, BLK, K>
impl<E: Clone + IntegerElement, Bd: Clone + Bound, const BLK: usize, K: Clone + SymbolCode> Clone for Sign<E, Bd, BLK, K>
Source§impl<E: IntegerElement, Bd: Bound, const BLK: usize, K: SymbolCode> Codec<E, Bd> for Sign<E, Bd, BLK, K>
impl<E: IntegerElement, Bd: Bound, const BLK: usize, K: SymbolCode> Codec<E, Bd> for Sign<E, Bd, BLK, K>
Source§const IS_FIXED_WIDTH: bool = true
const IS_FIXED_WIDTH: bool = true
Source§fn decode_len(&self, _code: Self::Code) -> usize
fn decode_len(&self, _code: Self::Code) -> usize
code actually produces. Read moreimpl<E: Copy + IntegerElement, Bd: Copy + Bound, const BLK: usize, K: Copy + SymbolCode> Copy for Sign<E, Bd, BLK, K>
Source§impl<E: Debug + IntegerElement, Bd: Debug + Bound, const BLK: usize, K: Debug + SymbolCode> Debug for Sign<E, Bd, BLK, K>
impl<E: Debug + IntegerElement, Bd: Debug + Bound, const BLK: usize, K: Debug + SymbolCode> Debug for Sign<E, Bd, BLK, K>
Source§impl<E: IntegerElement, Bd: Bound, const BLK: usize, K: SymbolCode> Enumerable<E, Bd> for Sign<E, Bd, BLK, K>
impl<E: IntegerElement, Bd: Bound, const BLK: usize, K: SymbolCode> Enumerable<E, Bd> for Sign<E, Bd, BLK, K>
Source§const CODE_SPACE: usize
const CODE_SPACE: usize
Source§const SIGN_BIT_BOOK: bool = true
const SIGN_BIT_BOOK: bool = true
CODE_SPACE is a power of two and book[c][t] == 2 * bit(c, t) - 1
for every code c and every t below its log. Read more