Struct argmin::core::OptimizationResult
source · pub struct OptimizationResult<O, S, I> {
pub problem: Problem<O>,
pub solver: S,
pub state: I,
}
Expand description
Fields§
§problem: Problem<O>
Problem
solver: S
Solver
state: I
Iteration state
Implementations§
source§impl<O, S, I> OptimizationResult<O, S, I>
impl<O, S, I> OptimizationResult<O, S, I>
sourcepub fn new(problem: Problem<O>, solver: S, state: I) -> Self
pub fn new(problem: Problem<O>, solver: S, state: I) -> Self
Constructs a new instance of OptimizationResult
from a problem
and a state
.
§Example
let rosenbrock = Rosenbrock::new();
let state: IterState<Vec<f64>, (), (), (), (), f64> = IterState::new();
let solver = SomeSolver {};
let result = OptimizationResult::new(Problem::new(rosenbrock), solver, state);
sourcepub fn problem(&self) -> &Problem<O>
pub fn problem(&self) -> &Problem<O>
Returns a reference to the stored problem.
§Example
let problem: &Problem<Rosenbrock> = result.problem();
Trait Implementations§
source§impl<O: Clone, S: Clone, I: Clone> Clone for OptimizationResult<O, S, I>
impl<O: Clone, S: Clone, I: Clone> Clone for OptimizationResult<O, S, I>
source§fn clone(&self) -> OptimizationResult<O, S, I>
fn clone(&self) -> OptimizationResult<O, S, I>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<O, S, I> Display for OptimizationResult<O, S, I>
impl<O, S, I> Display for OptimizationResult<O, S, I>
source§impl<O, S, I: State> Ord for OptimizationResult<O, S, I>
impl<O, S, I: State> Ord for OptimizationResult<O, S, I>
source§fn cmp(&self, other: &OptimizationResult<O, S, I>) -> Ordering
fn cmp(&self, other: &OptimizationResult<O, S, I>) -> Ordering
Two OptimizationResult
s are equal if the absolute of the difference between their best
cost values is smaller than epsilon.
Else, an OptimizationResult
is better if the best cost function value is strictly better
than the others.
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl<O, S, I: State> PartialEq for OptimizationResult<O, S, I>where
I::Float: ArgminFloat,
impl<O, S, I: State> PartialEq for OptimizationResult<O, S, I>where
I::Float: ArgminFloat,
source§fn eq(&self, other: &OptimizationResult<O, S, I>) -> bool
fn eq(&self, other: &OptimizationResult<O, S, I>) -> bool
Two OptimizationResult
s are equal if the absolute of the difference between their best
cost values is smaller than epsilon.
source§impl<O, S, I: State> PartialOrd for OptimizationResult<O, S, I>
impl<O, S, I: State> PartialOrd for OptimizationResult<O, S, I>
source§fn partial_cmp(&self, other: &OptimizationResult<O, S, I>) -> Option<Ordering>
fn partial_cmp(&self, other: &OptimizationResult<O, S, I>) -> Option<Ordering>
Two OptimizationResult
s are equal if the absolute of the difference between their best
cost values is smaller than epsilon.
Else, an OptimizationResult
is better if the best cost function value is strictly better
than the others.
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl<O, S, I: State> Eq for OptimizationResult<O, S, I>
Auto Trait Implementations§
impl<O, S, I> Freeze for OptimizationResult<O, S, I>
impl<O, S, I> RefUnwindSafe for OptimizationResult<O, S, I>
impl<O, S, I> Send for OptimizationResult<O, S, I>
impl<O, S, I> Sync for OptimizationResult<O, S, I>
impl<O, S, I> Unpin for OptimizationResult<O, S, I>
impl<O, S, I> UnwindSafe for OptimizationResult<O, S, I>
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
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§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 more§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).§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.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.