#19878: LatticePoset: add is_coatomic, simpler code
-------------------------------------+-------------------------------------
       Reporter:  jmantysalo         |        Owner:
           Type:  enhancement        |       Status:  needs_review
       Priority:  minor              |    Milestone:  sage-7.1
      Component:  combinatorics      |   Resolution:
       Keywords:  latticeposet       |    Merged in:
        Authors:  Jori Mäntysalo     |    Reviewers:
Report Upstream:  N/A                |  Work issues:
         Branch:                     |       Commit:
  u/jmantysalo/simpler_atomic        |  533d660eaf56a4a19116e28759c5d408c860999b
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------

Comment (by jmantysalo):

 Replying to [comment:4 chapoton]:
 > Why do you change ('simplify') the code ? What you propose has to run
 over all the lattice, even after it has already found more join
 irreducibles than atoms..

 I tested with

 {{{
 B10 = Posets.BooleanLattice(10)
 B10_ = B10.with_bounds()
 }}}

 and then timed both

 {{{
 [B10.is_atomic() for i in range(1000)].count(True)
 [B10_.is_atomic() for i in range(1000)].count(True)
 }}}

 For `B10` the time drops from 5,57 second to 0,85 seconds, for `B10_` it
 raised from 0,78 to 0,85 seconds. But I can revert this back if you want.

 (It is not reasonable to think about something like `BooleanLattice(20)`,
 as just `BooleanLattice(12)` takes 43 seconds to complete.)

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