Hi Javier,
On Thu, Dec 03, 2009 at 11:03:43AM -0800, Robert Bradshaw wrote: > On Dec 3, 2009, at 10:04 AM, javier wrote: > > > This also makes sense. I don't really know which choice would be > > better. Maybe having both, doing something like > > > > def conjugacy_class(self): > > G = self.parent() > > return G.conjugacy_class(g) > > > > does that sound reasonable or would it be better to stick just to one > > of them? > I think it's a good idea to write the code as a method for groups, and then have a "wrapper" method for group elements that calls the group method as you wrote above. > > > > In which file should the code be included? > > $SAGE_ROOT/devel/sage/sage/generic.py or somewhere else? > > Almost certainly as a method on the Group object in sage/groups/ > group.pyx > Yes, have a look at sage/groups/group.pyx. It has a FiniteGroup class, where I think you should put your main method (that's what Florent said as well, I think). For group elements, one possibility is to put the wrapper method in the class MultiplicativeGroupElement in the file sage/structure/element.pyx. You would probably want to do something like def conjugacy_class(self): G = self.parent() try: return G.conjugacy_class(self) except AttributeError: raise NotImplementedError, "Computation of conjugacy classes not implemented for %s"%self because some groups (e.g. infinite ones) won't have the method conjugacy_class(). If anybody thinks that element.pyx should not get cluttered with this kind of thing, please say something! Before you start editing files in the Sage library, have a look at http://wiki.sagemath.org/MercurialQueues Thanks for working on this, and as William said, we need to get more GAP functionality exposed, so feel free to wrap more stuff! Best, Alex -- Alex Ghitza -- Lecturer in Mathematics -- The University of Melbourne -- Australia -- http://www.ms.unimelb.edu.au/~aghitza/ -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org