Skip to content

Commit

Permalink
Simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
leonardt committed Mar 15, 2024
1 parent 52ba834 commit db8ea27
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions examples/odd_even_sort.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,10 @@ def __init__(self, n: int):
if n == 2:
self.io.O @= swap(self.io.I)
return
even_merger = OddEvenMerger(n // 2)()
odd_merger = OddEvenMerger(n // 2)()
merger = m.flat(m.join(even_merger, odd_merger))
sorter = m.compose(OddEvenSwaps(n)(),
Riffle(n)(),
merger,
m.flat(m.join(OddEvenMerger(n // 2)(),
OddEvenMerger(n // 2)())),
Unriffle(n)())
self.io.O @= sorter(self.io.I)

Expand Down

0 comments on commit db8ea27

Please sign in to comment.