pub struct Offset<E: IntegerElement, BdIn: Bound, BdOut: Bound, C: Codec<E, BdIn>> { /* private fields */ }Expand description
d(c) - z: asymmetric quantization as a codec composition, not a feature.
A zero point is a codec, which is why the library needs no separate “asymmetric” mode and no branch for one (§1.3).
Decoding widens the alphabet: an inner value bounded by BdIn and a zero
point of magnitude |z| produce a value bounded by BdIn + |z|. That is
why the output bound is a separate parameter, and why Offset::new
checks, once and in O(1), that the declared output bound covers the image
and that no value overflows the element type. A None means no such codec
exists — the same category as a non-conformant shape, decided before any
arithmetic (C6).
Implementations§
Source§impl<E: IntegerElement, BdIn: Bound, BdOut: Bound, C: Codec<E, BdIn>> Offset<E, BdIn, BdOut, C>
impl<E: IntegerElement, BdIn: Bound, BdOut: Bound, C: Codec<E, BdIn>> Offset<E, BdIn, BdOut, C>
Trait Implementations§
Source§impl<E: Clone + IntegerElement, BdIn: Clone + Bound, BdOut: Clone + Bound, C: Clone + Codec<E, BdIn>> Clone for Offset<E, BdIn, BdOut, C>
impl<E: Clone + IntegerElement, BdIn: Clone + Bound, BdOut: Clone + Bound, C: Clone + Codec<E, BdIn>> Clone for Offset<E, BdIn, BdOut, C>
Source§impl<E, BdIn, BdOut, C> Codec<E, BdOut> for Offset<E, BdIn, BdOut, C>
impl<E, BdIn, BdOut, C> Codec<E, BdOut> for Offset<E, BdIn, BdOut, C>
Source§const MAX_BLOCK: usize = C::MAX_BLOCK
const MAX_BLOCK: usize = C::MAX_BLOCK
The most alphabet elements one code can produce. Read more
Source§const TIER: TierId = TierId::Offset
const TIER: TierId = TierId::Offset
Which tier this is, for reports and for the kappa manifest.
Source§const IS_FIXED_WIDTH: bool = C::IS_FIXED_WIDTH
const IS_FIXED_WIDTH: bool = C::IS_FIXED_WIDTH
Source§fn decode_len(&self, _code: Self::Code) -> usize
fn decode_len(&self, _code: Self::Code) -> usize
How many elements
code actually produces. Read moreimpl<E: Copy + IntegerElement, BdIn: Copy + Bound, BdOut: Copy + Bound, C: Copy + Codec<E, BdIn>> Copy for Offset<E, BdIn, BdOut, C>
Source§impl<E: Debug + IntegerElement, BdIn: Debug + Bound, BdOut: Debug + Bound, C: Debug + Codec<E, BdIn>> Debug for Offset<E, BdIn, BdOut, C>
impl<E: Debug + IntegerElement, BdIn: Debug + Bound, BdOut: Debug + Bound, C: Debug + Codec<E, BdIn>> Debug for Offset<E, BdIn, BdOut, C>
Source§impl<E, BdIn, BdOut, C> Enumerable<E, BdOut> for Offset<E, BdIn, BdOut, C>
impl<E, BdIn, BdOut, C> Enumerable<E, BdOut> for Offset<E, BdIn, BdOut, C>
Source§const CODE_SPACE: usize = C::CODE_SPACE
const CODE_SPACE: usize = C::CODE_SPACE
The number of distinct codes. Read more
Source§fn as_index_stream(codes: &[Self::Code]) -> Option<IndexStream<'_>>
fn as_index_stream(codes: &[Self::Code]) -> Option<IndexStream<'_>>
The stored code stream, read as the index stream it already is. Read more
Source§const SIGN_BIT_BOOK: bool = false
const SIGN_BIT_BOOK: bool = false
Whether the decoded book is the sign bit-decomposition:
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 moreAuto Trait Implementations§
impl<E, BdIn, BdOut, C> Freeze for Offset<E, BdIn, BdOut, C>
impl<E, BdIn, BdOut, C> RefUnwindSafe for Offset<E, BdIn, BdOut, C>where
C: RefUnwindSafe,
E: RefUnwindSafe,
impl<E, BdIn, BdOut, C> Send for Offset<E, BdIn, BdOut, C>
impl<E, BdIn, BdOut, C> Sync for Offset<E, BdIn, BdOut, C>
impl<E, BdIn, BdOut, C> Unpin for Offset<E, BdIn, BdOut, C>
impl<E, BdIn, BdOut, C> UnsafeUnpin for Offset<E, BdIn, BdOut, C>where
C: UnsafeUnpin,
E: UnsafeUnpin,
impl<E, BdIn, BdOut, C> UnwindSafe for Offset<E, BdIn, BdOut, C>where
C: UnwindSafe,
E: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more