Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions permuta/bisc/bisc.py
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,12 @@ class PropertyBitmaps:
permutations, in lexicographic order. `good_counts` maps each length to its
number of good permutations, and `bitmaps` to its bitmap.

`bitmaps` builds the bitmap of a length kept as indices each time it is
asked for it, so `items()`, `values()` and `dict(bitmaps)`, or `bitmaps`
given to another `PropertyBitmaps`, build every such length's bitmap:
10.9 GB for length 14. Asking whether a length is there, iterating over
the lengths and `len()` build none.

Examples:
>>> pb = PropertyBitmaps(Perm.is_increasing)
>>> pb.add_length(3)
Expand All @@ -520,6 +526,9 @@ class PropertyBitmaps:
[Perm((0, 1, 2))]
>>> len(pb.bad[3])
5
>>> pb.add_length(8)
>>> pb.good_counts[8], len(pb.bitmaps[8])
(1, 5040)
"""

def __init__(
Expand Down
Loading