Skip to main content

VectorReduction

Trait VectorReduction 

Source
pub trait VectorReduction<T> {
    // Required methods
    fn sum(&self, vector: &[T]) -> Result<T, SimdError>;
    fn min(&self, vector: &[T]) -> Result<T, SimdError>;
    fn max(&self, vector: &[T]) -> Result<T, SimdError>;
    fn dot_product(&self, a: &[T], b: &[T]) -> Result<T, SimdError>;
    fn norm(&self, vector: &[T]) -> Result<T, SimdError>;
    fn mean(&self, vector: &[T]) -> Result<T, SimdError>;
}
Expand description

Trait for vector reduction operations

Required Methods§

Source

fn sum(&self, vector: &[T]) -> Result<T, SimdError>

Sum all elements in the vector

Source

fn min(&self, vector: &[T]) -> Result<T, SimdError>

Find the minimum element

Source

fn max(&self, vector: &[T]) -> Result<T, SimdError>

Find the maximum element

Source

fn dot_product(&self, a: &[T], b: &[T]) -> Result<T, SimdError>

Compute the dot product of two vectors

Source

fn norm(&self, vector: &[T]) -> Result<T, SimdError>

Compute the L2 norm of a vector

Source

fn mean(&self, vector: &[T]) -> Result<T, SimdError>

Compute the mean of all elements

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl VectorReduction<f32> for TargetOptimizedOps

Target-specific reduction operations