diff -r 981069ef919b -r 9b0a7475a786 src/linops.rs --- a/src/linops.rs Tue Dec 31 10:51:32 2024 -0500 +++ b/src/linops.rs Tue Dec 31 10:57:13 2024 -0500 @@ -49,8 +49,13 @@ /// Efficient in-place application for [`Linear`] operators. #[replace_float_literals(F::cast_from(literal))] -pub trait GEMV>::Codomain> : Linear { +pub trait GEMV = >::Codomain> : Linear { + /// Computes `αAx + βy`, where `A` is `Self`. + fn apply_add_mul>(&self, y : Y, α : F, x : I, β : F) -> Y::Owned { + y.add_mul(α, self.apply(x), β) + } + /// Computes `y = αAx + βy`, where `A` is `Self`. fn gemv>(&self, y : &mut Y, α : F, x : I, β : F); @@ -153,7 +158,7 @@ #[replace_float_literals(F::cast_from(literal))] impl GEMV for IdOp where - Y : AXPY, + Y : AXPY, X : Clone + Space { // Computes `y = αAx + βy`, where `A` is `Self`. @@ -287,6 +292,7 @@ impl GEMV for Composition where F : Num, + Y : AXPY, X : Space, T : Linear, S : GEMV, @@ -361,6 +367,7 @@ where U : Space, V : Space, + Y : AXPY, S : GEMV, T : GEMV, F : Num, @@ -405,13 +412,16 @@ impl Linear for ColOp where A : Space, - S : Mapping, - T : Mapping, + S : Linear, + T : Linear, { } impl GEMV> for ColOp where X : Space, + A : AXPY, + B : AXPY, + Pair : AXPY, S : GEMV, T : GEMV, F : Num, @@ -548,8 +558,9 @@ impl GEMV, Pair> for DiagOp where - A : Space, - B : Space, + A : AXPY, + B : AXPY, + Pair : AXPY, U : Space, V : Space, S : GEMV,