ConstrainedObjective

Trait ConstrainedObjective 

Source
pub trait ConstrainedObjective<T: Float> {
    // Required methods
    fn evaluate(&self, x: &[T]) -> T;
    fn gradient(&self, x: &[T]) -> Vec<T>;
    fn inequality_constraints(&self, x: &[T]) -> Vec<T>;
    fn equality_constraints(&self, x: &[T]) -> Vec<T>;
    fn inequality_jacobian(&self, x: &[T]) -> Vec<Vec<T>>;
    fn equality_jacobian(&self, x: &[T]) -> Vec<Vec<T>>;
    fn variable_bounds(&self) -> Vec<(T, T)>;
    fn num_inequality_constraints(&self) -> usize;
    fn num_equality_constraints(&self) -> usize;
    fn num_variables(&self) -> usize;

    // Provided method
    fn hessian(&self, _x: &[T]) -> Option<Vec<Vec<T>>> { ... }
}
Expand description

Trait for constrained objective functions

Required Methods§

Source

fn evaluate(&self, x: &[T]) -> T

Evaluate the objective function

Source

fn gradient(&self, x: &[T]) -> Vec<T>

Compute the gradient of the objective function

Source

fn inequality_constraints(&self, x: &[T]) -> Vec<T>

Evaluate inequality constraints g(x) ≤ 0

Source

fn equality_constraints(&self, x: &[T]) -> Vec<T>

Evaluate equality constraints h(x) = 0

Source

fn inequality_jacobian(&self, x: &[T]) -> Vec<Vec<T>>

Jacobian of inequality constraints

Source

fn equality_jacobian(&self, x: &[T]) -> Vec<Vec<T>>

Jacobian of equality constraints

Source

fn variable_bounds(&self) -> Vec<(T, T)>

Get variable bounds (lower, upper)

Source

fn num_inequality_constraints(&self) -> usize

Number of inequality constraints

Source

fn num_equality_constraints(&self) -> usize

Number of equality constraints

Source

fn num_variables(&self) -> usize

Number of variables

Provided Methods§

Source

fn hessian(&self, _x: &[T]) -> Option<Vec<Vec<T>>>

Compute the Hessian of the objective function (optional)

Implementors§