diff options
author | Nao Pross <np@0hm.ch> | 2024-06-16 19:34:15 +0200 |
---|---|---|
committer | Nao Pross <np@0hm.ch> | 2024-06-16 19:35:18 +0200 |
commit | 19a7bdf5e7e9a2faa0aeeea9688113965cb1f7f4 (patch) | |
tree | 34981bab5418266ed1c4f9f3be8f585d4ad34daf | |
parent | Temporarily disable half_newton_polytope (diff) | |
download | sumofsquares-19a7bdf5e7e9a2faa0aeeea9688113965cb1f7f4.tar.gz sumofsquares-19a7bdf5e7e9a2faa0aeeea9688113965cb1f7f4.zip |
Improve error message and comments
Diffstat (limited to '')
-rw-r--r-- | sumofsquares/problems.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sumofsquares/problems.py b/sumofsquares/problems.py index 808e51c..f16eac7 100644 --- a/sumofsquares/problems.py +++ b/sumofsquares/problems.py @@ -60,7 +60,10 @@ class ConicProblem(Problem): """ Linear term of the cost function """ is_qp: bool + """ Is the problem quadratic? """ + dims: dict + """ Dimensions of the cones """ # TODO: Maybe do a dict[type, list[...]] instead? constraints: dict[str, list[tuple[tuple[NDArray, ...], NDArray]]] @@ -402,7 +405,8 @@ class InternalSOSProblem(Problem): # If this error occurs an it is not the user's fault, there is # a bug in SOSProblem.apply raise ValueError("To convert to conic constraints must be linear or affine " - f"but {str(c.expression)} has degree {constr.degree}.") + f"but {str(c.expression)} has degree {constr.degree} " + "(There is a product of decision variables).") # Get constant and linear terms constant = constr.affine_coefficient(MonomialIndex.constant()) |