2009/6/13 Rob Beezer <goo...@beezer.cotse.net>: > > On Jun 12, 1:17 am, John Cremona <john.crem...@gmail.com> wrote: >> I think there's a case for having a more basic class for holding >> "things with multiplicities"; the the spectrum could be one of these >> (or a class derived from it) and Factorization would also be a derived >> class. > > Hi John, > > Yes, I agree. There's a lot of the Factorization class oriented to > integers, or primes, such as gcd() and value() methods. But the > functionality for tracking and representing "things" with > multiplicities would be useful in other contexts. For a superclass of > a Spectrum object I'd be interested in "things" that are sortable, and > such that if they are repeated, then they can be safely grouped > together without any change in meaning. Much of such a hypothetical > superclass could probably be employed in the Factorization class. > > For multisets, as Nicolas suggests, the order would no longer be > important. It seems like the defaultdict() data type from the Python > collections module could provide much of this functionality.
That's good, I was hoping either that Python had this already, or that it was in combinat. John > > Rob > > > --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to sage-devel-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---