Skip to main content

Bits

Enum Bits 

Source
pub enum Bits {
    One,
    Four,
}
Expand description

How many bits a coordinate is rounded to.

Variants§

§

One

The sign, which is 96 bytes for a 768 dimensional vector.

§

Four

Sixteen levels, which is 384 bytes for the same vector and about a quarter of the error.

Implementations§

Source§

impl Bits

Source

pub fn count(self) -> usize

How many bits one coordinate takes, which is also how many planes a code is written in.

Source

pub fn query_bits(self) -> usize

How many bits a query is quantised to before it is scanned against codes this wide.

Four bits either side is what RaBitQ specifies, and it is right for a one bit code and wrong for a four bit one, because a four bit code is ten times more accurate and a four bit query is not. Eight is what puts the query’s error back under the code’s, and the cost is four more ANDs and four more popcounts per word on the path that was already paying for four times the bytes.

Trait Implementations§

Source§

impl Clone for Bits

Source§

fn clone(&self) -> Bits

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Bits

Source§

impl Debug for Bits

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for Bits

Source§

impl PartialEq for Bits

Source§

fn eq(&self, other: &Bits) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Bits

Auto Trait Implementations§

§

impl Freeze for Bits

§

impl RefUnwindSafe for Bits

§

impl Send for Bits

§

impl Sync for Bits

§

impl Unpin for Bits

§

impl UnsafeUnpin for Bits

§

impl UnwindSafe for Bits

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.