use crate::{
common,
numeric::Zero,
scalar::{HasScalar, Scalar},
vector::Vector,
};
impl<T, const N: usize> Vector<T, N> {
#[inline]
pub const fn len(&self) -> usize {
N
}
#[inline]
pub const fn is_empty(&self) -> bool {
N == 0
}
}
impl<T, const N: usize> Default for Vector<T, N>
where
Self: Zero,
{
fn default() -> Self {
Self::ZERO
}
}
common::_impl_bytemuck_basic!([T, const N: usize], Vector<T, N>, item: T);
impl<T, const N: usize> HasScalar for Vector<T, N>
where
T: Scalar,
{
type Scalar = T;
}