--- a/src/linops.rs Tue Dec 31 23:34:47 2024 -0500 +++ b/src/linops.rs Tue Dec 31 23:49:09 2024 -0500 @@ -22,10 +22,8 @@ F : Num, X : Space, { - type Owned : AXPY<F, X>; - /// Computes `βy + αx`, where `y` is `Self`. - fn add_mul<I : Instance<X>>(self, α : F, x : I, β : F) -> Self::Owned ; + fn add_mul<I : Instance<X>>(self, α : F, x : I, β : F) -> X; /// Computes `y = βy + αx`, where `y` is `Self`. fn axpy<I : Instance<X>>(&mut self, α : F, x : I, β : F); @@ -41,7 +39,7 @@ } /// Return a similar zero as `self`. - fn similar_origin(&self) -> Self::Owned; + fn similar_origin(&self) -> X; /// Set self to zero. fn set_zero(&mut self); @@ -49,10 +47,12 @@ /// Efficient in-place application for [`Linear`] operators. #[replace_float_literals(F::cast_from(literal))] -pub trait GEMV<F : Num, X : Space, Y : AXPY<F> = <Self as Mapping<X>>::Codomain> : Linear<X> { +pub trait GEMV<F : Num, X : Space, Y : AXPY<F> = <Self as Mapping<X>>::Codomain> + : Linear<X, Codomain=Y> +{ /// Computes `αAx + βy`, where `A` is `Self`. - fn apply_add_mul<I : Instance<X>>(&self, y : Y, α : F, x : I, β : F) -> Y::Owned { + fn apply_add_mul<I : Instance<X>>(&self, y : Y, α : F, x : I, β : F) -> Y { y.add_mul(α, self.apply(x), β) }