pub struct DebugObserver;Expand description
A debugging callback which prints out the step, status, and any user data at the current step in an algorithm.
§Usage:
use ganesh::traits::*;
use ganesh::algorithms::gradient_free::{NelderMead, NelderMeadConfig};
use ganesh::test_functions::Rosenbrock;
use ganesh::core::DebugObserver;
let problem = Rosenbrock { n: 2 };
let mut nm: NelderMead = Default::default();
let config = NelderMeadConfig::default();
let result = nm
.process(
&problem,
&(),
[2.3, 3.4],
config,
NelderMead::default_callbacks().with_observer(DebugObserver),
)
.unwrap();
// ^ This will print debug messages for each step
assert!(result.message.success());Trait Implementations§
Source§impl Clone for DebugObserver
impl Clone for DebugObserver
Source§fn clone(&self) -> DebugObserver
fn clone(&self) -> DebugObserver
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for DebugObserver
Source§impl<A, P, S, U, E, C> Observer<A, P, S, U, E, C> for DebugObserver
impl<A, P, S, U, E, C> Observer<A, P, S, U, E, C> for DebugObserver
Auto Trait Implementations§
impl Freeze for DebugObserver
impl RefUnwindSafe for DebugObserver
impl Send for DebugObserver
impl Sync for DebugObserver
impl Unpin for DebugObserver
impl UnsafeUnpin for DebugObserver
impl UnwindSafe for DebugObserver
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.