Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
pycodestyle stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
mantepse committed Jan 4, 2023
1 parent 61e97bc commit db8947b
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/sage/combinat/bijectionist.py
Original file line number Diff line number Diff line change
Expand Up @@ -2456,6 +2456,7 @@ def solutions_iterator(self):
self._bmilp = _BijectionistMILP(self)
yield from self._bmilp.solutions_iterator(False, [])


class _BijectionistMILP():
r"""
Wrapper class for the MixedIntegerLinearProgram (MILP). This
Expand Down Expand Up @@ -2590,7 +2591,6 @@ def show(self, variables=True):
print(f" {v}: " + "".join([f"s({a}) = "
for a in P[p]]) + f"{z}")


def _prepare_solution(self, on_blocks, solution):
r"""
Return the solution as a dictionary from `A` (or `P`) to
Expand Down Expand Up @@ -2766,9 +2766,10 @@ def _is_solution(self, constraint, values):
variable_index = next(iter(v.dict().keys()))
index_block_value_dict[variable_index] = (p, z)

evaluate = lambda f: sum(coeff if index == -1 else
coeff * values[index_block_value_dict[index]]
for index, coeff in f.dict().items())
def evaluate(f):
return sum(coeff if index == -1 else
coeff * values[index_block_value_dict[index]]
for index, coeff in f.dict().items())

for lhs, rhs in constraint.equations():
if evaluate(lhs - rhs):
Expand Down Expand Up @@ -3052,6 +3053,7 @@ def sum_q(q):
for q in Q[1:]:
self.milp.add_constraint(len(q0)*sum_q(q) == len(q)*v0, name=f"h: ({q})~({q0})")


def _invert_dict(d):
"""
Return the dictionary whose keys are the values of the input and
Expand Down Expand Up @@ -3126,6 +3128,7 @@ def _non_copying_intersection(sets):
if s == result:
return s


"""
TESTS::
Expand Down

0 comments on commit db8947b

Please sign in to comment.