src/convex.rs

branch
dev
changeset 107
441d30e66a4a
parent 106
1256e7f7f7ad
child 108
6be459f08b66
equal deleted inserted replaced
106:1256e7f7f7ad 107:441d30e66a4a
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 }

mercurial