@@ -191,8 +191,7 @@ cdef class GenericSDPBackend:
191
191
sage: [p.objective_coefficient(x) for x in range(5)] # optional - Nonexistent_LP_solver
192
192
[1.0, 1.0, 2.0, 1.0, 3.0]
193
193
194
- Constants in the objective function are respected::
195
-
194
+ Constants in the objective function are respected.
196
195
"""
197
196
raise NotImplementedError ()
198
197
@@ -674,21 +673,24 @@ def default_sdp_solver(solver = None):
674
673
675
674
cpdef GenericSDPBackend get_solver(solver = None ):
676
675
"""
677
- Return a solver according to the given preferences
676
+ Return a solver according to the given preferences.
678
677
679
678
INPUT:
680
679
681
- - ``solver`` -- 1 solver should be available through this class:
680
+ - ``solver`` -- shoud be equal to an available solver backend, or ``None``:
681
+
682
+ - ``solver=None`` (default), the default solver is used (see
683
+ ``default_sdp_solver`` method).
682
684
683
685
- CVXOPT (``solver="CVXOPT"``). See the `CVXOPT
684
- <http://cvxopt.org/>`_ web site .
686
+ <http://cvxopt.org/>`_ website .
685
687
686
- ``solver`` should then be equal to one of ``"CVXOPT"`` or ``None ``.
687
- If ``solver=None`` (default), the default solver is used (see ``default_sdp_solver`` method .
688
+ - MOSEK ( ``solver="MOSEK"``), requires the optional package ``mosek ``.
689
+ See the `MOSEK <http://mosek.com/>`_ website .
688
690
689
691
.. SEEALSO::
690
692
691
- - :func:`default_sdp_solver` -- Returns/Sets the default SDP solver.
693
+ - :func:`default_sdp_solver` -- Returns/Sets the default SDP solver.
692
694
693
695
EXAMPLES::
694
696
@@ -701,10 +703,13 @@ cpdef GenericSDPBackend get_solver(solver = None):
701
703
else :
702
704
solver = solver.capitalize()
703
705
704
-
705
706
if solver == " Cvxopt" :
706
707
from sage.numerical.backends.cvxopt_sdp_backend import CVXOPTSDPBackend
707
708
return CVXOPTSDPBackend()
708
709
710
+ elif solver == " Mosek" :
711
+ from sage.numerical.backends.mosek_sdp_backend import MOSEKSDPBackend
712
+ return MOSEKSDPBackend()
713
+
709
714
else :
710
- raise ValueError (" 'solver' should be set to 'CVXOPT' or None (in which case the default one is used)." )
715
+ raise ValueError (" 'solver' should be set to 'CVXOPT', 'MOSEK', or None (in which case the default one is used)." )
0 commit comments