#19161: LatticePoset: faster is_complemented()
-------------------------------------+-------------------------------------
       Reporter:  jmantysalo         |        Owner:
           Type:  enhancement        |       Status:  needs_review
       Priority:  major              |    Milestone:  sage-6.9
      Component:  combinatorics      |   Resolution:
       Keywords:                     |    Merged in:
        Authors:  Nathann Cohen,     |    Reviewers:
  Jori Mäntysalo                     |  Work issues:
Report Upstream:  N/A                |       Commit:
         Branch:                     |  b8853ed85f14cb8b3d2a9046d31505bf81223c7d
  u/jmantysalo/faster_is_complemented|     Stopgaps:
   Dependencies:                     |
-------------------------------------+-------------------------------------

Comment (by jmantysalo):

 Replying to [comment:11 ncohen]:
 > HMmmmm... Factor 6?... `O_o`
 >
 > Weird, weird... `:-/`

 Not really. Original code checks ALL element pairs. My code takes one
 element, and kind of check it against all other elements, and stops when
 an element has no complement. Your code jumps to next element when it
 founds a complement and return `False` if it found an element without the
 complement.

 Even your code is not optimal, because meet and join are commutative
 operations. But it may be slower to optimize that, because the code would
 be more complicated.

 In any case, this is now quite fast and IMO ready for review.

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

Reply via email to