pub trait ParallelVectorNorm<T: FpScalar + Send + Sync>: VectorNorm<T> {
// Required method
fn compute_vector_norm_par_iter<I: IntoParallelIterator<Item = T>>(
iter: I,
) -> NonNegativeRealScalar<T::RealType>;
// Provided method
fn compute_vector_norm_par(v: &[T]) -> NonNegativeRealScalar<T::RealType> { ... }
}Expand description
Parallel vector norm computation.
Extends VectorNorm with parallel variants that distribute work across
threads using rayon. Chunks are accumulated independently and merged via
Accumulator::combine.
Requires T: Send + Sync.
§Methods
compute_vector_norm_par— parallel slice.compute_vector_norm_par_iter— parallel iterator; must be implemented by each norm type.
Required Methods§
Sourcefn compute_vector_norm_par_iter<I: IntoParallelIterator<Item = T>>(
iter: I,
) -> NonNegativeRealScalar<T::RealType>
fn compute_vector_norm_par_iter<I: IntoParallelIterator<Item = T>>( iter: I, ) -> NonNegativeRealScalar<T::RealType>
Computes the norm from an owned parallel iterator.
Provided Methods§
Sourcefn compute_vector_norm_par(v: &[T]) -> NonNegativeRealScalar<T::RealType>
fn compute_vector_norm_par(v: &[T]) -> NonNegativeRealScalar<T::RealType>
Computes the norm of a slice in parallel.
The default implementation calls
compute_vector_norm_par_iter
with v.par_iter().cloned().
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".