src/nalgebra_support.rs

branch
dev
changeset 138
593912dc3293
parent 133
2b13f8a0c8ba
child 145
0b9aecd7bb76
--- a/src/nalgebra_support.rs	Mon May 12 20:40:14 2025 -0500
+++ b/src/nalgebra_support.rs	Mon May 12 23:29:17 2025 -0500
@@ -275,12 +275,16 @@
 impl<E, M, S> HasDual<E> for Vector<E, M, S>
 where
     M: Dim,
-    S: Storage<E, M> + Clone,
+    S: StorageMut<E, M> + Clone,
     E: Float + Scalar + Zero + One + RealField,
     DefaultAllocator: Allocator<M>,
 {
     // TODO: Doesn't work with different storage formats.
-    type DualSpace = Self;
+    type DualSpace = Vector<E, M, S>;
+
+    fn dual_origin(&self) -> OVector<E, M> {
+        OVector::zeros_generic(M::from_usize(self.len()), Const)
+    }
 }
 
 impl<E, M, S> Norm<L1, E> for Vector<E, M, S>

mercurial