You're right. This is what I meant:

sage: L = [vector([1,0,0]), vector([1,2,0]), vector([1,0,3]), vector([1,0,0])]
sage: LL = [tuple(v.list()) for v in L]
sage: Set(LL)
{(1, 0, 0), (1, 0, 3), (1, 2, 0)}

But that is probably what you said in the first place.

Here's another idea:

sage: L = [vector([1,0,0]), vector([1,2,3]), vector([1,2,3]), vector([1,0,0])]
sage: iL = Set([L.index(v) for v in L])
sage: [L[i] for i in iL]
[(1, 0, 0), (1, 2, 3)]


Does this help in your situatiuon?


On Mon, Jan 19, 2009 at 6:26 PM, slabbe <[email protected]> wrote:
>
>> I don't know if this is the best idea or not but I definitely have
>> run into this problem before and what I think I did was
>> to store the list of vectors as a *Set* of *lists*.
>
> Are you sure? Because as vectors, lists are unhashable :
>
> ...
> TypeError: list objects are unhashable
> >
>

--~--~---------~--~----~------------~-------~--~----~
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-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to