diff -r 6aa955ad8122 -r 25b6c8b20d1b src/bounds.rs --- a/src/bounds.rs Thu May 01 13:06:58 2025 -0500 +++ b/src/bounds.rs Thu May 01 14:53:14 2025 -0500 @@ -2,9 +2,8 @@ Bounded and minimizable/maximizable mappings. */ -use crate::instance::Instance; -use crate::loc::Loc; -use crate::mapping::RealMapping; +use crate::instance::{Instance, Space}; +use crate::mapping::Mapping; use crate::sets::{Cube, Set}; use crate::types::{Float, Num}; @@ -59,42 +58,34 @@ impl>> Bounded for T {} /// A [`RealMapping`] that provides rough bounds as well as minimisation and maximisation. -pub trait MinMaxMapping: RealMapping + Bounded { +pub trait MinMaxMapping: + Mapping + Bounded +{ /// Maximise the mapping within stated value `tolerance`. /// /// At most `max_steps` refinement steps are taken. /// Returns the approximate maximiser and the corresponding function value. - fn maximise(&mut self, tolerance: F, max_steps: usize) -> (Loc, F); + fn maximise(&mut self, tolerance: F, max_steps: usize) -> (Domain, F); /// Maximise the mapping within stated value `tolerance` subject to a lower bound. /// /// At most `max_steps` refinement steps are taken. /// Returns the approximate maximiser and the corresponding function value when one is found /// above the `bound` threshold, otherwise `None`. - fn maximise_above( - &mut self, - bound: F, - tolerance: F, - max_steps: usize, - ) -> Option<(Loc, F)>; + fn maximise_above(&mut self, bound: F, tolerance: F, max_steps: usize) -> Option<(Domain, F)>; /// Minimise the mapping within stated value `tolerance`. /// /// At most `max_steps` refinement steps are taken. /// Returns the approximate minimiser and the corresponding function value. - fn minimise(&mut self, tolerance: F, max_steps: usize) -> (Loc, F); + fn minimise(&mut self, tolerance: F, max_steps: usize) -> (Domain, F); /// Minimise the mapping within stated value `tolerance` subject to a lower bound. /// /// At most `max_steps` refinement steps are taken. /// Returns the approximate minimiser and the corresponding function value when one is found /// above the `bound` threshold, otherwise `None`. - fn minimise_below( - &mut self, - bound: F, - tolerance: F, - max_steps: usize, - ) -> Option<(Loc, F)>; + fn minimise_below(&mut self, bound: F, tolerance: F, max_steps: usize) -> Option<(Domain, F)>; /// Verify that the mapping has a given upper `bound` within indicated `tolerance`. ///