| 1 use crate::instance::{ClosedSpace, Instance, Ownable, Space}; |
1 use crate::instance::{ClosedSpace, Instance, MyCow, Ownable, Space}; |
| 2 use crate::mapping::{BasicDecomposition, DifferentiableImpl, DifferentiableMapping, Mapping}; |
2 use crate::mapping::{BasicDecomposition, DifferentiableImpl, DifferentiableMapping, Mapping}; |
| 3 use crate::types::Float; |
3 use crate::types::Float; |
| 4 use numeric_literals::replace_float_literals; |
4 use numeric_literals::replace_float_literals; |
| 5 use std::iter::Sum; |
5 use std::iter::Sum; |
| 6 use std::marker::PhantomData; |
6 use std::marker::PhantomData; |
| 46 |
46 |
| 47 fn into_owned(self) -> Self::OwnedVariant { |
47 fn into_owned(self) -> Self::OwnedVariant { |
| 48 self |
48 self |
| 49 } |
49 } |
| 50 |
50 |
| 51 /// Returns an owned instance of a reference. |
|
| 52 fn clone_owned(&self) -> Self::OwnedVariant { |
51 fn clone_owned(&self) -> Self::OwnedVariant { |
| 53 self.clone() |
52 self.clone() |
| |
53 } |
| |
54 |
| |
55 fn cow_owned<'b>(self) -> MyCow<'b, Self::OwnedVariant> |
| |
56 where |
| |
57 Self: 'b, |
| |
58 { |
| |
59 MyCow::Owned(self) |
| 54 } |
60 } |
| 55 } |
61 } |
| 56 |
62 |
| 57 impl<F: Float, G, BT, const N: usize> Space for BTFN<F, G, BT, N> |
63 impl<F: Float, G, BT, const N: usize> Space for BTFN<F, G, BT, N> |
| 58 where |
64 where |