Skip to main content

ConstrainedFunc

Struct ConstrainedFunc 

Source
pub struct ConstrainedFunc<F, G> { /* private fields */ }
Expand description

Closure-backed constrained problem produced by constrained_func.

Trait Implementations§

Source§

impl<F, G> ConstrainedProblem for ConstrainedFunc<F, G>
where F: Fn(&[f64]) -> f64, G: Fn(&[f64]) -> Vec<f64>,

Source§

fn dim(&self) -> usize

Number of decision variables.
Source§

fn bounds(&self) -> &[Bound]

Per-variable inclusive bounds, length ConstrainedProblem::dim.
Source§

fn objective(&self, x: &[f64]) -> f64

Objective value to minimize (non-finite ⇒ infeasible, as usual).
Source§

fn violations(&self, x: &[f64]) -> Vec<f64>

Constraint violations: 0.0 per satisfied constraint, positive magnitudes otherwise. Negative entries are clamped to 0.0.
Source§

fn total_violation(&self, x: &[f64]) -> f64

Total violation Σ max(vᵢ, 0) — the quantity Deb’s rules compare.

Auto Trait Implementations§

§

impl<F, G> Freeze for ConstrainedFunc<F, G>
where F: Freeze, G: Freeze,

§

impl<F, G> RefUnwindSafe for ConstrainedFunc<F, G>

§

impl<F, G> Send for ConstrainedFunc<F, G>
where F: Send, G: Send,

§

impl<F, G> Sync for ConstrainedFunc<F, G>
where F: Sync, G: Sync,

§

impl<F, G> Unpin for ConstrainedFunc<F, G>
where F: Unpin, G: Unpin,

§

impl<F, G> UnsafeUnpin for ConstrainedFunc<F, G>
where F: UnsafeUnpin, G: UnsafeUnpin,

§

impl<F, G> UnwindSafe for ConstrainedFunc<F, G>
where F: UnwindSafe, G: 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

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>,

Source§

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.