src/linops.rs

branch
dev
changeset 82
981069ef919b
parent 74
2c76df38d02b
child 83
9b0a7475a786
equal deleted inserted replaced
76:99ad55974e62 82:981069ef919b
22 F : Num, 22 F : Num,
23 X : Space, 23 X : Space,
24 { 24 {
25 type Owned : AXPY<F, X>; 25 type Owned : AXPY<F, X>;
26 26
27 /// Computes `βy + αx`, where `y` is `Self`.
28 fn add_mul<I : Instance<X>>(self, α : F, x : I, β : F) -> Self::Owned ;
29
27 /// Computes `y = βy + αx`, where `y` is `Self`. 30 /// Computes `y = βy + αx`, where `y` is `Self`.
28 fn axpy<I : Instance<X>>(&mut self, α : F, x : I, β : F); 31 fn axpy<I : Instance<X>>(&mut self, α : F, x : I, β : F);
29 32
30 /// Copies `x` to `self`. 33 /// Copies `x` to `self`.
31 fn copy_from<I : Instance<X>>(&mut self, x : I) { 34 fn copy_from<I : Instance<X>>(&mut self, x : I) {
45 } 48 }
46 49
47 /// Efficient in-place application for [`Linear`] operators. 50 /// Efficient in-place application for [`Linear`] operators.
48 #[replace_float_literals(F::cast_from(literal))] 51 #[replace_float_literals(F::cast_from(literal))]
49 pub trait GEMV<F : Num, X : Space, Y = <Self as Mapping<X>>::Codomain> : Linear<X> { 52 pub trait GEMV<F : Num, X : Space, Y = <Self as Mapping<X>>::Codomain> : Linear<X> {
53
50 /// Computes `y = αAx + βy`, where `A` is `Self`. 54 /// Computes `y = αAx + βy`, where `A` is `Self`.
51 fn gemv<I : Instance<X>>(&self, y : &mut Y, α : F, x : I, β : F); 55 fn gemv<I : Instance<X>>(&self, y : &mut Y, α : F, x : I, β : F);
52 56
53 #[inline] 57 #[inline]
54 /// Computes `y = Ax`, where `A` is `Self` 58 /// Computes `y = Ax`, where `A` is `Self`

mercurial