holy wide dot batman
This commit is contained in:
parent
4ae391e9fd
commit
e1368962c1
@ -11,13 +11,17 @@ macro_rules! impl_wide_operations {
|
||||
}
|
||||
}
|
||||
}
|
||||
impl<V:core::ops::Add<Output=V>,U,T:fixed_wide_traits::wide::WideMul<U,Output=V>> fixed_wide_traits::wide::WideDot<$struct<U>> for $struct<T> {
|
||||
type Output=V;
|
||||
#[inline]
|
||||
fn wide_dot(self, rhs: $struct<U>) -> Self::Output {
|
||||
$crate::sum_repeating!(
|
||||
$( + (self.$field.wide_mul(rhs.$field)) ) +
|
||||
)
|
||||
}
|
||||
}
|
||||
impl<U:std::ops::Add<Output=U>,T:Copy+fixed_wide_traits::wide::WideMul<Output=U>> $struct<T> {
|
||||
#[inline]
|
||||
pub fn wide_dot(self, other: Self) -> U {
|
||||
$crate::sum_repeating!(
|
||||
$( + (self.$field.wide_mul(other.$field)) ) +
|
||||
)
|
||||
}
|
||||
pub fn wide_length_squared(&self) -> U {
|
||||
let squared = $struct {
|
||||
$( $field: self.$field.wide_mul(self.$field) ), +
|
||||
|
@ -1,4 +1,5 @@
|
||||
use fixed_wide_traits::wide::WideMul;
|
||||
use fixed_wide_traits::wide::WideDot;
|
||||
|
||||
use crate::Vector3;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user