cvxpy.reductions.qp2quad_form package¶
Please see our disclaimer about the Reductions API before using these directly in your code.
Subpackages¶
Submodules¶
cvxpy.reductions.qp2quad_form.qp2symbolic_qp module¶
Copyright 2017 Robin Verschueren
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
-
class cvxpy.reductions.qp2quad_form.qp2symbolic_qp.Qp2SymbolicQp(problem=
None
)[source]¶ Bases:
Canonicalization
Reduces a quadratic problem to a problem that consists of affine expressions and symbolic quadratic forms.
- cvxpy.reductions.qp2quad_form.qp2symbolic_qp.accepts(problem)[source]¶
Problems with quadratic, piecewise affine objectives, piecewise-linear constraints inequality constraints, and affine equality constraints are accepted by the reduction.
cvxpy.reductions.qp2quad_form.qp_matrix_stuffing module¶
Copyright 2016 Jaehyun Park, 2017 Robin Verschueren
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
- class cvxpy.reductions.qp2quad_form.qp_matrix_stuffing.ConeDims(constr_map)[source]¶
Bases:
object
Summary of cone dimensions present in constraints.
Constraints must be formatted as dictionary that maps from constraint type to a list of constraints of that type.
-
class cvxpy.reductions.qp2quad_form.qp_matrix_stuffing.ParamQuadProg(P, q, x, A, variables, var_id_to_col, constraints, parameters, param_id_to_col, formatted: bool =
False
, lower_bounds: ndarray | None =None
, upper_bounds: ndarray | None =None
)[source]¶ Bases:
ParamProb
Represents a parameterized quadratic program.
minimize x’Px + q^Tx + d subject to (in)equality_constr1(A_1*x + b_1, …)
… (in)equality_constrK(A_i*x + b_i, …)
The constant offsets d and b are the last column of c and A.
-
apply_param_jac(delP, delq, delA, delb, active_params=
None
)[source]¶ Multiplies by Jacobian of parameter mapping.
Assumes delA is sparse.
- Returns:¶
A dictionary param.id -> dparam
-
apply_parameters(id_to_param_value=
None
, zero_offset: bool =False
, keep_zeros: bool =False
)[source]¶ Returns A, b after applying parameters (and reshaping).
-
split_solution(sltn, active_vars=
None
)[source]¶ Splits the solution into individual variables.
-
apply_param_jac(delP, delq, delA, delb, active_params=
-
class cvxpy.reductions.qp2quad_form.qp_matrix_stuffing.QpMatrixStuffing(canon_backend: str | None =
None
)[source]¶ Bases:
MatrixStuffing
Fills in numeric values for this problem instance.
Outputs a DCP-compliant minimization problem with an objective of the form
QuadForm(x, p) + q.T * x
and Zero/NonNeg constraints, both of which exclusively carry affine arguments.
- invert(solution, inverse_data)[source]¶
Retrieves the solution to the original problem.
Module contents¶
Copyright 2013 Steven Diamond
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.