| 273 } |
273 } |
| 274 |
274 |
| 275 impl<E, M, S> HasDual<E> for Vector<E, M, S> |
275 impl<E, M, S> HasDual<E> for Vector<E, M, S> |
| 276 where |
276 where |
| 277 M: Dim, |
277 M: Dim, |
| 278 S: Storage<E, M> + Clone, |
278 S: StorageMut<E, M> + Clone, |
| 279 E: Float + Scalar + Zero + One + RealField, |
279 E: Float + Scalar + Zero + One + RealField, |
| 280 DefaultAllocator: Allocator<M>, |
280 DefaultAllocator: Allocator<M>, |
| 281 { |
281 { |
| 282 // TODO: Doesn't work with different storage formats. |
282 // TODO: Doesn't work with different storage formats. |
| 283 type DualSpace = Self; |
283 type DualSpace = Vector<E, M, S>; |
| |
284 |
| |
285 fn dual_origin(&self) -> OVector<E, M> { |
| |
286 OVector::zeros_generic(M::from_usize(self.len()), Const) |
| |
287 } |
| 284 } |
288 } |
| 285 |
289 |
| 286 impl<E, M, S> Norm<L1, E> for Vector<E, M, S> |
290 impl<E, M, S> Norm<L1, E> for Vector<E, M, S> |
| 287 where |
291 where |
| 288 M: Dim, |
292 M: Dim, |