pub struct VectorBuilder { /* private fields */ }Expand description
Fluent builder for vector operations
Implementations§
Source§impl VectorBuilder
impl VectorBuilder
Sourcepub fn from_slice(data: &[f32]) -> Self
pub fn from_slice(data: &[f32]) -> Self
Create a vector builder from existing data
Sourcepub fn with_simd_storage(capacity: usize) -> Self
pub fn with_simd_storage(capacity: usize) -> Self
Create a vector builder with SIMD-aligned storage
Sourcepub fn linspace(self, start: f32, end: f32, num: usize) -> Self
pub fn linspace(self, start: f32, end: f32, num: usize) -> Self
Create a linearly spaced vector
Sourcepub fn add_scalar(self, value: f32) -> Self
pub fn add_scalar(self, value: f32) -> Self
Add a scalar to all elements
Sourcepub fn distance_to(&self, other: &[f32], metric: DistanceMetric) -> f32
pub fn distance_to(&self, other: &[f32], metric: DistanceMetric) -> f32
Calculate distance to another vector
Sourcepub fn activate(self, activation: ActivationFunction) -> Self
pub fn activate(self, activation: ActivationFunction) -> Self
Apply activation function
Sourcepub fn stats(&self) -> VectorStats
pub fn stats(&self) -> VectorStats
Get statistics about the vector
Sourcepub fn build_simd(self) -> SimdVec<f32>
pub fn build_simd(self) -> SimdVec<f32>
Build into a SIMD-aligned vector
Trait Implementations§
Source§impl Clone for VectorBuilder
impl Clone for VectorBuilder
Source§fn clone(&self) -> VectorBuilder
fn clone(&self) -> VectorBuilder
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for VectorBuilder
impl Debug for VectorBuilder
Auto Trait Implementations§
impl Freeze for VectorBuilder
impl RefUnwindSafe for VectorBuilder
impl Send for VectorBuilder
impl Sync for VectorBuilder
impl Unpin for VectorBuilder
impl UnsafeUnpin for VectorBuilder
impl UnwindSafe for VectorBuilder
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more