pub struct MinimizersControlMap { /* private fields */ }Expand description
Minimizers Control Map
Associates each unique minimizer with a bucket ID using a minimal perfect hash function for O(1) lookups. After reordering, the MPHF index IS the index into control_codewords.
Implementations§
Source§impl MinimizersControlMap
impl MinimizersControlMap
Sourcepub fn from_parts(
_controls: Vec<MinimizerControl>,
minimizers: Vec<u64>,
num_keys: u64,
) -> Self
pub fn from_parts( _controls: Vec<MinimizerControl>, minimizers: Vec<u64>, num_keys: u64, ) -> Self
Create a MinimizersControlMap from existing parts (for testing)
Sourcepub fn lookup(&self, minimizer: u64) -> Option<usize>
pub fn lookup(&self, minimizer: u64) -> Option<usize>
Look up the MPHF index for a minimizer
Returns the MPHF hash (bucket index into control_codewords), or None if the minimizer is not in the map.
Sourcepub fn num_minimizers(&self) -> u64
pub fn num_minimizers(&self) -> u64
Get the number of unique minimizers
Sourcepub fn mphf_serialized_bytes(&self) -> usize
pub fn mphf_serialized_bytes(&self) -> usize
Exact serialized byte size of the main MPHF
Sourcepub fn serialize_without_mphf<W: Write>(&self, writer: &mut W) -> Result<()>
pub fn serialize_without_mphf<W: Write>(&self, writer: &mut W) -> Result<()>
Serialize control map without MPHF
Only stores num_keys since control_codewords are now in the index.
Sourcepub fn deserialize_without_mphf<R: Read>(reader: &mut R) -> Result<Self>
pub fn deserialize_without_mphf<R: Read>(reader: &mut R) -> Result<Self>
Deserialize control map without MPHF
Returns MinimizersControlMap with empty MPHF (must be filled by caller)
Auto Trait Implementations§
impl Freeze for MinimizersControlMap
impl RefUnwindSafe for MinimizersControlMap
impl Send for MinimizersControlMap
impl Sync for MinimizersControlMap
impl Unpin for MinimizersControlMap
impl UnsafeUnpin for MinimizersControlMap
impl UnwindSafe for MinimizersControlMap
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, U> CastableInto<U> for Twhere
U: CastableFrom<T>,
impl<T, U> CastableInto<U> for Twhere
U: CastableFrom<T>,
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
Truncate the current UnsignedInt to a possibly smaller size
Source§impl<T, U> DowncastableInto<U> for Twhere
U: DowncastableFrom<T>,
impl<T, U> DowncastableInto<U> for Twhere
U: DowncastableFrom<T>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> UpcastableFrom<T> for T
impl<T> UpcastableFrom<T> for T
Source§fn upcast_from(value: T) -> T
fn upcast_from(value: T) -> T
Extend the current UnsignedInt to a possibly bigger size.