pub struct F32Vector<'a> { /* private fields */ }Implementations§
Source§impl<'a> F32Vector<'a>
impl<'a> F32Vector<'a>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Sourcepub fn l2_dist_squared(&self, othr: &F32Vector<'a>) -> f32
pub fn l2_dist_squared(&self, othr: &F32Vector<'a>) -> f32
§Usage
Computes the SQUARED L2 distance between two vectors. This is cheaper to compute than the regular L2 distance. This is typically useful when comparing two distances :
dist(u,v) < dist(w, x) ⇔ dist(u,v) ** 2 < dist(w,x) ** 2
§Panics
Panics in debug mode if the two vectors have different lengths. In release mode, the longest vector will be silently truncated.
Trait Implementations§
Source§impl<'a> ApproxComparable for F32Vector<'a>
impl<'a> ApproxComparable for F32Vector<'a>
impl Eq for F32Vector<'_>
Auto Trait Implementations§
impl<'a> Freeze for F32Vector<'a>
impl<'a> RefUnwindSafe for F32Vector<'a>
impl<'a> Send for F32Vector<'a>
impl<'a> Sync for F32Vector<'a>
impl<'a> Unpin for F32Vector<'a>
impl<'a> UnwindSafe for F32Vector<'a>
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