#17173: Poset: faster is_distributive_lattice
-------------------------------------+-------------------------------------
       Reporter:  jmantysalo         |        Owner:
           Type:  enhancement        |       Status:  needs_work
       Priority:  major              |    Milestone:  sage-6.4
      Component:  combinatorics      |   Resolution:
       Keywords:                     |    Merged in:
        Authors:  Jori Mäntysalo     |    Reviewers:
Report Upstream:  N/A                |  Work issues:
         Branch:                     |       Commit:
  u/jmantysalo/poset__faster_is_distributive_lattice|  
d69e73a0a0a655e4e1595a77cda807ccb017fb02
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------

Comment (by ncohen):

 > I need the list.

 Not there
 {{{
 len([e for e in self if len(self.lower_covers(e))==1])
 }}}

 nor there

 {{{
 if len(self.upper_covers(m))==1:
 }}}

 nor there
 {{{
 if len(M_.minimal_elements()) > 1:
 }}}

 > It starts with `x=give_an_array(y)` but if it's length is exactly one,
 then continues with `z=x[0]`. Or do you mean optimizing it so that if code
 founds out that `len(self.upper_covers(m)` is at least 2, it returns
 False?

 I have not read the algorithm closely yet, I do not know what it does
 exactly. There are places in the code, however, where those lists are
 created only to compute their length, e.g. above.

 > Uh, I somehow thinked that it would be optimized out. But of course it
 can not be done. I will correct this.

 Python is the worst language ever. It is a script. I hate scripts.

 > ?? I didn't touch it, just deprecated a function.

 yes yes, but the deprecation breaks the tests. Run the tests and see ! It
 is trivial, however, you probably only need to fix the output (which now
 contains the deprecation warning).

 > Thanks for comments! I'll continue with these later.

 Good luck ! `:-)`

 Nathann

--
Ticket URL: <http://trac.sagemath.org/ticket/17173#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 http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to