diff -r b4a47e8e80d1 -r fd9dba51afd3 src/euclidean.rs --- a/src/euclidean.rs Wed Sep 03 09:52:30 2025 -0500 +++ b/src/euclidean.rs Wed Sep 03 10:08:28 2025 -0500 @@ -18,10 +18,11 @@ /// as an inner product. // TODO: remove F parameter, use VectorSpace::Field pub trait Euclidean: - VectorSpace - + Reflexive + VectorSpace + Reflexive { - type OwnedEuclidean: ClosedEuclidean; + /// Principal form of the space; always equal to [`Space::Principal`] and + /// [`VectorSpace::PrincipalV`], but with more traits guaranteed. + type PrincipalE: ClosedEuclidean; // Inner product fn dot>(&self, other: I) -> F; @@ -56,7 +57,7 @@ /// Projection to the 2-ball. #[inline] - fn proj_ball2(self, ρ: F) -> Self::Owned { + fn proj_ball2(self, ρ: F) -> Self::PrincipalV { let r = self.norm2(); if r > ρ { self * (ρ / r) @@ -67,10 +68,10 @@ } pub trait ClosedEuclidean: - Instance + Euclidean + Instance + Euclidean { } -impl + Euclidean> ClosedEuclidean for X {} +impl + Euclidean> ClosedEuclidean for X {} // TODO: remove F parameter, use AXPY::Field pub trait EuclideanMut: Euclidean + AXPY { @@ -89,5 +90,5 @@ /// Trait for [`Euclidean`] spaces with dimensions known at compile time. pub trait StaticEuclidean: Euclidean { /// Returns the origin - fn origin() -> ::Owned; + fn origin() -> ::PrincipalV; }