#20494: Poset is_chain_of_poset(): error checking and saturated-keyword
-------------------------------------+-------------------------------------
Reporter: jmantysalo | Owner:
Type: defect | Status: needs_review
Priority: major | Milestone: sage-7.3
Component: combinatorics | Resolution:
Keywords: | Merged in:
Authors: Jori Mäntysalo | Reviewers: Travis Scrimshaw
Report Upstream: N/A | Work issues:
Branch: | Commit:
u/jmantysalo/saturated_chain | efe83f037d5ebbaec63549945c8b416df5d30326
Dependencies: | Stopgaps:
-------------------------------------+-------------------------------------
Changes (by tscrim):
* reviewer: => Travis Scrimshaw
* milestone: sage-7.2 => sage-7.3
Comment:
Two things:
{{{#!diff
- - ``saturated`` -- a Boolean. If ``True``, then return ``True``
- only if `elms` is a saturated chain. A chain `C` is saturated
- when `a < b < c` and `a, c \in C` implies `b \in C`.
+ - ``saturated`` -- boolean; if ``True``, then return ``True``
+ only if `elms` is a saturated chain.
}}}
and put
{{{
A chain `C` is saturated when `a < b < c` and `a, c \in C` implies `b \in
C`.
}}}
in with the body of the docstring.
The other thing is I would also have the code be this like this:
{{{#!python
# _element_to_vertex can be assumed to be a linear extension
# of the poset according to the documentation of class
# HasseDiagram.
H = self._hasse_diagram
if ordered:
elms = [self._element_to_vertex(e) for e in elms]
else:
elms = sorted(set([self._element_to_vertex(e) for e in elms]))
if saturated:
return all(H.covers(a, b) for a, b in zip(elms, elms[1:]))
else:
return all(H.is_lequal(a, b) for a, b in zip(elms, elms[1:]))
}}}
--
Ticket URL: <http://trac.sagemath.org/ticket/20494#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.