[][src]Struct optimization_engine::alm::AlmProblem

pub struct AlmProblem<MappingAlm, MappingPm, ParametricGradientType, ParametricCostType, ConstraintsType, AlmSetC, LagrangeSetY> where
    MappingAlm: Fn(&[f64], &mut [f64]) -> Result<(), SolverError>,
    MappingPm: Fn(&[f64], &mut [f64]) -> Result<(), SolverError>,
    ParametricGradientType: Fn(&[f64], &[f64], &mut [f64]) -> Result<(), SolverError>,
    ParametricCostType: Fn(&[f64], &[f64], &mut f64) -> Result<(), SolverError>,
    ConstraintsType: Constraint,
    AlmSetC: Constraint,
    LagrangeSetY: Constraint
{ /* fields omitted */ }

Definition of optimization problem to be solved with AlmOptimizer. The optimization problem has the general form

$$\begin{aligned} \mathrm{Minimize}\ f(u) \\ u \in U \\ F_1(u) \in C \\ F_2(u) = 0 \end{aligned}$$

where

  • $u\in\mathbb{R}^{n_u}$ is the decision variable,
  • $f:\mathbb{R}^n\to\mathbb{R}$ is a $C^{1,1}$-smooth cost function,
  • $U$ is a (not necessarily convex) closed subset of $\mathbb{R}^{n_u}$ on which we can easily compute projections (e.g., a rectangle, a ball, a second-order cone, a finite set, etc),
  • $F_1:\mathbb{R}^{n_u}\to\mathbb{R}^{n_1}$ and $F_2:\mathbb{R}^{n_u} \to\mathbb{R}^{n_2}$ are mappings with smooth partial derivatives, and
  • $C\subseteq\mathbb{R}^{n_1}$ is a convex closed set on which we can easily compute projections.

Methods

impl<MappingAlm, MappingPm, ParametricGradientType, ParametricCostType, ConstraintsType, AlmSetC, LagrangeSetY> AlmProblem<MappingAlm, MappingPm, ParametricGradientType, ParametricCostType, ConstraintsType, AlmSetC, LagrangeSetY> where
    MappingAlm: Fn(&[f64], &mut [f64]) -> Result<(), SolverError>,
    MappingPm: Fn(&[f64], &mut [f64]) -> Result<(), SolverError>,
    ParametricGradientType: Fn(&[f64], &[f64], &mut [f64]) -> Result<(), SolverError>,
    ParametricCostType: Fn(&[f64], &[f64], &mut f64) -> Result<(), SolverError>,
    ConstraintsType: Constraint,
    AlmSetC: Constraint,
    LagrangeSetY: Constraint
[src]

pub fn new(
    constraints: ConstraintsType,
    alm_set_c: Option<AlmSetC>,
    alm_set_y: Option<LagrangeSetY>,
    parametric_cost: ParametricCostType,
    parametric_gradient: ParametricGradientType,
    mapping_f1: Option<MappingAlm>,
    mapping_f2: Option<MappingPm>,
    n1: usize,
    n2: usize
) -> Self
[src]

Constructs new instance of AlmProblem

Arguments

  • constraints: hard constraints, set $U$
  • alm_set_c: Set $C$ of ALM-specific constraints (convex, closed)
  • alm_set_y: Compact, convex set $Y$ of Lagrange multipliers, which needs to be a compact subset of $C^*$ (the convex conjugate of the convex set $C{}\subseteq{}\mathbb{R}^{n_1}$)
  • parametric_cost: Parametric cost function, $\psi(u, \xi)$, where $\xi = (c, y)$
  • parametric_gradient: Gradient of cost function wrt $u$, that is $\nabla_x \psi(u, \xi)$
  • mapping_f1: Mapping F1 of ALM-specific constraints ($F1(u) \in C$)
  • mapping_f2: Mapping F2 of PM-specific constraints ($F2(u) = 0$)
  • n1: range dimension of $F_1(u)$ (that is, mapping_f1)
  • n2: range dimension of $F_2(u)$ (that is, mapping_f2)

Returns

Instance of AlmProblem

Example

use optimization_engine::{SolverError, alm::*, constraints::Ball2};

let psi = |_u: &[f64], _p: &[f64], _cost: &mut f64| -> Result<(), SolverError> { Ok(()) };
let dpsi = |_u: &[f64], _p: &[f64], _grad: &mut [f64]| -> Result<(), SolverError> { Ok(()) };
let n1 = 0;
let n2 = 0;
let bounds = Ball2::new(None, 10.0);
let _alm_problem = AlmProblem::new(
    bounds, NO_SET, NO_SET, psi, dpsi, NO_MAPPING, NO_MAPPING, n1, n2,
);

Auto Trait Implementations

impl<MappingAlm, MappingPm, ParametricGradientType, ParametricCostType, ConstraintsType, AlmSetC, LagrangeSetY> Send for AlmProblem<MappingAlm, MappingPm, ParametricGradientType, ParametricCostType, ConstraintsType, AlmSetC, LagrangeSetY> where
    AlmSetC: Send,
    ConstraintsType: Send,
    LagrangeSetY: Send,
    MappingAlm: Send,
    MappingPm: Send,
    ParametricCostType: Send,
    ParametricGradientType: Send

impl<MappingAlm, MappingPm, ParametricGradientType, ParametricCostType, ConstraintsType, AlmSetC, LagrangeSetY> Sync for AlmProblem<MappingAlm, MappingPm, ParametricGradientType, ParametricCostType, ConstraintsType, AlmSetC, LagrangeSetY> where
    AlmSetC: Sync,
    ConstraintsType: Sync,
    LagrangeSetY: Sync,
    MappingAlm: Sync,
    MappingPm: Sync,
    ParametricCostType: Sync,
    ParametricGradientType: Sync

impl<MappingAlm, MappingPm, ParametricGradientType, ParametricCostType, ConstraintsType, AlmSetC, LagrangeSetY> Unpin for AlmProblem<MappingAlm, MappingPm, ParametricGradientType, ParametricCostType, ConstraintsType, AlmSetC, LagrangeSetY> where
    AlmSetC: Unpin,
    ConstraintsType: Unpin,
    LagrangeSetY: Unpin,
    MappingAlm: Unpin,
    MappingPm: Unpin,
    ParametricCostType: Unpin,
    ParametricGradientType: Unpin

impl<MappingAlm, MappingPm, ParametricGradientType, ParametricCostType, ConstraintsType, AlmSetC, LagrangeSetY> UnwindSafe for AlmProblem<MappingAlm, MappingPm, ParametricGradientType, ParametricCostType, ConstraintsType, AlmSetC, LagrangeSetY> where
    AlmSetC: UnwindSafe,
    ConstraintsType: UnwindSafe,
    LagrangeSetY: UnwindSafe,
    MappingAlm: UnwindSafe,
    MappingPm: UnwindSafe,
    ParametricCostType: UnwindSafe,
    ParametricGradientType: UnwindSafe

impl<MappingAlm, MappingPm, ParametricGradientType, ParametricCostType, ConstraintsType, AlmSetC, LagrangeSetY> RefUnwindSafe for AlmProblem<MappingAlm, MappingPm, ParametricGradientType, ParametricCostType, ConstraintsType, AlmSetC, LagrangeSetY> where
    AlmSetC: RefUnwindSafe,
    ConstraintsType: RefUnwindSafe,
    LagrangeSetY: RefUnwindSafe,
    MappingAlm: RefUnwindSafe,
    MappingPm: RefUnwindSafe,
    ParametricCostType: RefUnwindSafe,
    ParametricGradientType: RefUnwindSafe

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]