#11187: Implementation of finite reflection groups
-------------------------------------+-------------------------------------
       Reporter:  stumpc5            |        Owner:  tbd
           Type:  enhancement        |       Status:  needs_work
       Priority:  major              |    Milestone:  sage-7.2
      Component:  combinatorics      |   Resolution:
       Keywords:  reflection group,  |    Merged in:
  days49, days 64.5                  |    Reviewers:
        Authors:  Christian Stump    |  Work issues:
Report Upstream:  N/A                |       Commit:
         Branch:  public/11187       |  def701588736edda81a86ddd1a9cbdbc849657be
   Dependencies:  #20107             |     Stopgaps:
-------------------------------------+-------------------------------------

Comment (by tscrim):

 Replying to [comment:210 stumpc5]:
 > Travis, could you have a look at the diffset 8497f5d; I commented out
 that the change is actually used, see {{{#for i in self.noncom[first]}}},
 it seems to slow down the test even though much less is actually tested.
 Maybe you see how to get rid of the overhead the line {{{for i in
 self.noncom[first]}}} has compared to {{{for i in
 range(first+1,self.n)}}}.

 My guess is because Cython is smart enough to translate
 {{{#!python
 for i in range(n)
 }}}
 into
 {{{#!c
 for(i=0; i<n; ++i)
 }}}
 whereas for the other, it is iterating over some object (which, a priori,
 may not even be iterable). In more detail, Cython doesn't even know that
 it is iterating over a list, just that `self.noncom` is. Try:
 {{{#!python
         nc = self.noncom[first]
         for i in nc:
 }}}
 or the variant
 {{{#!python
         nc = self.noncom[first]
         k = len(nc)
         for dummy in range(k):
             i = nc[dummy]
 }}}
 where you have `cdef list nc` and `cdef int dummy, k` (although I suspect
 the former of these is faster).

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

Reply via email to