On Monday, June 18, 2012 2:01:00 PM UTC+1, Nathann Cohen wrote: > > And what do you do with your graph once that is is immutable ? You > create a whole copy when you want to add an edge ? >
Thats how matrices work in Sage, for example. > And if you have a GenericGraph on which you want to use a function > that is only available for perfect graphs you have to copy it again to > use PerfectGraph.something ? > Often the specialized class will use a specialized way to store the information, so its usually not an issue. You could also implement a copy-on-write system if you want to share the underlying graph data. > And if your graphs has several properties at once and you want to use > one method of each... One graph per propety ? O_O;;;; Again, thats the same for matrices. If you want to view your integral matrix as a matrix over a finite field you'll have to create a copy. Of course I'm not saying thats a quick fix for your "large source file problem". Its a symptom that something is iffy, and of course the easy way out is to just farm out methods to other files. And maybe a class hierarchy isn't a good solution for you either. But at least you should think long and hard about the long-term plan. -- 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