[sage-devel] Mutability of matrices with no entries

2015-07-31 Thread Andrey Novoseltsev
Hello, While working on http://trac.sagemath.org/ticket/18613 I ran into the following problem: sage: matrix(2, 1).echelon_form().is_mutable() False sage: matrix(2, 0).echelon_form().is_mutable() True i.e. while usually echelon_form returns an immutable matrix this is not the case with trivial

[sage-devel] Mutability

2013-10-07 Thread Daniel Krenn
There is sage.structure.mutability.Mutability to inherit from. It seems the this class is not used; at least using grep [1] to search for "Mutability" gives just two files (sage/matrix/matrix0.pyx and sage/matrix/matrix_integer_2x2.pyx), where this class is imported. It seems that commenting out th

[sage-devel] Mutability

2013-05-02 Thread Simon King
Hi! Is there a decorator that wraps a method so that the method is only executed after asserting that "self" is mutable? For example, one could easily create immutable graphs by applying this decorator to the add_vertex, add_edge, ... methods. Best regards, Simon -- You received this message b

Re: [sage-devel] Mutability of echelon form result

2010-12-28 Thread Robert Bradshaw
On Tue, Dec 28, 2010 at 8:38 PM, Rob Beezer wrote: > sage: A=matrix(QQ,2,range(4)) > sage: B=matrix(ZZ,2,range(4)) > sage: C=A.echelon_form() > sage: D=B.echelon_form() > sage: C.is_mutable() > True > sage: D.is_mutable() > False > > Should C and D be different with regard to mutability?  If not,

[sage-devel] Mutability of echelon form result

2010-12-28 Thread Rob Beezer
sage: A=matrix(QQ,2,range(4)) sage: B=matrix(ZZ,2,range(4)) sage: C=A.echelon_form() sage: D=B.echelon_form() sage: C.is_mutable() True sage: D.is_mutable() False Should C and D be different with regard to mutability? If not, should both results be immutable? (I'd rather not have to handle both

Re: [sage-devel] Mutability

2010-12-27 Thread Robert Bradshaw
On Mon, Dec 27, 2010 at 11:27 AM, Justin C. Walker wrote: > > On Dec 27, 2010, at 10:58 , Robert Bradshaw wrote: > >> On Sat, Dec 25, 2010 at 5:13 PM, Justin C. Walker wrote: >>> Hi, all, >>> >>> A couple of questions regarding mutabilty: >>> >>> First, I noticed a comment at the beginning of qua

Re: [sage-devel] Mutability

2010-12-27 Thread Justin C. Walker
On Dec 27, 2010, at 10:58 , Robert Bradshaw wrote: > On Sat, Dec 25, 2010 at 5:13 PM, Justin C. Walker wrote: >> Hi, all, >> >> A couple of questions regarding mutabilty: >> >> First, I noticed a comment at the beginning of quadratic_forms/binary_qf.py >> from Stein: "make immutable". Can a

Re: [sage-devel] Mutability

2010-12-27 Thread Robert Bradshaw
On Sat, Dec 25, 2010 at 5:13 PM, Justin C. Walker wrote: > Hi, all, > > A couple of questions regarding mutabilty: > > First, I noticed a comment at the beginning of quadratic_forms/binary_qf.py > from Stein:  "make immutable".  Can anyone (William?) elaborate on what that > means?  They don't c

[sage-devel] Mutability

2010-12-25 Thread Justin C. Walker
Hi, all, A couple of questions regarding mutabilty: First, I noticed a comment at the beginning of quadratic_forms/binary_qf.py from Stein: "make immutable". Can anyone (William?) elaborate on what that means? They don't currently (e.g., sage-4.6.1-a3) seem to be very immutable: sage: q1=Bin

Re: [sage-devel] Mutability and Cython...

2010-03-01 Thread Mike Hansen
Hello, On Mon, Mar 1, 2010 at 1:10 AM, Florent Hivert wrote: > I'm doing some cleanup in mutability, but I'm rather new to Cython. I there > any reason (aside backward compatibility) to have these two following methods > rather than a cpdef ? Nope, I believe that these were written before cpdef

[sage-devel] Mutability and Cython...

2010-03-01 Thread Florent Hivert
Hi there, I'm doing some cleanup in mutability, but I'm rather new to Cython. I there any reason (aside backward compatibility) to have these two following methods rather than a cpdef ? def _require_mutable(self): if self._is_immutable: raise ValueError, "object is i