pub struct LZDiff { /* private fields */ }Expand description
LZ Diff encoder/decoder (V2 implementation)
Implementations§
Source§impl LZDiff
impl LZDiff
Sourcepub fn new(min_match_len: u32) -> Self
pub fn new(min_match_len: u32) -> Self
Create a new LZ diff encoder with the given minimum match length
Sourcepub fn encode(&mut self, target: &Contig) -> Vec<u8> ⓘ
pub fn encode(&mut self, target: &Contig) -> Vec<u8> ⓘ
Encode target sequence relative to reference
Sourcepub fn get_coding_cost_vector(
&self,
target: &Contig,
prefix_costs: bool,
) -> Vec<u32>
pub fn get_coding_cost_vector( &self, target: &Contig, prefix_costs: bool, ) -> Vec<u32>
Get coding cost vector for target sequence This computes the per-position cost of encoding the target against the reference Returns a vector where v_costs[i] is the cost of encoding position i If prefix_costs=true, match cost is placed at start of match; otherwise at end
Sourcepub fn estimate(&self, target: &Contig, bound: u32) -> u32
pub fn estimate(&self, target: &Contig, bound: u32) -> u32
Estimate encoding cost without actually encoding (matches C++ CLZDiff_V2::Estimate) This is faster than full encode and used for terminator grouping decisions.
§Arguments
target- Target sequence to estimate encoding cost forbound- Early termination bound (return early if cost exceeds this)
§Returns
Estimated encoding cost in bytes
Auto Trait Implementations§
impl Freeze for LZDiff
impl RefUnwindSafe for LZDiff
impl Send for LZDiff
impl Sync for LZDiff
impl Unpin for LZDiff
impl UnwindSafe for LZDiff
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more