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§
Sourcefn inequality_constraints(&self, x: &[T]) -> Vec<T>
fn inequality_constraints(&self, x: &[T]) -> Vec<T>
Evaluate inequality constraints g(x) ≤ 0
Sourcefn equality_constraints(&self, x: &[T]) -> Vec<T>
fn equality_constraints(&self, x: &[T]) -> Vec<T>
Evaluate equality constraints h(x) = 0
Sourcefn inequality_jacobian(&self, x: &[T]) -> Vec<Vec<T>>
fn inequality_jacobian(&self, x: &[T]) -> Vec<Vec<T>>
Jacobian of inequality constraints
Sourcefn equality_jacobian(&self, x: &[T]) -> Vec<Vec<T>>
fn equality_jacobian(&self, x: &[T]) -> Vec<Vec<T>>
Jacobian of equality constraints
Sourcefn variable_bounds(&self) -> Vec<(T, T)>
fn variable_bounds(&self) -> Vec<(T, T)>
Get variable bounds (lower, upper)
Sourcefn num_inequality_constraints(&self) -> usize
fn num_inequality_constraints(&self) -> usize
Number of inequality constraints
Sourcefn num_equality_constraints(&self) -> usize
fn num_equality_constraints(&self) -> usize
Number of equality constraints
Sourcefn num_variables(&self) -> usize
fn num_variables(&self) -> usize
Number of variables