pub struct ProbQCQP<L: LinAlgEx> { /* private fields */ }
Expand description
Quadratically constrained quadratic program
The problem is \[ \begin{array}{ll} {\rm minimize} & {1 \over 2} x^T P_0 x + q_0^T x + r_0 \\ {\rm subject \ to} & {1 \over 2} x^T P_i x + q_i^T x + r_i \le 0 \qquad (i = 1, \ldots, m) \\ & A x = b, \end{array} \] where
- variables \( x \in \mathbb{R}^n \)
- \( P_j \in \mathcal{S}_{+}^n,\ q_j \in \mathbb{R}^n,\ r_j \in \mathbb{R} \) for \( j = 0, \ldots, m \)
- \( 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} & t \\ {\rm subject \ to} & \left[ \begin{array}{c} 0 & 0 \\ q_0^T & -1 \\ -P_0^{1 \over 2} & 0 \end{array} \right] \left[ \begin{array}{c} x \\ t \end{array} \right] + s_0 = \left[ \begin{array}{c} 1 \\ -r_0 \\ 0 \end{array} \right] \\ & \left[ \begin{array}{c} 0 \\ q_i^T \\ -P_i^{1 \over 2} \end{array} \right] x + s_i = \left[ \begin{array}{c} 1 \\ -r_i \\ 0 \end{array} \right] \qquad (i = 1, \ldots, m) \\ & A x + s_z = b \\ & \lbrace s_0, \ldots, s_m, s_z \rbrace \in \mathcal{Q}_r^{2 + n} \times \cdots \times \mathcal{Q}_r^{2 + n} \times \lbrace 0 \rbrace^p. \end{array} \]
\( \mathcal{Q}_r \) is a rotated second-order (or quadratic) cone (see ConeRotSOC
).
Implementations§
source§impl<L: LinAlgEx> ProbQCQP<L>
impl<L: LinAlgEx> ProbQCQP<L>
sourcepub fn new(
syms_p: Vec<MatBuild<L>>,
vecs_q: Vec<MatBuild<L>>,
scls_r: Vec<L::F>,
mat_a: MatBuild<L>,
vec_b: MatBuild<L>,
eps_zero: L::F
) -> Self
pub fn new(
syms_p: Vec<MatBuild<L>>,
vecs_q: Vec<MatBuild<L>>,
scls_r: Vec<L::F>,
mat_a: MatBuild<L>,
vec_b: MatBuild<L>,
eps_zero: L::F
) -> Self
Creates a QCQP with given data.
Returns the ProbQCQP
instance.
syms_p
is \(P_0, \ldots, P_m\) each of which shall belong tototsu_core::MatType::SymPack
.vecs_q
is \(q_0, \ldots, q_m\).scls_r
is \(r_0, \ldots, r_m\).mat_a
is \(A\).vec_b
is \(b\).eps_zero
should be the same value astotsu_core::solver::SolverParam::eps_zero
.
sourcepub fn problem(
&mut self
) -> (ProbQCQPOpC<L>, ProbQCQPOpA<'_, L>, ProbQCQPOpB<'_, L>, ProbQCQPCone<L>, &mut [L::F])
pub fn problem(
&mut self
) -> (ProbQCQPOpC<L>, ProbQCQPOpA<'_, L>, ProbQCQPOpB<'_, L>, ProbQCQPCone<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.