def integerify(self): # Si alguno de los valores no es un entero, # buscamos una representación equivalente # del hiperespacio a valores enteros if any(map(lambda x: not x.is_integer(), self.normal)): integerified = integer_coeff(self.normal+[self.offset]) self.offset = integerified[-1] self.normal = integerified[:-1] else: self.offset = int(self.offset) self.normal = map(int,self.normal)
def integerify(self): # If one of the values (i.e. coefficients or it) # is not an integer we look for a upper-representation # for the halfspace but with integer values if any(x for x in self.normal if not float(x).is_integer()): integerified = integer_coeff(self.normal+[self.offset]) self.offset = integerified[-1] self.normal = integerified[:-1] else: self.offset = int(self.offset) self.normal = map(int,self.normal)