Added Scale *= scalar + reordered ops

This commit is contained in:
Yuri Edward 2021-10-24 20:55:10 +02:00
parent 0aba533556
commit 6d3978b212

View File

@ -78,18 +78,6 @@ add_sub_impl!(Mul, mul, ClosedMul;
self: Scale<T, D>, right: Point<T, D>, Output = Point<T, D>; self: Scale<T, D>, right: Point<T, D>, Output = Point<T, D>;
#[allow(clippy::suspicious_arithmetic_impl)] { Point::from(self.vector.component_mul(&right.coords)) }; ); #[allow(clippy::suspicious_arithmetic_impl)] { Point::from(self.vector.component_mul(&right.coords)) }; );
// Scale *= Scale
add_sub_assign_impl!(MulAssign, mul_assign, ClosedMul;
const D;
self: Scale<T, D>, right: &'b Scale<T, D>;
#[allow(clippy::suspicious_op_assign_impl)] { self.vector.component_mul_assign(&right.vector); };
'b);
add_sub_assign_impl!(MulAssign, mul_assign, ClosedMul;
const D;
self: Scale<T, D>, right: Scale<T, D>;
#[allow(clippy::suspicious_op_assign_impl)] { self.vector.component_mul_assign(&right.vector); }; );
// Scale * Vector // Scale * Vector
add_sub_impl!(Mul, mul, ClosedMul; add_sub_impl!(Mul, mul, ClosedMul;
(Const<D>, U1), (Const<D>, U1) -> (Const<D>, U1) (Const<D>, U1), (Const<D>, U1) -> (Const<D>, U1)
@ -117,3 +105,21 @@ add_sub_impl!(Mul, mul, ClosedMul;
const D; for; where; const D; for; where;
self: Scale<T, D>, right: SVector<T, D>, Output = SVector<T, D>; self: Scale<T, D>, right: SVector<T, D>, Output = SVector<T, D>;
#[allow(clippy::suspicious_arithmetic_impl)] { SVector::from(self.vector.component_mul(&right)) }; ); #[allow(clippy::suspicious_arithmetic_impl)] { SVector::from(self.vector.component_mul(&right)) }; );
// Scale *= Scale
add_sub_assign_impl!(MulAssign, mul_assign, ClosedMul;
const D;
self: Scale<T, D>, right: &'b Scale<T, D>;
#[allow(clippy::suspicious_op_assign_impl)] { self.vector.component_mul_assign(&right.vector); };
'b);
add_sub_assign_impl!(MulAssign, mul_assign, ClosedMul;
const D;
self: Scale<T, D>, right: Scale<T, D>;
#[allow(clippy::suspicious_op_assign_impl)] { self.vector.component_mul_assign(&right.vector); }; );
// Scale ×= scalar
add_sub_assign_impl!(MulAssign, mul_assign, ClosedMul;
const D;
self: Scale<T, D>, right: T;
#[allow(clippy::suspicious_op_assign_impl)] { self.vector *= right }; );