#16718: Create a category for Cartesian products of groups
-------------------------------------+-------------------------------------
       Reporter:  tscrim             |        Owner:  tscrim
           Type:  enhancement        |       Status:  positive_review
       Priority:  major              |    Milestone:  sage-6.3
      Component:  group theory       |   Resolution:
       Keywords:  cartesian          |    Merged in:
  product, generators, categories    |    Reviewers:  Nathann Cohen
        Authors:  Travis Scrimshaw   |  Work issues:
Report Upstream:  N/A                |       Commit:
         Branch:                     |  8db0f5138914ddd7a9da9e2a57d26c8f45091c93
  public/groups/cartesian_product_category-16718|     Stopgaps:
   Dependencies:                     |
-------------------------------------+-------------------------------------
Changes (by tscrim):

 * status:  needs_review => positive_review
 * reviewer:   => Nathann Cohen


Comment:

 Replying to [comment:12 ncohen]:
 > 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 changed it to create `FiniteEnumeratedSets()` outside of the loop (its a
 micro-optimization: the result is cached and the number of factors is
 small). However `*_generators` is very rarely to be called twice and not
 short-circuit the `all` (because `*_generators` should return a `Family`),
 and it should be cached.

 > Don't know ... Then you would have stuff which is detected as
 `FiniteEnumeratedSet` but does not inherit the methods... Well...

 Another question for me to ask Nicolas next time I see him.

 > 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.

 Thanks Nathann!

--
Ticket URL: <http://trac.sagemath.org/ticket/16718#comment:16>
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.

Reply via email to