Sun, 27 Apr 2025 20:29:43 -0500
Fix build with stable rust.
For optimisations, build.rs now automatically sets a nightly cfg flag,
so problems with the nightly feature are avoided. It is still used for
required for additional nightly-only features.
| 5 | 1 | /*! |
| 2 | Base types for simple (finite) element models. | |
| 3 | */ | |
| 0 | 4 | |
| 5 | 5 | /// A local function model that can be evaluated for value and differential. |
| 0 | 6 | pub trait LocalModel<Domain, Codomain> { |
| 7 | /// Get the value of the model at `x` | |
| 8 | fn value(&self, x : &Domain) -> Codomain; | |
| 9 | /// Get the differential of the model at `x` | |
| 10 | fn differential(&self, x : &Domain) -> Domain; | |
| 11 | } | |
| 12 | ||
| 13 | /// A real local model is a minimisable [`LocalModel`]. | |
| 14 | pub trait RealLocalModel<S, Domain, Codomain> : LocalModel<Domain, Codomain> { | |
| 15 | /// Find a (minimum, minimiser) pair for he model within `el`, which is | |
| 16 | /// typically a simplex subset of `Domain`. | |
| 17 | fn minimise(&self, el : &S) -> (Domain, Codomain); | |
| 18 | } |