| 20 |
20 |
| 21 /// Trait for mappings with a Fenchel conjugate |
21 /// Trait for mappings with a Fenchel conjugate |
| 22 /// |
22 /// |
| 23 /// The conjugate type has to implement [`ConvexMapping`], but a `Conjugable` mapping need |
23 /// The conjugate type has to implement [`ConvexMapping`], but a `Conjugable` mapping need |
| 24 /// not be convex. |
24 /// not be convex. |
| 25 pub trait Conjugable<Domain: HasDual<F>, F: Num = f64>: Mapping<Domain> { |
25 pub trait Conjugable<Domain: HasDual<F>, F: Num = f64>: Mapping<Domain, Codomain = F> { |
| 26 type Conjugate<'a>: ConvexMapping<Domain::DualSpace, F> |
26 type Conjugate<'a>: ConvexMapping<Domain::DualSpace, F> |
| 27 where |
27 where |
| 28 Self: 'a; |
28 Self: 'a; |
| 29 |
29 |
| 30 fn conjugate(&self) -> Self::Conjugate<'_>; |
30 fn conjugate(&self) -> Self::Conjugate<'_>; |
| 37 pub trait Preconjugable<Domain, Predual, F: Num = f64>: ConvexMapping<Domain, F> |
37 pub trait Preconjugable<Domain, Predual, F: Num = f64>: ConvexMapping<Domain, F> |
| 38 where |
38 where |
| 39 Domain: Space, |
39 Domain: Space, |
| 40 Predual: HasDual<F>, |
40 Predual: HasDual<F>, |
| 41 { |
41 { |
| 42 type Preconjugate<'a>: Mapping<Predual> |
42 type Preconjugate<'a>: Mapping<Predual, Codomain = F> |
| 43 where |
43 where |
| 44 Self: 'a; |
44 Self: 'a; |
| 45 |
45 |
| 46 fn preconjugate(&self) -> Self::Preconjugate<'_>; |
46 fn preconjugate(&self) -> Self::Preconjugate<'_>; |
| 47 } |
47 } |