sage: Ensure that constraints are always fastfracs
Even if they are constants created in the formula functions. We now lift integer constants to fastfracs.
This commit is contained in:
@@ -164,6 +164,9 @@ class constraints:
|
||||
def negate(self):
|
||||
return constraints(zero=self.nonzero, nonzero=self.zero)
|
||||
|
||||
def map(self, fun):
|
||||
return constraints(zero={fun(k): v for k, v in self.zero.items()}, nonzero={fun(k): v for k, v in self.nonzero.items()})
|
||||
|
||||
def __add__(self, other):
|
||||
zero = self.zero.copy()
|
||||
zero.update(other.zero)
|
||||
|
||||
Reference in New Issue
Block a user