#8148: looking at the dual of a poset: IndexError
-----------------------------+----------------------------------------------
   Reporter:  jhpalmieri     |          Owner:  sage-combinat
       Type:  defect         |         Status:  new          
   Priority:  major          |      Milestone:  sage-4.8     
  Component:  combinatorics  |       Keywords:               
Work_issues:                 |       Upstream:  N/A          
   Reviewer:                 |         Author:               
     Merged:                 |   Dependencies:               
-----------------------------+----------------------------------------------

Comment(by brunellus):

 {{{
 sage:Poset({1: [], 3: [], 2: [1, 3]}).dual().relations()
 ---------------------------------------------------------------------------
 RuntimeError                              Traceback (most recent call
 last)

 /root/<ipython console> in <module>()

 /root/Sage/sage/local/lib/python2.6/site-
 packages/sage/combinat/posets/posets.pyc in relations(self)
     717         - Rob Beezer (2011-05-04)
     718         """
 --> 719         return list(self.relations_iterator())
     720
     721     def relations_iterator(self):

 /root/Sage/sage/local/lib/python2.6/site-
 packages/sage/combinat/posets/posets.pyc in relations_iterator(self)
     745         # Relies on vertices the fact that _elements correspond to
 the rows and
     746         # columns of the lequal matrix
 --> 747         leq_mat = self.lequal_matrix()
     748         n = leq_mat.nrows()
     749         elements = self._elements

 /root/Sage/sage/local/lib/python2.6/site-
 packages/sage/combinat/posets/posets.pyc in lequal_matrix(self, **kwds)
    1282             False
    1283         """
 -> 1284         return self._hasse_diagram.lequal_matrix(**kwds)
    1285
    1286     def meet_matrix(self):

 /root/Sage/sage/local/lib/python2.6/site-
 packages/sage/combinat/posets/hasse_diagram.pyc in lequal_matrix(self,
 ring, sparse)
     867         D = {}
     868         for i in range(n):
 --> 869             for v in self.breadth_first_search(i):
     870                 D[(i,v)] = 1
     871         self._leq_matrix = matrix(ring, n, n, D, sparse=sparse)

 /root/Sage/sage/local/lib/python2.6/site-
 packages/sage/graphs/generic_graph.pyc in breadth_first_search(self,
 start, ignore_direction, distance, neighbors)
   11565         # Preferably use the Cython implementation
   11566         if neighbors is None and not isinstance(start,list) and
 distance is None and hasattr(self._backend,"breadth_first_search"):
 > 11567             for v in self._backend.breadth_first_search(start,
 ignore_direction = ignore_direction):
   11568                 yield v
   11569         else:

 /root/Sage/sage/local/lib/python2.6/site-
 packages/sage/graphs/base/c_graph.so in
 sage.graphs.base.c_graph.Search_iterator.__next__
 (sage/graphs/base/c_graph.c:19732)()

 /root/Sage/sage/local/lib/python2.6/site-
 packages/sage/graphs/base/sparse_graph.so in
 sage.graphs.base.sparse_graph.SparseGraph.out_neighbors
 (sage/graphs/base/sparse_graph.c:8007)()

 /root/Sage/sage/local/lib/python2.6/site-
 packages/sage/graphs/base/sparse_graph.so in
 sage.graphs.base.sparse_graph.SparseGraph.out_neighbors
 (sage/graphs/base/sparse_graph.c:7841)()

 /root/Sage/sage/local/lib/python2.6/site-
 packages/sage/graphs/base/c_graph.so in
 sage.graphs.base.c_graph.CGraph.check_vertex
 (sage/graphs/base/c_graph.c:5697)()

 RuntimeError: Vertex (0) is not a vertex of the graph.
 }}}

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/8148#comment:2>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to