Trait radix_heap::Radix
source · pub trait Radix {
const RADIX_BITS: u32;
// Required method
fn radix_similarity(&self, other: &Self) -> u32;
// Provided method
fn radix_distance(&self, other: &Self) -> u32 { ... }
}
Expand description
A number that can be compared using radix distance
Required Associated Constants§
sourceconst RADIX_BITS: u32
const RADIX_BITS: u32
The value returned by radix_similarty
if all bits are equal
Required Methods§
sourcefn radix_similarity(&self, other: &Self) -> u32
fn radix_similarity(&self, other: &Self) -> u32
The number of high bits in a row that this and other
has in common
Eg. the radix similarity of 001001 and 000001 is 2 because they share the 2 high bits.
Provided Methods§
sourcefn radix_distance(&self, other: &Self) -> u32
fn radix_distance(&self, other: &Self) -> u32
Opposite of radix_similarity
. If radix_distance
returns 0, then radix_similarity
returns radix_bits
and vice versa.