pub struct ProbSOCP<L: LinAlgEx> { /* private fields */ }
Expand description
Second-order cone program
The problem is \[ \begin{array}{ll} {\rm minimize} & f^T x \\ {\rm subject \ to} & \| G_i x + h_i \|_2 \le c_i^T x + d_i \quad (i = 0, \ldots, m - 1) \\ & A x = b, \end{array} \] where
- variables \( x \in \mathbb{R}^n \)
- \( f \in \mathbb{R}^n \)
- \( G_i \in \mathbb{R}^{n_i \times n},\ h_i \in \mathbb{R}^{n_i},\ c_i \in \mathbb{R}^n,\ d_i \in \mathbb{R} \)
- \( A \in \mathbb{R}^{p \times n},\ b \in \mathbb{R}^p \).
The representation as a conic linear program is as follows: \[ \begin{array}{ll} {\rm minimize} & f^T x \\ {\rm subject \ to} & \left[ \begin{array}{c} -c_0^T \\ -G_0 \\ \vdots \\ -c_{m - 1}^T \\ -G_{m - 1} \\ A \end{array} \right] x + s = \left[ \begin{array}{c} d_0 \\ h_0 \\ \vdots \\ d_{m - 1} \\ h_{m - 1} \\ b \end{array} \right] \\ & s \in \mathcal{Q}^{1 + n_0} \times \cdots \times \mathcal{Q}^{1 + n_{m - 1}} \times \lbrace 0 \rbrace^p. \end{array} \]
\( \mathcal{Q} \) is a second-order (or quadratic) cone (see ConeSOC
).
Implementations§
source§impl<L: LinAlgEx> ProbSOCP<L>
impl<L: LinAlgEx> ProbSOCP<L>
sourcepub fn new(
vec_f: MatBuild<L>,
mats_g: Vec<MatBuild<L>>,
vecs_h: Vec<MatBuild<L>>,
vecs_c: Vec<MatBuild<L>>,
scls_d: Vec<L::F>,
mat_a: MatBuild<L>,
vec_b: MatBuild<L>
) -> Self
pub fn new(
vec_f: MatBuild<L>,
mats_g: Vec<MatBuild<L>>,
vecs_h: Vec<MatBuild<L>>,
vecs_c: Vec<MatBuild<L>>,
scls_d: Vec<L::F>,
mat_a: MatBuild<L>,
vec_b: MatBuild<L>
) -> Self
Creates a SOCP with given data.
Returns the ProbSOCP
instance.
vec_f
is \(f\).mats_g
is \(G_0, \ldots, G_{m-1}\).vecs_h
is \(h_0, \ldots, h_{m-1}\).vecs_c
is \(c_0, \ldots, c_{m-1}\).scls_d
is \(d_0, \ldots, d_{m-1}\).mat_a
is \(A\).vec_b
is \(b\).
sourcepub fn problem(
&mut self
) -> (ProbSOCPOpC<'_, L>, ProbSOCPOpA<'_, L>, ProbSOCPOpB<'_, L>, ProbSOCPCone<'_, L>, &mut [L::F])
pub fn problem(
&mut self
) -> (ProbSOCPOpC<'_, L>, ProbSOCPOpA<'_, L>, ProbSOCPOpB<'_, L>, ProbSOCPCone<'_, L>, &mut [L::F])
Generates the problem data structures to be fed to Solver::solve
.
Returns a tuple of operators, a cone and a work slice.