pub struct SecondOrderCone<T = f64> { /* private fields */ }Expand description
A second-order cone (SOC)
A set of the form
$$ C_{\alpha} = \{x=(y, t) \in \mathbb{R}^{n+1}: t\in\mathbb{R}, \Vert{}y\Vert \leq \alpha{}t\}, $$
where $\alpha$ is a positive scalar.
Projections on the second-order cone are computed as in H.H. Bauschke’s 1996 doctoral dissertation: Projection Algorithms and Monotone Operators (p. 40, Theorem 3.3.6).
Implementations§
Source§impl<T: Float> SecondOrderCone<T>
impl<T: Float> SecondOrderCone<T>
Sourcepub fn new(alpha: T) -> SecondOrderCone<T>
pub fn new(alpha: T) -> SecondOrderCone<T>
Construct a new instance of SecondOrderCone with parameter alpha.
A second-order cone with parameter alpha is the set
$C_\alpha = \{x=(y, t) \in \mathbb{R}^{n+1}: t\in\mathbb{R}, \Vert{}y\Vert \leq \alpha t\}$,
where $\alpha$ is a positive parameter, and projections are computed
according to Theorem 3.3.6 in H.H. Bauschke’s 1996 doctoral dissertation:
Projection Algorithms and Monotone Operators
(page 40).
§Arguments
alpha: parameter $\alpha$
§Panics
The method panics if the given parameter alpha is nonpositive.
§Example
use optimization_engine::constraints::{Constraint, SecondOrderCone};
let cone = SecondOrderCone::new(1.0);
let mut x = [2.0, 0.0, 0.5];
cone.project(&mut x).unwrap();Trait Implementations§
Source§impl<T: Clone> Clone for SecondOrderCone<T>
impl<T: Clone> Clone for SecondOrderCone<T>
Source§fn clone(&self) -> SecondOrderCone<T>
fn clone(&self) -> SecondOrderCone<T>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more