src/nalgebra_support.rs

branch
dev
changeset 82
981069ef919b
parent 70
672aec2e1acd
child 85
f2fc6115b897
equal deleted inserted replaced
76:99ad55974e62 82:981069ef919b
87 impl<SM,SV1,M,E> AXPY<E, Vector<E,M,SV1>> for Vector<E,M,SM> 87 impl<SM,SV1,M,E> AXPY<E, Vector<E,M,SV1>> for Vector<E,M,SM>
88 where SM: StorageMut<E,M> + Clone, SV1: Storage<E,M> + Clone, 88 where SM: StorageMut<E,M> + Clone, SV1: Storage<E,M> + Clone,
89 M : Dim, E : Scalar + Zero + One + Float, 89 M : Dim, E : Scalar + Zero + One + Float,
90 DefaultAllocator : Allocator<M> { 90 DefaultAllocator : Allocator<M> {
91 type Owned = OVector<E, M>; 91 type Owned = OVector<E, M>;
92
93 #[inline]
94 fn add_mul<I : Instance<Vector<E,M,SV1>>>(self, α : E, x : I, β : E) -> Self::Owned {
95 let mut owned = self.into_owned();
96 x.eval(|x̃| Matrix::axpy(&mut owned, α, x̃, β));
97 owned
98 }
92 99
93 #[inline] 100 #[inline]
94 fn axpy<I : Instance<Vector<E,M,SV1>>>(&mut self, α : E, x : I, β : E) { 101 fn axpy<I : Instance<Vector<E,M,SV1>>>(&mut self, α : E, x : I, β : E) {
95 x.eval(|x̃| Matrix::axpy(self, α, x̃, β)) 102 x.eval(|x̃| Matrix::axpy(self, α, x̃, β))
96 } 103 }

mercurial