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
sourceimpl<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
sourceimpl<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>
sourcefn clone(&self) -> OptimizationResult<O, S, I>
fn clone(&self) -> OptimizationResult<O, S, I>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<O, S, I> Display for OptimizationResult<O, S, I> where
I: State,
I::Param: Debug,
S: Solver<O, I>,
impl<O, S, I> Display for OptimizationResult<O, S, I> where
I: State,
I::Param: Debug,
S: Solver<O, I>,
sourceimpl<O, S, I: State> Ord for OptimizationResult<O, S, I>
impl<O, S, I: State> Ord for OptimizationResult<O, S, I>
sourcefn 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 other’s.
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Self where
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Self where
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl<O, S, I: State> PartialEq<OptimizationResult<O, S, I>> for OptimizationResult<O, S, I> where
I::Float: ArgminFloat,
impl<O, S, I: State> PartialEq<OptimizationResult<O, S, I>> for OptimizationResult<O, S, I> where
I::Float: ArgminFloat,
sourcefn 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.
sourceimpl<O, S, I: State> PartialOrd<OptimizationResult<O, S, I>> for OptimizationResult<O, S, I>
impl<O, S, I: State> PartialOrd<OptimizationResult<O, S, I>> for OptimizationResult<O, S, I>
sourcefn 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 other’s.
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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 more
impl<O, S, I: State> Eq for OptimizationResult<O, S, I>
Auto Trait Implementations
impl<O, S, I> RefUnwindSafe for OptimizationResult<O, S, I> where
I: RefUnwindSafe,
O: RefUnwindSafe,
S: RefUnwindSafe,
impl<O, S, I> Send for OptimizationResult<O, S, I> where
I: Send,
O: Send,
S: Send,
impl<O, S, I> Sync for OptimizationResult<O, S, I> where
I: Sync,
O: Sync,
S: Sync,
impl<O, S, I> Unpin for OptimizationResult<O, S, I> where
I: Unpin,
O: Unpin,
S: Unpin,
impl<O, S, I> UnwindSafe for OptimizationResult<O, S, I> where
I: UnwindSafe,
O: UnwindSafe,
S: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more