src/norms.rs

branch
dev
changeset 138
593912dc3293
parent 124
6aa955ad8122
child 145
0b9aecd7bb76
equal deleted inserted replaced
133:2b13f8a0c8ba 138:593912dc3293
1 /*! 1 /*!
2 Norms, projections, etc. 2 Norms, projections, etc.
3 */ 3 */
4 4
5 use crate::euclidean::*; 5 use crate::euclidean::*;
6 use crate::linops::AXPY;
6 use crate::mapping::{Instance, Mapping, Space}; 7 use crate::mapping::{Instance, Mapping, Space};
7 use crate::types::*; 8 use crate::types::*;
8 use serde::{Deserialize, Serialize}; 9 use serde::{Deserialize, Serialize};
9 use std::marker::PhantomData; 10 use std::marker::PhantomData;
10 11
229 fn is_zero(&self) -> bool { 230 fn is_zero(&self) -> bool {
230 self.norm_() == F::ZERO 231 self.norm_() == F::ZERO
231 } 232 }
232 } 233 }
233 234
234 pub trait HasDual<F: Num = f64>: Normed<F> { 235 pub trait HasDual<F: Num = f64>: Normed<F> + AXPY<Field = F> {
235 type DualSpace: Normed<F>; 236 type DualSpace: Normed<F> + AXPY<Field = F>;
237
238 fn dual_origin(&self) -> <Self::DualSpace as AXPY>::Owned;
236 } 239 }
237 240
238 /// Automatically implemented trait for reflexive spaces 241 /// Automatically implemented trait for reflexive spaces
239 pub trait Reflexive<F: Num = f64>: HasDual<F> 242 pub trait Reflexive<F: Num = f64>: HasDual<F>
240 where 243 where

mercurial