[−][src]Struct mih_rs::mih::Index
An index implementation of MIH.
Implementations
impl<'_> Index<'_>
[src]
pub fn new<'db>(codes: &'db [u64]) -> Result<Index, Error>
[src]
Constructs the index from 64-bit codes. If invalid inputs are given, return ErrorKind::InvalidInput.
pub fn new_with_blocks<'db>(
codes: &'db [u64],
blocks: usize
) -> Result<Index, Error>
[src]
codes: &'db [u64],
blocks: usize
) -> Result<Index, Error>
Constructs the index from 64-bit codes using manual parameter of blocks. If invalid inputs are given, return ErrorKind::InvalidInput.
pub fn range_search(&self, qcode: u64, radius: usize) -> Vec<usize>
[src]
Finds the neighbor codes whose Hamming distances to qcode are within radius. Returns the ids of the neighbor codes.
pub fn range_search_with_buf(
&self,
qcode: u64,
radius: usize,
answers: &mut Vec<usize>
)
[src]
&self,
qcode: u64,
radius: usize,
answers: &mut Vec<usize>
)
Finds the neighbor codes whose Hamming distances to qcode are within radius. The ids of the neighbor codes are stored in answers.
pub fn topk_search(&self, qcode: u64, topk: usize) -> Vec<usize>
[src]
Finds the topk codes that are closest to qcode. Returns the ids of the topk codes.
pub fn topk_search_with_buf(
&self,
qcode: u64,
topk: usize,
answers: &mut Vec<usize>
)
[src]
&self,
qcode: u64,
topk: usize,
answers: &mut Vec<usize>
)
Finds the topk codes that are closest to qcode. The ids of the topk codes are stored in answers.
Auto Trait Implementations
impl<'db> RefUnwindSafe for Index<'db>
impl<'db> Send for Index<'db>
impl<'db> Sync for Index<'db>
impl<'db> Unpin for Index<'db>
impl<'db> UnwindSafe for Index<'db>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> 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, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,