#8276: Make the one(), identity_matrix() and zero_matrix() cached and immutable.
------------------------------+---------------------------------------------
   Reporter:  hivert          |       Owner:  hivert      
       Type:  defect          |      Status:  needs_review
   Priority:  major           |   Milestone:  sage-4.3.3  
  Component:  linear algebra  |    Keywords:  One mutable.
     Author:  Florent Hivert  |    Upstream:  N/A         
   Reviewer:                  |      Merged:              
Work_issues:                  |  
------------------------------+---------------------------------------------

Comment(by hivert):

 Oups ! I just realize I forgot to reupload {{{trac_8276
 -fix_zero_matrix_creation-fh.patch}}} after a last minor change. Many
 apologies if you started to review ! For info here is the changelog
 between the two last version of the patch
 {{{
     2.31 @@ -85,6 +85,8 @@
     2.32               []
     2.33  +            sage: mat.is_mutable()
     2.34  +            False
     2.35 ++            sage: MM.zero().is_mutable()
     2.36 ++            False
     2.37           """
     2.38  -        try:
     2.39  -            z = self.__zero_matrix
     2.40 @@ -98,6 +100,8 @@
     2.41  +        res.set_immutable()
     2.42  +        return res
     2.43  +
     2.44 ++    zero = zero_matrix
     2.45 ++
     2.46       def ngens(self):
     2.47           """
     2.48           Return the number of generators of this matrix space,
 }}}
 Again, sorry for any inconvenience.

 Florent

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/8276#comment:10>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to