Sat, 22 Oct 2022 22:28:04 +0300
Convert iteration utilities to GATs
0 | 1 | ///! Base types for simple (finite) element models. |
2 | ||
3 | /// A local model can be evaluated for value and differential | |
4 | pub trait LocalModel<Domain, Codomain> { | |
5 | /// Get the value of the model at `x` | |
6 | fn value(&self, x : &Domain) -> Codomain; | |
7 | /// Get the differential of the model at `x` | |
8 | fn differential(&self, x : &Domain) -> Domain; | |
9 | } | |
10 | ||
11 | /// A real local model is a minimisable [`LocalModel`]. | |
12 | pub trait RealLocalModel<S, Domain, Codomain> : LocalModel<Domain, Codomain> { | |
13 | /// Find a (minimum, minimiser) pair for he model within `el`, which is | |
14 | /// typically a simplex subset of `Domain`. | |
15 | fn minimise(&self, el : &S) -> (Domain, Codomain); | |
16 | } |