src/loc.rs

branch
dev
changeset 129
d2994e34a5f5
parent 124
6aa955ad8122
child 131
8264d72aa347
child 132
89371dc4d637
equal deleted inserted replaced
128:f75bf34adda0 129:d2994e34a5f5
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 }

mercurial