src/euclidean/wrap.rs

branch
dev
changeset 176
21e51de02ab6
parent 175
ef02a80bf4bc
child 177
b071a1b484f8
--- a/src/euclidean/wrap.rs	Wed Sep 03 22:05:33 2025 -0500
+++ b/src/euclidean/wrap.rs	Fri Sep 05 00:16:08 2025 -0500
@@ -124,6 +124,7 @@
     //     $crate::wrap!(imp<> do $type);
     // };
     ($F:ty; $type:ty where $($qual:tt)*) => {
+
         $crate::wrap!(impl_unary $type, std::ops::Neg, neg where $($qual)*);
         $crate::wrap!(impl_binary $type, std::ops::Add, add where $($qual)*);
         $crate::wrap!(impl_binary $type, std::ops::Sub, sub where $($qual)*);
@@ -140,14 +141,14 @@
         impl<$($qual)*> $crate::norms::Norm<$crate::norms::L2, $F> for $type
         {
             fn norm(&self, p : $crate::norms::L2) -> $F {
-                self.get_view().norm(p)
+                $crate::norms::Norm::norm(&self.get_view(), p)
             }
         }
 
         impl<$($qual)*> $crate::norms::Dist<$crate::norms::L2, $F> for $type
         {
             fn dist<I: $crate::instance::Instance<Self>>(&self, other : I, p : $crate::norms::L2) -> $F {
-                other.eval_decompose(|x| self.get_view().dist(p, x))
+                other.eval_ref(|x| self.get_view().dist(x, p))
             }
         }
 
@@ -163,7 +164,7 @@
             type DualSpace = Self;
 
             fn dual_origin(&self) -> Self {
-                self.similar_origin(self)
+                $crate::linops::VectorSpace::similar_origin(self)
             }
         }
 
@@ -231,7 +232,7 @@
 
             fn copy_from<I: $crate::instance::Instance<Self>>(&mut self, x: I) {
                 x.eval_decompose(|v| {
-                    self.get_view_mut().copy_from(v.get_view())
+                    self.get_view_mut().copy_from(&v.get_view())
                 })
             }
 
@@ -248,7 +249,7 @@
         }
 
         impl<$($qual)*> $crate::instance::Space for $type {
-            type Decomp = <<Self as $crate::euclidean::wrap::Wrapped>::Unwrapped as $crate::instance::Space>::Decomp;
+            type Decomp = $crate::instance::BasicDecomposition;
             type Principal = Self;
         }
     };

mercurial