| 2 Array containers that support vector space operations on floats. |
2 Array containers that support vector space operations on floats. |
| 3 For working with small vectors in $ℝ^2$ or $ℝ^3$. |
3 For working with small vectors in $ℝ^2$ or $ℝ^3$. |
| 4 */ |
4 */ |
| 5 |
5 |
| 6 use crate::euclidean::*; |
6 use crate::euclidean::*; |
| 7 use crate::instance::{BasicDecomposition, Instance, Ownable}; |
7 use crate::instance::{BasicDecomposition, Instance, MyCow, Ownable}; |
| 8 use crate::linops::{Linear, Mapping, VectorSpace, AXPY}; |
8 use crate::linops::{Linear, Mapping, VectorSpace, AXPY}; |
| 9 use crate::mapping::Space; |
9 use crate::mapping::Space; |
| 10 use crate::maputil::{map1, map1_mut, map2, map2_mut, FixedLength, FixedLengthMut}; |
10 use crate::maputil::{map1, map1_mut, map2, map2_mut, FixedLength, FixedLengthMut}; |
| 11 use crate::norms::*; |
11 use crate::norms::*; |
| 12 use crate::types::{Float, Num, SignedNum}; |
12 use crate::types::{Float, Num, SignedNum}; |
| 37 } |
37 } |
| 38 |
38 |
| 39 /// Returns an owned instance of a reference. |
39 /// Returns an owned instance of a reference. |
| 40 fn clone_owned(&self) -> Self::OwnedVariant { |
40 fn clone_owned(&self) -> Self::OwnedVariant { |
| 41 self.clone() |
41 self.clone() |
| |
42 } |
| |
43 |
| |
44 /// Returns an owned instance of a reference. |
| |
45 fn cow_owned<'b>(self) -> MyCow<'b, Self::OwnedVariant> |
| |
46 where |
| |
47 Self: 'b, |
| |
48 { |
| |
49 MyCow::Owned(self) |
| 42 } |
50 } |
| 43 } |
51 } |
| 44 |
52 |
| 45 impl<F: Display, const N: usize> Display for Loc<N, F> { |
53 impl<F: Display, const N: usize> Display for Loc<N, F> { |
| 46 // Required method |
54 // Required method |