diff -r 0a689881b0f1 -r 89371dc4d637 src/euclidean.rs --- a/src/euclidean.rs Mon May 12 16:28:50 2025 -0500 +++ b/src/euclidean.rs Mon May 12 19:30:41 2025 -0500 @@ -3,34 +3,27 @@ */ use crate::instance::Instance; +use crate::linops::AXPY; use crate::norms::{HasDual, Reflexive}; use crate::types::*; -use std::ops::{Add, AddAssign, Div, DivAssign, Mul, MulAssign, Neg, Sub, SubAssign}; +use std::ops::{Add, AddAssign, Sub, SubAssign}; /// Space (type) with Euclidean and vector space structure /// /// The type should implement vector space operations (addition, subtraction, scalar /// multiplication and scalar division) along with their assignment versions, as well /// as an inner product. +// TODO: remove F parameter, use AXPY::Field pub trait Euclidean: HasDual + + AXPY + Reflexive - + Mul>::Output> - + MulAssign - + Div>::Output> - + DivAssign - + Add>::Output> - + Sub>::Output> - + for<'b> Add<&'b Self, Output = >::Output> - + for<'b> Sub<&'b Self, Output = >::Output> - + AddAssign + // TODO: move the following to AXPY + + for<'b> Add<&'b Self, Output = ::Owned> + + for<'b> Sub<&'b Self, Output = ::Owned> + for<'b> AddAssign<&'b Self> - + SubAssign + for<'b> SubAssign<&'b Self> - + Neg>::Output> { - type Output: Euclidean; - // Inner product fn dot>(&self, other: I) -> F; @@ -82,5 +75,5 @@ /// Trait for [`Euclidean`] spaces with dimensions known at compile time. pub trait StaticEuclidean: Euclidean { /// Returns the origin - fn origin() -> >::Output; + fn origin() -> ::Owned; }