From 70f9754798ab679dc1717456beb178051cce4d96 Mon Sep 17 00:00:00 2001 From: Nao Pross Date: Sat, 11 May 2024 11:36:33 +0200 Subject: Prepare stub for SCS solver interface --- sumofsquares/solver/scs.py | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 sumofsquares/solver/scs.py diff --git a/sumofsquares/solver/scs.py b/sumofsquares/solver/scs.py new file mode 100644 index 0000000..95629be --- /dev/null +++ b/sumofsquares/solver/scs.py @@ -0,0 +1,34 @@ +""" +Solve sumofsquares problems using SCS +""" +from __future__ import annotations + +import sys +import scs + +from collections import UserDict + +import polymatrix as poly + +from ..abc import Problem, SolverInfo +from ..variable import OptVariable + + +class SCSInfo(SolverInfo, UserDict): + """ Dictionary returned by SCS. """ + + def __getattr__(self, attr): + key = " ".join(attr.split("_")) + if key not in self.keys(): + raise KeyError(f"Key {key} was not found") + return self[key] + + +def solve_sos_cone(prob: Problem, verbose: bool = False, + *args, **kwargs) -> tuple[dict[OptVariable, float], SCSInfo]: + r""" + Solve a conic problem in the cone of SOS polynomials + :math:`\mathbf{\Sigma}_d(x)` using SCS. + """ + + raise NotImplementedError -- cgit v1.2.1