#20317: bug in Permutations_msetk cardinality
---------------------------------+------------------------
Reporter: vdelecroix | Owner:
Type: defect | Status: new
Priority: major | Milestone: sage-7.2
Component: combinatorics | Resolution:
Keywords: bug | Merged in:
Authors: | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
Dependencies: | Stopgaps:
---------------------------------+------------------------
Comment (by vdelecroix):
Replying to [comment:3 tscrim]:
> Replying to [comment:2 vdelecroix]:
> > I don't understand why there are two classes at all.
`Permutations_mset(ms)` is a shortcut for `Permutations_msetk(ms,
len(ms))`.
>
> I don't see anything like that in the code.
Me neither. Replace shortcut by "the same mathematical set".
On the other hand `P_msetk` is a union of `P_mset` over the submultiset of
fixed size.
> Or do you mean there should be? I think there should be 2 classes, as
the general `Permutations_mset` can have faster iteration, a dedicated
`cardinality` method, and easier/faster containment checking. Although I
am thinking the better approach would be to have a common ABC for `P_mset`
and `P_msetk` as basically every method of the former is overwritten by
the latter.
Adding a third class to "simplify" the inheritance!?
The `_k` suffix in the name of classes is very confusing:
- `Subsets_sk` are included in `Subsets_s`
- `Permutations_nk` are not included in `Permutations_n`
--
Ticket URL: <http://trac.sagemath.org/ticket/20317#comment:4>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.