src/norms.rs

branch
dev
changeset 164
fd9dba51afd3
parent 163
b4a47e8e80d1
equal deleted inserted replaced
163:b4a47e8e80d1 164:fd9dba51afd3
200 impl<E, F, Domain> Mapping<Domain> for NormMapping<F, E> 200 impl<E, F, Domain> Mapping<Domain> for NormMapping<F, E>
201 where 201 where
202 F: Float, 202 F: Float,
203 E: NormExponent, 203 E: NormExponent,
204 Domain: Space, 204 Domain: Space,
205 Domain::OwnedSpace: Norm<E, F>, 205 Domain::Principal: Norm<E, F>,
206 { 206 {
207 type Codomain = F; 207 type Codomain = F;
208 208
209 #[inline] 209 #[inline]
210 fn apply<I: Instance<Domain>>(&self, x: I) -> F { 210 fn apply<I: Instance<Domain>>(&self, x: I) -> F {
230 } 230 }
231 231
232 pub trait HasDual<F: Num = f64>: Normed<F> + VectorSpace<Field = F> { 232 pub trait HasDual<F: Num = f64>: Normed<F> + VectorSpace<Field = F> {
233 type DualSpace: Normed<F> + ClosedVectorSpace<Field = F>; 233 type DualSpace: Normed<F> + ClosedVectorSpace<Field = F>;
234 234
235 fn dual_origin(&self) -> <Self::DualSpace as VectorSpace>::Owned; 235 fn dual_origin(&self) -> <Self::DualSpace as VectorSpace>::PrincipalV;
236 } 236 }
237 237
238 /// Automatically implemented trait for reflexive spaces 238 /// Automatically implemented trait for reflexive spaces
239 pub trait Reflexive<F: Num = f64>: HasDual<F> 239 pub trait Reflexive<F: Num = f64>: HasDual<F>
240 where 240 where
241 Self::DualSpace: HasDual<F, DualSpace = Self::OwnedSpace>, 241 Self::DualSpace: HasDual<F, DualSpace = Self::Principal>,
242 { 242 {
243 } 243 }
244 244
245 impl<F: Num, X: HasDual<F>> Reflexive<F> for X where 245 impl<F: Num, X: HasDual<F>> Reflexive<F> for X where
246 X::DualSpace: HasDual<F, DualSpace = Self::OwnedSpace> 246 X::DualSpace: HasDual<F, DualSpace = Self::Principal>
247 { 247 {
248 } 248 }
249 249
250 pub trait HasDualExponent: NormExponent { 250 pub trait HasDualExponent: NormExponent {
251 type DualExp: NormExponent; 251 type DualExp: NormExponent;

mercurial