Skip to content

Commit d1fad0c

Browse files
Matthias Koeppemantepse
authored andcommitted
src/sage/features/mip_backends.py: Add CVXOPT feature
1 parent e7df521 commit d1fad0c

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

src/sage/features/mip_backends.py

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Features for testing the presence of :class:`MixedIntegerLinearProgram` backends
33
"""
44

5-
from . import Feature, FeatureTestResult
5+
from . import Feature, PythonModule, FeatureTestResult
66
from .join_feature import JoinFeature
77

88

@@ -77,7 +77,26 @@ def __init__(self):
7777
spkg='sage_numerical_backends_coin')
7878

7979

80+
class CVXOPT(JoinFeature):
81+
r"""
82+
A :class:`~sage.features.Feature` describing whether the :class:`MixedIntegerLinearProgram` backend ``CVXOPT`` is available.
83+
"""
84+
def __init__(self):
85+
r"""
86+
TESTS::
87+
88+
sage: from sage.features.mip_backends import CVXOPT
89+
sage: CVXOPT()._is_present() # optional - cvxopt
90+
FeatureTestResult('cvxopt', True)
91+
"""
92+
JoinFeature.__init__(self, 'cvxopt',
93+
[MIPBackend('CVXOPT'),
94+
PythonModule('cvxopt')],
95+
spkg='cvxopt')
96+
97+
8098
def all_features():
8199
return [CPLEX(),
82100
Gurobi(),
83-
COIN()]
101+
COIN(),
102+
CVXOPT()]

0 commit comments

Comments
 (0)