Hello everybody !!!

The french speakers who read the other post in this forum already know that
I am having a hard time with posets, and it may very well be my fault.

But come on.... Just look at that !!!

--------------
sage: Permutations(10).random_element()
[9, 2, 6, 7, 5, 4, 10, 8, 1, 3]
sage: # I build the poset on the *indices* of p, not on the elements of p,
because in my situation the elements of P are not hashable
sage: p = [9, 2, 6, 7, 5, 4, 10, 8, 1, 3]
sage: comparison = lambda x,y : (p[x] % p[y] == 0)
sage: P = Poset( (range(len(p)), comparison) )
sage: m = P.minimal_elements()
sage: map( lambda x: p[x], m)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)

/home/ncohen/<ipython console> in <module>()

/home/ncohen/<ipython console> in <lambda>(x)

TypeError: list indices must be integers, not
FinitePoset_with_category.element_class
sage: map(type, m)
[<class
'sage.combinat.posets.elements.FinitePoset_with_category.element_class'>,
<class
'sage.combinat.posets.elements.FinitePoset_with_category.element_class'>,
<class
'sage.combinat.posets.elements.FinitePoset_with_category.element_class'>,
<class
'sage.combinat.posets.elements.FinitePoset_with_category.element_class'>,
<class
'sage.combinat.posets.elements.FinitePoset_with_category.element_class'>]
sage: Integer(m[0])
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)

/home/ncohen/<ipython console> in <module>()

/home/ncohen/.Sage/local/lib/python2.7/site-packages/sage/rings/integer.so
in sage.rings.integer.Integer.__init__ (sage/rings/integer.c:7412)()

TypeError: unable to coerce <class
'sage.combinat.posets.elements.FinitePoset_with_category.element_class'> to
an integer
sage:

----------------

So -of course- it is somewhoe my fault because the objects in my Poset are
graphs, that you asked me to make them hashable a looooong time ago, and
that I still have not done it... But come on, I put integers in my Poset
and what I get can not even be coerced to Integer type ! O_o;;;;

Nathann

-- 
You received this message because you are subscribed to the Google Groups 
"sage-combinat-devel" group.
To post to this group, send email to sage-combinat-devel@googlegroups.com.
To unsubscribe from this group, send email to 
sage-combinat-devel+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sage-combinat-devel?hl=en.

Reply via email to