Struct optimization::problems::Rosenbrock
[−]
[src]
pub struct Rosenbrock { /* fields omitted */ }Two-dimensional Rosenbrock function.
A non-convex function with its global minimum inside a long, narrow, parabolic shaped flat valley:
f(x, y) = (a - x)² + b (y - x²)²
Global minimum: f(a, a²) = 0
Methods
impl Rosenbrock[src]
fn new(a: f64, b: f64) -> Rosenbrock
Creates a new Rosenbrock function given a and b, commonly definied
with 1 and 100, respectively, which also corresponds to the default.
Trait Implementations
impl Debug for Rosenbrock[src]
impl Copy for Rosenbrock[src]
impl Clone for Rosenbrock[src]
fn clone(&self) -> Rosenbrock
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0
Performs copy-assignment from source. Read more
impl Default for Rosenbrock[src]
impl Function for Rosenbrock[src]
fn value(&self, x: &[f64]) -> f64
Computes the objective function at a given position x, i.e., f(x) = y.
impl Function1 for Rosenbrock[src]
fn gradient(&self, x: &[f64]) -> Vec<f64>
Computes the gradient of the objective function at a given position x, i.e., ∀ᵢ ∂/∂xᵢ f(x) = ∇f(x). Read more
impl Problem for Rosenbrock[src]
fn dimensions(&self) -> usize
Returns the dimensionality of the input domain.
fn domain(&self) -> Vec<(f64, f64)>
Returns the input domain of the function in terms of upper and lower, respectively, for each input dimension. Read more
fn minimum(&self) -> (Vec<f64>, f64)
Returns the position as well as the value of the global minimum.
fn random_start(&self) -> Vec<f64>
Generates a random and feasible position to start a minimization.
fn is_legal_position(&self, position: &[f64]) -> bool
Tests whether the supplied position is legal for this function.