pub struct CodesStats<const ZETA: usize = 10, const GOLOMB: usize = 20, const EXP_GOLOMB: usize = 10, const RICE: usize = 10, const PI: usize = 10> {
pub total: u64,
pub unary: u64,
pub gamma: u64,
pub delta: u64,
pub omega: u64,
pub vbyte: u64,
pub zeta: [u64; ZETA],
pub golomb: [u64; GOLOMB],
pub exp_golomb: [u64; EXP_GOLOMB],
pub rice: [u64; RICE],
pub pi: [u64; PI],
}
Expand description
Keeps track of the space needed to store a stream of integers using different codes.
This structure can be used to determine empirically which code provides the
best compression for a given stream. You have to update the
structure with the integers in the stream; at any time, you
can examine the statistics or call best_code
to get the
best code.
Fields§
§total: u64
The total number of elements observed.
unary: u64
The total space used to store the elements if they were stored using the unary code.
gamma: u64
The total space used to store the elements if they were stored using the gamma code.
delta: u64
The total space used to store the elements if they were stored using the delta code.
omega: u64
The total space used to store the elements if they were stored using the omega code.
vbyte: u64
The total space used to store the elements if they were stored using the variable byte code.
zeta: [u64; ZETA]
The total space used to store the elements if they were stored using the zeta code.
golomb: [u64; GOLOMB]
The total space used to store the elements if they were stored using the Golomb code.
exp_golomb: [u64; EXP_GOLOMB]
The total space used to store the elements if they were stored using the exponential Golomb code.
rice: [u64; RICE]
The total space used to store the elements if they were stored using the Rice code.
pi: [u64; PI]
The total space used to store the elements if they were stored using the Pi code.
Implementations§
Source§impl<const ZETA: usize, const GOLOMB: usize, const EXP_GOLOMB: usize, const RICE: usize, const PI: usize> CodesStats<ZETA, GOLOMB, EXP_GOLOMB, RICE, PI>
impl<const ZETA: usize, const GOLOMB: usize, const EXP_GOLOMB: usize, const RICE: usize, const PI: usize> CodesStats<ZETA, GOLOMB, EXP_GOLOMB, RICE, PI>
Trait Implementations§
Source§impl<const ZETA: usize, const GOLOMB: usize, const EXP_GOLOMB: usize, const RICE: usize, const PI: usize> Add for CodesStats<ZETA, GOLOMB, EXP_GOLOMB, RICE, PI>
Combines additively this stats with another one creating a new one.
impl<const ZETA: usize, const GOLOMB: usize, const EXP_GOLOMB: usize, const RICE: usize, const PI: usize> Add for CodesStats<ZETA, GOLOMB, EXP_GOLOMB, RICE, PI>
Combines additively this stats with another one creating a new one.
Source§impl<const ZETA: usize, const GOLOMB: usize, const EXP_GOLOMB: usize, const RICE: usize, const PI: usize> AddAssign for CodesStats<ZETA, GOLOMB, EXP_GOLOMB, RICE, PI>
Combines additively this stats with another one.
impl<const ZETA: usize, const GOLOMB: usize, const EXP_GOLOMB: usize, const RICE: usize, const PI: usize> AddAssign for CodesStats<ZETA, GOLOMB, EXP_GOLOMB, RICE, PI>
Combines additively this stats with another one.
Source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
+=
operation. Read moreSource§impl<const ZETA: usize, const GOLOMB: usize, const EXP_GOLOMB: usize, const RICE: usize, const PI: usize> Clone for CodesStats<ZETA, GOLOMB, EXP_GOLOMB, RICE, PI>
impl<const ZETA: usize, const GOLOMB: usize, const EXP_GOLOMB: usize, const RICE: usize, const PI: usize> Clone for CodesStats<ZETA, GOLOMB, EXP_GOLOMB, RICE, PI>
Source§fn clone(&self) -> CodesStats<ZETA, GOLOMB, EXP_GOLOMB, RICE, PI>
fn clone(&self) -> CodesStats<ZETA, GOLOMB, EXP_GOLOMB, RICE, PI>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl<const ZETA: usize, const GOLOMB: usize, const EXP_GOLOMB: usize, const RICE: usize, const PI: usize> CopyType for CodesStats<ZETA, GOLOMB, EXP_GOLOMB, RICE, PI>
impl<const ZETA: usize, const GOLOMB: usize, const EXP_GOLOMB: usize, const RICE: usize, const PI: usize> CopyType for CodesStats<ZETA, GOLOMB, EXP_GOLOMB, RICE, PI>
Source§impl<const ZETA: usize, const GOLOMB: usize, const EXP_GOLOMB: usize, const RICE: usize, const PI: usize> Debug for CodesStats<ZETA, GOLOMB, EXP_GOLOMB, RICE, PI>
impl<const ZETA: usize, const GOLOMB: usize, const EXP_GOLOMB: usize, const RICE: usize, const PI: usize> Debug for CodesStats<ZETA, GOLOMB, EXP_GOLOMB, RICE, PI>
Source§impl<const ZETA: usize, const GOLOMB: usize, const EXP_GOLOMB: usize, const RICE: usize, const PI: usize> Default for CodesStats<ZETA, GOLOMB, EXP_GOLOMB, RICE, PI>
impl<const ZETA: usize, const GOLOMB: usize, const EXP_GOLOMB: usize, const RICE: usize, const PI: usize> Default for CodesStats<ZETA, GOLOMB, EXP_GOLOMB, RICE, PI>
Source§impl<const ZETA: usize, const GOLOMB: usize, const EXP_GOLOMB: usize, const RICE: usize, const PI: usize> MemDbgImpl for CodesStats<ZETA, GOLOMB, EXP_GOLOMB, RICE, PI>where
u64: MemDbgImpl,
[u64; ZETA]: MemDbgImpl,
[u64; GOLOMB]: MemDbgImpl,
[u64; EXP_GOLOMB]: MemDbgImpl,
[u64; RICE]: MemDbgImpl,
[u64; PI]: MemDbgImpl,
impl<const ZETA: usize, const GOLOMB: usize, const EXP_GOLOMB: usize, const RICE: usize, const PI: usize> MemDbgImpl for CodesStats<ZETA, GOLOMB, EXP_GOLOMB, RICE, PI>where
u64: MemDbgImpl,
[u64; ZETA]: MemDbgImpl,
[u64; GOLOMB]: MemDbgImpl,
[u64; EXP_GOLOMB]: MemDbgImpl,
[u64; RICE]: MemDbgImpl,
[u64; PI]: MemDbgImpl,
fn _mem_dbg_rec_on( &self, _memdbg_writer: &mut impl Write, _memdbg_total_size: usize, _memdbg_max_depth: usize, _memdbg_prefix: &mut String, _memdbg_is_last: bool, _memdbg_flags: DbgFlags, ) -> Result
fn _mem_dbg_depth_on( &self, writer: &mut impl Write, total_size: usize, max_depth: usize, prefix: &mut String, field_name: Option<&str>, is_last: bool, padded_size: usize, flags: DbgFlags, ) -> Result<(), Error>
Source§impl<const ZETA: usize, const GOLOMB: usize, const EXP_GOLOMB: usize, const RICE: usize, const PI: usize> MemSize for CodesStats<ZETA, GOLOMB, EXP_GOLOMB, RICE, PI>
impl<const ZETA: usize, const GOLOMB: usize, const EXP_GOLOMB: usize, const RICE: usize, const PI: usize> MemSize for CodesStats<ZETA, GOLOMB, EXP_GOLOMB, RICE, PI>
Source§impl<const ZETA: usize, const GOLOMB: usize, const EXP_GOLOMB: usize, const RICE: usize, const PI: usize> Sum for CodesStats<ZETA, GOLOMB, EXP_GOLOMB, RICE, PI>
Allow to call .sum() on an iterator of CodesStats.
impl<const ZETA: usize, const GOLOMB: usize, const EXP_GOLOMB: usize, const RICE: usize, const PI: usize> Sum for CodesStats<ZETA, GOLOMB, EXP_GOLOMB, RICE, PI>
Allow to call .sum() on an iterator of CodesStats.
impl<const ZETA: usize, const GOLOMB: usize, const EXP_GOLOMB: usize, const RICE: usize, const PI: usize> Copy for CodesStats<ZETA, GOLOMB, EXP_GOLOMB, RICE, PI>
Auto Trait Implementations§
impl<const ZETA: usize, const GOLOMB: usize, const EXP_GOLOMB: usize, const RICE: usize, const PI: usize> Freeze for CodesStats<ZETA, GOLOMB, EXP_GOLOMB, RICE, PI>
impl<const ZETA: usize, const GOLOMB: usize, const EXP_GOLOMB: usize, const RICE: usize, const PI: usize> RefUnwindSafe for CodesStats<ZETA, GOLOMB, EXP_GOLOMB, RICE, PI>
impl<const ZETA: usize, const GOLOMB: usize, const EXP_GOLOMB: usize, const RICE: usize, const PI: usize> Send for CodesStats<ZETA, GOLOMB, EXP_GOLOMB, RICE, PI>
impl<const ZETA: usize, const GOLOMB: usize, const EXP_GOLOMB: usize, const RICE: usize, const PI: usize> Sync for CodesStats<ZETA, GOLOMB, EXP_GOLOMB, RICE, PI>
impl<const ZETA: usize, const GOLOMB: usize, const EXP_GOLOMB: usize, const RICE: usize, const PI: usize> Unpin for CodesStats<ZETA, GOLOMB, EXP_GOLOMB, RICE, PI>
impl<const ZETA: usize, const GOLOMB: usize, const EXP_GOLOMB: usize, const RICE: usize, const PI: usize> UnwindSafe for CodesStats<ZETA, GOLOMB, EXP_GOLOMB, RICE, PI>
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
Source§impl<T, U> CastableInto<U> for Twhere
U: CastableFrom<T>,
impl<T, U> CastableInto<U> for Twhere
U: CastableFrom<T>,
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DowncastableFrom<T> for T
impl<T> DowncastableFrom<T> for T
Source§fn downcast_from(value: T) -> T
fn downcast_from(value: T) -> T
Source§impl<T, U> DowncastableInto<U> for Twhere
U: DowncastableFrom<T>,
impl<T, U> DowncastableInto<U> for Twhere
U: DowncastableFrom<T>,
Source§impl<T> MemDbg for Twhere
T: MemDbgImpl,
impl<T> MemDbg for Twhere
T: MemDbgImpl,
Source§fn mem_dbg(&self, flags: DbgFlags) -> Result<(), Error>
fn mem_dbg(&self, flags: DbgFlags) -> Result<(), Error>
Source§fn mem_dbg_on(
&self,
writer: &mut impl Write,
flags: DbgFlags,
) -> Result<(), Error>
fn mem_dbg_on( &self, writer: &mut impl Write, flags: DbgFlags, ) -> Result<(), Error>
core::fmt::Write
debug infos about the structure memory
usage, expanding all levels of nested structures.Source§fn mem_dbg_depth(&self, max_depth: usize, flags: DbgFlags) -> Result<(), Error>
fn mem_dbg_depth(&self, max_depth: usize, flags: DbgFlags) -> Result<(), Error>
mem_dbg
, but expanding only up to max_depth
levels of nested structures.Source§fn mem_dbg_depth_on(
&self,
writer: &mut impl Write,
max_depth: usize,
flags: DbgFlags,
) -> Result<(), Error>
fn mem_dbg_depth_on( &self, writer: &mut impl Write, max_depth: usize, flags: DbgFlags, ) -> Result<(), Error>
core::fmt::Write
debug infos about the structure memory
usage as mem_dbg_on
, but expanding only up to
max_depth
levels of nested structures.