On Jun 2, 2008, at 10:19 AM, William Stein wrote: > > On Mon, Jun 2, 2008 at 10:17 AM, Carl Witty <[EMAIL PROTECTED]> > wrote: >> >> On Jun 2, 9:31 am, "William Stein" <[EMAIL PROTECTED]> wrote: >>> On Mon, Jun 2, 2008 at 7:17 AM, Jason Grout <jason- >>> [EMAIL PROTECTED]> wrote: >>> >>>> kcrisman wrote: >>>>> Referring tohttp://trac.sagemath.org/sage_trac/ticket/3212, I >>>>> have to >>>>> do a little cleaning up before submitting it for review, but >>>>> have some >>>>> code for allowing rescaling of matrices by "logical" scalars >>>>> not in >>>>> the base ring. However, in order to do this, I need to return >>>>> a copy, >>>>> not modify the original, and robertwb raises the point that >>>>> perhaps >>>>> then rescale_row etc. should *always* return a copy, for >>>>> consistency. >>> >>>> +1 to always returning a copy. >>> >>> Do you have any idea what making this change is going to do to >>> the generic echelonize() command? It's just not going to work at >>> all >>> or be insanely slow.
I wasn't actually thinking a copy would be created, but rather self would be returned after being mutated (rather than None). >> Maybe rescale_row and rescale_col should retain their current >> semantics, and we should have new methods with_rescaled_row and >> with_rescaled_col that always return a modified copy and never modify >> the original. Then rescale_row and rescale_col could catch the type >> error from #3212, and produce a new type error that says something >> like "rescale_row cannot change the base ring of the matrix; try >> with_rescaled_row instead". >> > > +1 -- that's a great idea! Another +1, this is the best solution I've heard so far. - Robert --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---