diff -r c4e394a9c84c -r 402d717bb5c0 src/direct_product.rs --- a/src/direct_product.rs Mon Sep 01 13:51:03 2025 -0500 +++ b/src/direct_product.rs Mon Sep 01 20:55:34 2025 -0500 @@ -6,9 +6,7 @@ */ use crate::euclidean::Euclidean; -use crate::instance::{ - ClosedSpace, Decomposition, DecompositionMut, Instance, InstanceMut, MyCow, Ownable, -}; +use crate::instance::{Decomposition, DecompositionMut, Instance, InstanceMut, MyCow, Ownable}; use crate::linops::{VectorSpace, AXPY}; use crate::loc::Loc; use crate::mapping::Space; @@ -289,22 +287,24 @@ where A: Euclidean, B: Euclidean, - //Pair: Euclidean, - Self: Sized - + Mul::Owned> - + MulAssign - + Div::Owned> - + DivAssign - + Add::Owned> - + Sub::Owned> - + for<'b> Add<&'b Self, Output = ::Owned> - + for<'b> Sub<&'b Self, Output = ::Owned> - + AddAssign - + for<'b> AddAssign<&'b Self> - + SubAssign - + for<'b> SubAssign<&'b Self> - + Neg::Owned>, + // //Pair: Euclidean, + // Self: Sized + // + Mul + // + MulAssign + // + Div + // + DivAssign + // + Add + // + Sub + // + for<'b> Add<&'b Self, Output = Self::OwnedEuclidean> + // + for<'b> Sub<&'b Self, Output = Self::OwnedEuclidean> + // + AddAssign + // + for<'b> AddAssign<&'b Self> + // + SubAssign + // + for<'b> SubAssign<&'b Self> + // + Neg, { + type OwnedEuclidean = Pair; + fn dot>(&self, other: I) -> F { other.eval_decompose(|Pair(u, v)| self.0.dot(u) + self.1.dot(v)) } @@ -318,16 +318,14 @@ } } -impl VectorSpace for Pair +impl VectorSpace for Pair where - A: VectorSpace, - B: VectorSpace, - O: ClosedSpace + AXPY, - P: ClosedSpace + AXPY, + A: VectorSpace, + B: VectorSpace, F: Num, { type Field = F; - type Owned = Pair; + type Owned = Pair; /// Return a similar zero as `self`. fn similar_origin(&self) -> Self::Owned { @@ -347,8 +345,8 @@ A: AXPY, B: AXPY, F: Num, - Self: MulAssign + DivAssign, - Pair: MulAssign + DivAssign, + // Self: MulAssign + DivAssign, + // Pair: MulAssign + DivAssign, { fn axpy>>(&mut self, α: F, x: I, β: F) { x.eval_decompose(|Pair(u, v)| { @@ -383,6 +381,7 @@ pub struct PairDecomposition(D, Q); impl Space for Pair { + type OwnedSpace = Pair; type Decomp = PairDecomposition; }