[−][src]Struct lzjd::lz_dict::LZDict
A sorted list of the k smallest LZSet hashes
Methods
impl LZDict
[src]
pub fn from_base64_string(b64: &str) -> Result<Self>
[src]
Converts a base64 string into a Vec
pub fn from_bytes_stream<I, H>(seq_iter: I, build_hasher: &H, k: usize) -> Self where
I: Iterator<Item = u8>,
H: BuildHasher,
[src]
I: Iterator<Item = u8>,
H: BuildHasher,
Creates a LZ dictionary containing the smallest k hashes of LZ sequences obtained from seq_iter.
pub fn jaccard_similarity(&self, other: &Self) -> f32
[src]
Calculates the jaccard similarity of the entries two dictionaries which is defined as the length of the intersection over the length of the union.
pub fn to_string(&self) -> String
[src]
Encodes the contents of the dictionary to base64 and returns it as a string.
pub fn dist(&self, other: &LZDict) -> f32
[src]
Calculates the LZ-distance of two LZ Dictionaries
pub fn similarity(&self, other: &LZDict) -> f32
[src]
Calculates the LZ-similarity of two LZ Dictionaries
Methods from Deref<Target = Vec<u64>>
pub fn capacity(&self) -> usize
1.0.0[src]
Returns the number of elements the vector can hold without reallocating.
Examples
let vec: Vec<i32> = Vec::with_capacity(10); assert_eq!(vec.capacity(), 10);
pub fn as_slice(&self) -> &[T]
1.7.0[src]
Extracts a slice containing the entire vector.
Equivalent to &s[..]
.
Examples
use std::io::{self, Write}; let buffer = vec![1, 2, 3, 5, 8]; io::sink().write(buffer.as_slice()).unwrap();
pub fn len(&self) -> usize
1.0.0[src]
Returns the number of elements in the vector, also referred to as its 'length'.
Examples
let a = vec![1, 2, 3]; assert_eq!(a.len(), 3);
pub fn is_empty(&self) -> bool
1.0.0[src]
Returns true
if the vector contains no elements.
Examples
let mut v = Vec::new(); assert!(v.is_empty()); v.push(1); assert!(!v.is_empty());
Trait Implementations
impl From<Vec<u64>> for LZDict
[src]
impl From<LZDict> for Vec<u64>
[src]
impl Debug for LZDict
[src]
impl Deref for LZDict
[src]
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,