simsimd

Struct f16

Source
pub struct f16(/* private fields */);
Expand description

A half-precision floating point number.

Trait Implementations§

Source§

impl ComplexProducts for f16

Source§

fn dot(a: &[Self], b: &[Self]) -> Option<(f64, f64)>

Computes the dot product between two complex number vectors.
Source§

fn vdot(a: &[Self], b: &[Self]) -> Option<(f64, f64)>

Computes the Hermitian dot product (conjugate dot product) between two complex number vectors.
Source§

impl ProbabilitySimilarity for f16

Source§

fn jensenshannon(a: &[Self], b: &[Self]) -> Option<f64>

Computes the Jensen-Shannon divergence between two probability distributions. The Jensen-Shannon divergence is a method of measuring the similarity between two probability distributions. It is based on the Kullback-Leibler divergence, but is symmetric and always has a finite value.
Source§

fn kullbackleibler(a: &[Self], b: &[Self]) -> Option<f64>

Computes the Kullback-Leibler divergence between two probability distributions. The Kullback-Leibler divergence is a measure of how one probability distribution diverges from a second, expected probability distribution.
Source§

impl SpatialSimilarity for f16

Source§

fn cos(a: &[Self], b: &[Self]) -> Option<f64>

Computes the cosine similarity between two slices. The cosine similarity is a measure of similarity between two non-zero vectors of an dot product space that measures the cosine of the angle between them.
Source§

fn dot(a: &[Self], b: &[Self]) -> Option<f64>

Computes the inner product (also known as dot product) between two slices. The dot product is the sum of the products of the corresponding entries of the two sequences of numbers.
Source§

fn l2sq(a: &[Self], b: &[Self]) -> Option<f64>

Computes the squared Euclidean distance between two slices. The squared Euclidean distance is the sum of the squared differences between corresponding elements of the two slices.
Source§

fn sqeuclidean(a: &[Self], b: &[Self]) -> Option<f64>

Computes the squared Euclidean distance between two slices. The squared Euclidean distance is the sum of the squared differences between corresponding elements of the two slices.
Source§

fn inner(a: &[Self], b: &[Self]) -> Option<f64>

Computes the squared Euclidean distance between two slices. The squared Euclidean distance is the sum of the squared differences between corresponding elements of the two slices.
Source§

fn cosine(a: &[Self], b: &[Self]) -> Option<f64>

Computes the cosine similarity between two slices. The cosine similarity is a measure of similarity between two non-zero vectors of an dot product space that measures the cosine of the angle between them.

Auto Trait Implementations§

§

impl Freeze for f16

§

impl RefUnwindSafe for f16

§

impl Send for f16

§

impl Sync for f16

§

impl Unpin for f16

§

impl UnwindSafe for f16

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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.