pub trait VecOps: NumAssign + Copy {
// Required methods
fn min(self, rhs: Self) -> Self;
fn max(self, rhs: Self) -> Self;
// Provided methods
unsafe fn vec_dot(
lhs: *const Self,
rhs: *const Self,
res: *mut Self,
len: usize,
) { ... }
unsafe fn vec_reduce_sum(xs: *const Self, res: *mut Self, len: usize) { ... }
unsafe fn vec_reduce_max(xs: *const Self, res: *mut Self, len: usize) { ... }
unsafe fn vec_reduce_min(xs: *const Self, res: *mut Self, len: usize) { ... }
}
Required Methods§
Provided Methods§
Sourceunsafe fn vec_dot(
lhs: *const Self,
rhs: *const Self,
res: *mut Self,
len: usize,
)
unsafe fn vec_dot( lhs: *const Self, rhs: *const Self, res: *mut Self, len: usize, )
Dot-product of two vectors.
§Safety
The length of lhs
and rhs
have to be at least len
. res
has to point to a valid
element.
Sourceunsafe fn vec_reduce_sum(xs: *const Self, res: *mut Self, len: usize)
unsafe fn vec_reduce_sum(xs: *const Self, res: *mut Self, len: usize)
Sum of all elements in a vector.
§Safety
The length of xs
must be at least len
. res
has to point to a valid
element.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.