#10752: Matrix pivots are cached, should be immutable
------------------------------+---------------------------------------------
   Reporter:  rbeezer         |       Owner:  jason, was   
       Type:  defect          |      Status:  needs_review 
   Priority:  minor           |   Milestone:  sage-4.7     
  Component:  linear algebra  |    Keywords:  matrix pivots
     Author:  John Palmieri   |    Upstream:  N/A          
   Reviewer:                  |      Merged:               
Work_issues:                  |  
------------------------------+---------------------------------------------

Comment(by jhpalmieri):

 Here is a new version of the patch.  I think this deals with every
 instance where something involving the string "pivot" is fetched from the
 cache.

 There are two other ways to proceed, if we don't like this approach:

  - cache the pivots as tuples instead of lists, or
  - add a keyword to the "pivots" method just like there currently is for
 "nonzero_positions".  That is, model the definition after this:
 {{{
     def nonzero_positions(self, copy=True, column_order=False):
         """
         Returns the sorted list of pairs (i,j) such that self[i,j] != 0.

         INPUT:

         -  ``copy`` - (default: True) It is safe to change the
            resulting list (unless you give the option copy=False).
 }}}
 I think the question is, how much of a performance hit is there by copying
 the list, and are there times when we want to use the unsafe, but faster
 method.  I don't know the answer to this.  Would the first alternative
 (caching a tuple) be any better, or would the cached value need to be
 converted to a list frequently enough that it would slow things down?

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10752#comment:2>
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