MCPcopy Create free account
hub / github.com/bamler-lab/constriction / num_words

Method num_words

src/stream/stack.rs:543–548  ·  view source on GitHub ↗

Returns the number of compressed words on the ANS coder's stack. This includes a constant overhead of between one and two words unless the stack is completely empty. This method returns the length of the slice, the `Vec `, or the iterator that would be returned by [`get_compressed`], [`into_compressed`], or [`iter_compressed`], respectively, when called at this time. See also [`num_bits`].

(&self)

Source from the content-addressed store, hash-verified

541 /// [`iter_compressed`]: #method.iter_compressed
542 /// [`num_bits`]: #method.num_bits
543 pub fn num_words(&self) -> usize
544 where
545 Backend: BoundedReadWords<Word, Stack>,
546 {
547 self.bulk.remaining() + bit_array_to_chunks_truncated::<_, Word>(self.state).len()
548 }
549
550 pub fn num_bits(&self) -> usize
551 where

Callers 1

num_bitsMethod · 0.45

Calls 2

remainingMethod · 0.80
lenMethod · 0.45

Tested by

no test coverage detected