#16295: Faster is_orthogonal_array
-------------------------+-------------------------------------------------
       Reporter:         |        Owner:
  ncohen                 |       Status:  needs_review
           Type:         |    Milestone:  sage-6.3
  enhancement            |   Resolution:
       Priority:  major  |    Merged in:
      Component:         |    Reviewers:
  combinatorics          |  Work issues:
       Keywords:         |       Commit:
        Authors:         |  b9f8b0388a8cd333bfaf4160896b09be5550896a
  Nathann Cohen          |     Stopgaps:
Report Upstream:  N/A    |
         Branch:         |
  u/ncohen/16295         |
   Dependencies:         |
  #16236                 |
-------------------------+-------------------------------------------------

Comment (by leif):

 Replying to [comment:32 ncohen]:
 > `times_n2` ? What for ?

 It's used twice, in the outer loop and the first inner loop:
 {{{
 #!python
     for i in range(k): # For any column C1
         C1 = OAc+i*n2
         for j in range(i+1,k): # For any column C2 > C1
             C2 = OAc+j*n2
             ...
 }}}

 One would usually not look up multiples of `n^2` (or `n` in the earlier
 case), but do
 {{{
 #!python
     C1 = OAc
     i = 0
     while i < k:

         ... # similar for C2, j

         C1 += n2
         i++
 }}}

 In C, you'd presumably drop `j` (and perhaps also `i`) altogether, and
 just compare the pointers to the address of the (current sub-)array end.

 (And inlining the bitset operations would of course make it even faster.
 Afterwards special-case for `n`=2^m^ ... :-) )

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