| 708 } |
708 } |
| 709 } |
709 } |
| 710 |
710 |
| 711 impl<F: Float, const N: usize> Linear<Loc<N, F>> for Loc<N, F> {} |
711 impl<F: Float, const N: usize> Linear<Loc<N, F>> for Loc<N, F> {} |
| 712 |
712 |
| 713 impl<F: Float, const N: usize> AXPY<F, Loc<N, F>> for Loc<N, F> { |
713 impl<F: Float, const N: usize> AXPY<Loc<N, F>> for Loc<N, F> { |
| |
714 type Field = F; |
| 714 type Owned = Self; |
715 type Owned = Self; |
| 715 |
716 |
| 716 #[inline] |
717 #[inline] |
| 717 fn axpy<I: Instance<Loc<N, F>>>(&mut self, α: F, x: I, β: F) { |
718 fn axpy<I: Instance<Loc<N, F>>>(&mut self, α: F, x: I, β: F) { |
| 718 x.eval(|x̃| { |
719 x.eval(|x̃| { |
| 727 #[inline] |
728 #[inline] |
| 728 fn copy_from<I: Instance<Loc<N, F>>>(&mut self, x: I) { |
729 fn copy_from<I: Instance<Loc<N, F>>>(&mut self, x: I) { |
| 729 x.eval(|x̃| map2_mut(self, x̃, |yi, xi| *yi = *xi)) |
730 x.eval(|x̃| map2_mut(self, x̃, |yi, xi| *yi = *xi)) |
| 730 } |
731 } |
| 731 |
732 |
| |
733 // #[inline] |
| |
734 // fn make_origin_generator(&self) -> StaticEuclideanOriginGenerator { |
| |
735 // StaticEuclideanOriginGenerator |
| |
736 // } |
| |
737 |
| 732 #[inline] |
738 #[inline] |
| 733 fn similar_origin(&self) -> Self::Owned { |
739 fn similar_origin(&self) -> Self::Owned { |
| 734 Self::ORIGIN |
740 Self::ORIGIN |
| 735 } |
741 } |
| 736 |
742 |
| 737 #[inline] |
743 #[inline] |
| |
744 fn similar_origin_inst<I: Instance<Self>>(_: I) -> Self::Owned { |
| |
745 Self::ORIGIN |
| |
746 } |
| |
747 |
| |
748 #[inline] |
| 738 fn set_zero(&mut self) { |
749 fn set_zero(&mut self) { |
| 739 *self = Self::ORIGIN; |
750 *self = Self::ORIGIN; |
| 740 } |
751 } |
| 741 } |
752 } |