src/norms.rs

branch
dev
changeset 151
402d717bb5c0
parent 150
c4e394a9c84c
child 163
b4a47e8e80d1
--- a/src/norms.rs	Mon Sep 01 13:51:03 2025 -0500
+++ b/src/norms.rs	Mon Sep 01 20:55:34 2025 -0500
@@ -4,7 +4,7 @@
 
 use crate::euclidean::*;
 use crate::instance::Ownable;
-use crate::linops::VectorSpace;
+use crate::linops::{ClosedVectorSpace, VectorSpace};
 use crate::mapping::{Instance, Mapping, Space};
 use crate::types::*;
 use serde::{Deserialize, Serialize};
@@ -229,7 +229,7 @@
 }
 
 pub trait HasDual<F: Num = f64>: Normed<F> + VectorSpace<Field = F> {
-    type DualSpace: Normed<F> + VectorSpace<Field = F>;
+    type DualSpace: Normed<F> + ClosedVectorSpace<Field = F>;
 
     fn dual_origin(&self) -> <Self::DualSpace as VectorSpace>::Owned;
 }
@@ -237,11 +237,14 @@
 /// Automatically implemented trait for reflexive spaces
 pub trait Reflexive<F: Num = f64>: HasDual<F>
 where
-    Self::DualSpace: HasDual<F, DualSpace = Self>,
+    Self::DualSpace: HasDual<F, DualSpace = Self::OwnedSpace>,
 {
 }
 
-impl<F: Num, X: HasDual<F>> Reflexive<F> for X where X::DualSpace: HasDual<F, DualSpace = X> {}
+impl<F: Num, X: HasDual<F>> Reflexive<F> for X where
+    X::DualSpace: HasDual<F, DualSpace = Self::OwnedSpace>
+{
+}
 
 pub trait HasDualExponent: NormExponent {
     type DualExp: NormExponent;

mercurial