pub struct OptimizationResult<O, S, I> {
    pub problem: Problem<O>,
    pub solver: S,
    pub state: I,
}
Expand description

Result of an optimization returned by after running an Executor.

Consists of the problem and the final state of the solver. Both can be accessed via deconstructing or via the methods problem and state.

Fields§

§problem: Problem<O>

Problem

§solver: S

Solver

§state: I

Iteration state

Implementations§

source§

impl<O, S, I> OptimizationResult<O, S, I>

source

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);
source

pub fn problem(&self) -> &Problem<O>

Returns a reference to the stored problem.

§Example
let problem: &Problem<Rosenbrock> = result.problem();
source

pub fn solver(&self) -> &S

Returns a reference to the stored solver.

§Example
let solver = result.solver();
source

pub fn state(&self) -> &I

Returns a reference to the stored state.

§Example
let state: &IterState<Vec<f64>, (), (), (), (), f64> = result.state();

Trait Implementations§

source§

impl<O: Clone, S: Clone, I: Clone> Clone for OptimizationResult<O, S, I>

source§

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)

Performs copy-assignment from source. Read more
source§

impl<O, S, I> Display for OptimizationResult<O, S, I>
where I: State, I::Param: Debug, S: Solver<O, I>,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<O, S, I: State> Ord for OptimizationResult<O, S, I>

source§

fn cmp(&self, other: &OptimizationResult<O, S, I>) -> Ordering

Two OptimizationResults 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) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

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

Two OptimizationResults are equal if the absolute of the difference between their best cost values is smaller than epsilon.

1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<O, S, I: State> PartialOrd for OptimizationResult<O, S, I>

source§

fn partial_cmp(&self, other: &OptimizationResult<O, S, I>) -> Option<Ordering>

Two OptimizationResults 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 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 · source§

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
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<O, S, I: State> Eq for OptimizationResult<O, S, I>

Auto Trait Implementations§

§

impl<O, S, I> RefUnwindSafe for OptimizationResult<O, S, I>

§

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§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

§

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

Checks if self is actually part of its subset T (and can be converted to it).
§

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

The inclusion map: converts self to the equivalent element of its superset.
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> SendAlias for T

source§

impl<T> SyncAlias for T