#16718: Create a category for Cartesian products of groups
-------------------------------------+-------------------------------------
Reporter: tscrim | Owner: tscrim
Type: enhancement | Status: needs_review
Priority: major | Milestone: sage-6.3
Component: group theory | Resolution:
Keywords: cartesian | Merged in:
product, generators, categories | Reviewers:
Authors: Travis Scrimshaw | Work issues:
Report Upstream: N/A | Commit:
Branch: | f8539f428dfa3c770b35969c1a7668a89ddfe892
public/groups/cartesian_product_category-16718| Stopgaps:
Dependencies: |
-------------------------------------+-------------------------------------
Comment (by ncohen):
Yo.
> I've changed this to `in FiniteEnumeratedSets()` which is more
restrictive, but it is safer.
It is also more costly. Really it would all be okay if this was compiled
code, but I keep thinking of what happens when a line like
{{{
if all(M.monoid_generators() in FiniteEnumeratedSets()
or isinstance(M.monoid_generators(), (tuple, list)) for M in F):
ret = [lift(i, gen) for i,M in enumerate(F) for gen in
M.monoid_generators()]
}}}
is executed and it really is awful... `monoid_generators()` is called once
or twice per factor, the caching mechanism does its job to return the pre-
computed generators if necessary, `FiniteEnumeratedSets()` is also created
at each turn and because it is a `UniqueRepresentation` of something there
is a lookup going on there too....
> I've also added a second safety check in case `*_generators()` returns a
tuple or a list (it shouldn't and maybe tuple/list should be considered as
a objects in `FiniteEnumeratedSets()`?).
Don't know ... Then you would have stuff which is detected as
`FiniteEnumeratedSet` but does not inherit the methods... Well...
Okay. Despite the fact that I really do not like categories and probably
never will, thank you for fixing that, your patch does the job. Can you
fix the broken doctests ? It can be set to `positive_review` afterwards.
Nathann
--
Ticket URL: <http://trac.sagemath.org/ticket/16718#comment:12>
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 http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.