# Ticket #14216: trac-14216-combinat-small-cleanup-fc.patch

File trac-14216-combinat-small-cleanup-fc.patch, 4.1 KB (added by chapoton, 9 years ago)
• ## sage/combinat/all.py

```# HG changeset patch
# User Frederic Chapoton <chapoton at math.univ-lyon1.fr>
# Date 1362305007 -3600
# Node ID 8a287dd7a15905db3a3e5599995a22edbe0304ab
# Parent  be4962cdd100d0521c00f2469aa014e2a124ca5c
trac #14216 small cleanup of some combinat files

diff --git a/sage/combinat/all.py b/sage/combinat/all.py```
 a from finite_class import FiniteCombinato from species.all import * from dlx import AllExactCovers, OneExactCover, DLXMatrix from multichoose_nk import MultichooseNK
• ## sage/combinat/posets/hasse_diagram.py

`diff --git a/sage/combinat/posets/hasse_diagram.py b/sage/combinat/posets/hasse_diagram.py`
 a Hasse diagrams of posets #                  http://www.gnu.org/licenses/ #***************************************************************************** import copy from copy import copy from sage.graphs.digraph import DiGraph from sage.matrix.constructor import matrix from sage.rings.integer_ring import ZZ class HasseDiagram(DiGraph): sage: H.order_ideal([7,10]) [0, 1, 2, 3, 4, 5, 6, 7, 8, 10] """ from copy import copy H = copy(self).reverse() oi = [] for i in elements: class HasseDiagram(DiGraph): return self._meet n = self.cardinality() meet = [[0 for x in range(n)] for x in range(n)] le = copy.copy(self.lequal_matrix()) le = copy(self.lequal_matrix()) for i in range(n): le[i,i] = 1 if not all([le[0,x]==1 for x in range(n)]): raise ValueError, "Not a meet-semilattice: no bottom element." raise ValueError("Not a meet-semilattice: no bottom element.") lc = [[y[0] for y in self.incoming_edges([x])] for x in range(n)] for x in range(n): # x=x_k class HasseDiagram(DiGraph): if z>q: q = z for z in T: if not le[z,q]: raise ValueError, "No meet for x=%s y=%s"%(x,y) raise ValueError("No meet for x=%s y=%s"%(x,y)) meet[x][y] = q meet[y][x] = q class HasseDiagram(DiGraph): if hasattr(self,'_join'): return self._join n = self.cardinality() join = [[0 for x in range(n)] for x in range(n)] le = copy.copy(self.lequal_matrix()) le = copy(self.lequal_matrix()) for i in range(n): le[i,i] = 1 if not all([le[x,n-1]==1 for x in range(n)]): raise ValueError, "Not a join-semilattice: no top element." raise ValueError("Not a join-semilattice: no top element.") uc = [sorted([n-1-y[1] for y in self.outgoing_edges([x])]) for x in reversed(range(n))] class HasseDiagram(DiGraph): if z>q: q = z for z in T: if not le[n-1-q,n-1-z]: raise ValueError, "No join for x=%s y=%s"%(x,y) raise ValueError("No join for x=%s y=%s"%(x,y)) join[x][y] = q join[y][x] = q
• ## sage/combinat/posets/linear_extensions.py

`diff --git a/sage/combinat/posets/linear_extensions.py b/sage/combinat/posets/linear_extensions.py`
 a class LinearExtensionOfPoset(ClonableArr sage: p.evacuation().evacuation() == p True """ L = [] for i in reversed(range(1,len(self)+1)): for j in range(1,i): self = self.tau(j)
• ## sage/combinat/posets/poset_examples.py

`diff --git a/sage/combinat/posets/poset_examples.py b/sage/combinat/posets/poset_examples.py`
 a class Posets(object): atstring = [] btstring = [] c=0 d=0 for i in range(len(a)): atstring=atstring+a[i] for i in range(len(b)):