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

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

Returns a reference to the stored problem.

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

Returns a reference to the stored solver.

Example
let solver = result.solver();

Returns a reference to the stored state.

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

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

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 other’s.

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

Restrict a value to a certain interval. Read more

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

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

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 other’s.

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

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

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

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.

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

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

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.