scs#
- swordfish.function.scs()#
Solve the following optimization problem for the objective function with given constraints:
\[\begin{split}\min\limits_{x} x^T P x + f^T x \quad \text{such that} \quad \begin{cases} A \cdot x \le b \\ A_{\mathrm{eq}} \cdot x = b_{\mathrm{eq}} \\ \|x - x_0\| \le c \\ lb \le x \le ub \end{cases}\end{split}\]The result is a 2-element tuple. The first element is the minimum value of the objective function. The second element is the value of x when the value of the objective function is minimized.
- Parameters:
f (Constant) – A vector of coefficients for linear terms in the quadratic programming problem. It must be of the same length as x0.
P (Constant, optional) – A matrix obtained by multiplying the diagonal elements of the coefficient matrix for quadratic terms by 2, by default DFLT.
A (Constant, optional) – A coefficient matrix for linear inequality constraints. Its number of columns must be consistent with the size of x, by default DFLT.
b (Constant, optional) – The right-hand vector for linear inequality constraints, by default DFLT.
Aeq (Constant, optional) – Aa coefficient matrix for linear equality constraints. Its number of columns must be consistent with the size of x, by default DFLT.
beq (Constant, optional) – The right-hand vector for linear equality constraints, by default DFLT.
lb (Constant, optional) –
A scalar or a vector of the same length as x, specifying the lower bound for variables, by default DFLT.
If lb is a scalar, all variables are subject to the same lower bound constraints. If lb is null, there are no lower bound constraints for x.
If lb is a vector, the elements of x are subject to the corresponding elements of lb. If a certain element in lb is null, the corresponding element in x has no lower bound constraint.
ub (Constant, optional) –
A scalar or a vector of the same length as x, specifying the upper bound for variables, by default DFLT.
If ub is a scalar, all variables are subject to the same upper bound constraints. If ub is null, there are no upper bound constraints for x.
If ub is a vector, the elements of x are subject to the corresponding elements of ub. If a certain element in ub is null, the corresponding element in x has no upper bound constraint.
x0 (Constant, optional) – A vector of coefficients for absolute value inequality constraints, by default DFLT.
c (Constant, optional) – A non-negative number representing the right-hand constant for absolute value inequality constraints, by default DFLT.
eps (Constant, optional) – A positive floating-point number representing the solution precision, by default DFLT.
alpha (Constant, optional) – A positive floating-point number representing the relaxation parameter, by default DFLT.