Struct optimization_engine::constraints::BallInf
source · pub struct BallInf<'a> { /* private fields */ }
Expand description
An infinity ball defined as $B_\infty^r = \{x\in\mathbb{R}^n {}:{} \Vert{}x{}\Vert_{\infty} \leq r\}$, where $\Vert{}\cdot{}\Vert_{\infty}$ is the infinity norm. The infinity ball centered at a point $x_c$ is defined as $B_\infty^{x_c,r} = \{x\in\mathbb{R}^n {}:{} \Vert{}x-x_c{}\Vert_{\infty} \leq r\}$.
Implementations§
Trait Implementations§
source§impl<'a> Constraint for BallInf<'a>
impl<'a> Constraint for BallInf<'a>
source§fn project(&self, x: &mut [f64])
fn project(&self, x: &mut [f64])
Computes the projection of a given vector x
on the current infinity ball.
The projection of a $v\in\mathbb{R}^{n}$ on $B_\infty^r$ is given by $\Pi_{B_\infty^r}(v) = z$ with
$$ z_i = \begin{cases}v_i,&\text{ if } |z_i| \leq r\\\mathrm{sng}(v_i)r,&\text{ otherwise}\end{cases} $$
for all $i=1,\ldots, n$, where sgn is the sign function.
The projection of $v\in\mathbb{R}^{n}$ on $B_\infty^{x_c,r}$ is given by $\Pi_{B_\infty^r}(v) = z$ with
$$ z_i = \begin{cases}v_i,&\text{ if } |z_i-x_{c, i}| \leq r\\x_{c,i} + \mathrm{sng}(v_i)r,&\text{ otherwise}\end{cases} $$
for all $i=1,\ldots, n$.