#21109: Faster meet() for lattice
-------------------------------------+-------------------------------------
       Reporter:  jmantysalo         |        Owner:
           Type:  enhancement        |       Status:  needs_work
       Priority:  minor              |    Milestone:  sage-7.3
      Component:  combinatorics      |   Resolution:
       Keywords:  lattice poset      |    Merged in:
        Authors:  Jori Mäntysalo     |    Reviewers:
Report Upstream:  N/A                |  Work issues:
         Branch:  u/jmantysalo       |       Commit:
  /faster-meet                       |  b679b3ddc7f7e1552a098ee5b231d5e3eeff4249
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------
Changes (by jmantysalo):

 * status:  needs_review => needs_work


Old description:

> This trivial patch will speed up computation of meet matrix in lattices.
> Before:
>
> {{{
> sage: P = Posets.BooleanLattice(10)
> sage: timeit("_ = P._hasse_diagram._meet", repeat=1, number=1)
> 1 loops, best of 1: 2.24 s per loop
> }}}
>
> After:
>
> {{{
> sage: P = Posets.BooleanLattice(10)
> sage: timeit("_ = P._hasse_diagram._meet", repeat=1, number=1)
> 1 loops, best of 1: 917 ms per loop
> }}}

New description:

 This trivial patch will speed up computation of meet matrix in lattices.
 Before:

 {{{
 sage: P = Posets.BooleanLattice(10)
 sage: timeit("_ = P._hasse_diagram._meet", repeat=1, number=1)
 1 loops, best of 1: 2.24 s per loop
 }}}

 After:

 {{{
 sage: P = Posets.BooleanLattice(10)
 sage: timeit("_ = P._hasse_diagram._meet", repeat=1, number=1)
 1 loops, best of 1: 917 ms per loop
 }}}

 And for small lattices:

 {{{
 sage: P10 = [P.with_bounds() for P in Posets(8)]
 sage: timeit("len([P for P in P10 if P.is_meet_semilattice()])", repeat=1,
 number=1)
 }}}

 Without this patch it took 5.46 seconds, after the patch 1.54 seconds.

--

--
Ticket URL: <https://trac.sagemath.org/ticket/21109#comment:6>
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