Skip to content

Commit

Permalink
change to implicit checking for a signomial or polynomial
Browse files Browse the repository at this point in the history
  • Loading branch information
HC-HC committed Feb 22, 2021
1 parent 717b231 commit 303611f
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions sageopt/coniclifts/base.py
Expand Up @@ -19,8 +19,6 @@
from sageopt.coniclifts.constraints.elementwise import ElementwiseConstraint
from sageopt.coniclifts.constraints.set_membership.psd_cone import PSD
from sageopt.coniclifts.utilities import array_index_iterator, __REAL_TYPES__
from sageopt.symbolic.polynomials import Polynomial
from sageopt.symbolic.signomials import Signomial

class ScalarAtom(object):

Expand Down Expand Up @@ -279,7 +277,7 @@ def __sub__(self, other):
return f

def __mul__(self, other):
if isinstance(other, __REAL_TYPES__) or isinstance(other, Polynomial) or isinstance(other, Signomial):
if isinstance(other, __REAL_TYPES__) or 'Signomial' in str(type(other)) or 'Polynomial' in str(type(other)):
if other == 0:
return ScalarExpression(defaultdict(int), 0, verify=False, copy=False)
f = ScalarExpression(self.atoms_to_coeffs, self.offset, verify=False)
Expand Down

0 comments on commit 303611f

Please sign in to comment.