#18515: LatticePoset: add sublattice()
-------------------------------------+-------------------------------------
Reporter: jmantysalo | Owner:
Type: enhancement | Status: needs_review
Priority: major | Milestone: sage-6.8
Component: combinatorics | Resolution:
Keywords: | Merged in:
Authors: Jori Mäntysalo | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
u/deinst/latticeposet__add_sublattice__|
47f2ce7a7799982ea29157c932bf91b31b78a3cc
Dependencies: | Stopgaps:
-------------------------------------+-------------------------------------
Comment (by ncohen):
Yo !
I added a commit at `public/18515` which improves the algorithm a bit. In
general, try to avoid using 'Subsets' (or any combinat stuff) if you can
avoid it: they implement their code to deal with infinitely more
abstraction than you usually need (categories, parents, elements, ...).
{{{
sage: type(Subsets([1,2,3],2).an_element())
<class 'sage.sets.set.Set_object_enumerated_with_category'>
}}}
When you only need to enumerate pairs of points, the better is to use
itertools:
{{{
sage: from itertools import combinations
sage: list(combinations([1,2,3],2))
[(1, 2), (1, 3), (2, 3)]
}}}
Simple, and more efficient.
> So, who's going to review this?
We can review each other's commits, it is not forbidden. For as long as
everything is doubled checked, no problem.
Nathann
--
Ticket URL: <http://trac.sagemath.org/ticket/18515#comment:8>
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.