blob: c48143bf80fcd2615e8b142fed32ff04c82e084d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
import dataclassabc
from sumofsquares.abc.sosexpr import ParamSOSExpr, SOSExpr
from sumofsquares.sosexprbase.abc import ParamSOSExprBase, SOSExprBase
@dataclassabc.dataclassabc(frozen=True)
class SOSExprImpl(SOSExpr):
underlying: SOSExprBase
@dataclassabc.dataclassabc(frozen=True)
class ParamSOSExprImpl(ParamSOSExpr):
underlying: ParamSOSExprBase
def __eq__(self, other):
if isinstance(other, ParamSOSExprImpl):
return self.underlying == other.underlying
elif isinstance(other, ParamSOSExprBase):
return self.underlying == other
else:
return False
def __hash__(self):
return hash(self.underlying)
|