#10763: Speedup of  matrix multiplication
------------------------------+---------------------------------------------
   Reporter:  SimonKing       |       Owner:  jason, was           
       Type:  enhancement     |      Status:  needs_info           
   Priority:  major           |   Milestone:  sage-4.6.2           
  Component:  linear algebra  |    Keywords:  matrix multiplication
     Author:  Simon King      |    Upstream:  N/A                  
   Reviewer:                  |      Merged:                       
Work_issues:                  |  
------------------------------+---------------------------------------------
Changes (by rbeezer):

  * status:  needs_review => needs_info


Comment:

 Simon,

 Looks real good.  One suggestion - and it really is ''just'' a suggestion.
 Your call.

 Two instances of basically:

 {{{
 try:
     from sage.matrix.matrix_space import _cache
     MS = _cache[base_ring, nrows, ncols, sparse]()
 except KeyError:
     return MatrixSpace(base_ring, nrows, ncols, sparse)
 if MS is not None:
     return MS
 return MatrixSpace(base_ring, nrows, ncols, sparse)
 }}}

 and a suggested replacement:

 {{{
 try:
     from sage.matrix.matrix_space import _cache
     MS = _cache[base_ring, nrows, ncols, sparse]()
 except KeyError:
     MS = None
 if MS is None:
     return MatrixSpace(base_ring, nrows, ncols, sparse)
 else:
     return MS
 }}}

 Suggestion uses try/except to form "best guess" for `MS`.  Either we find
 it, or we get `None`.  Then if/else returns it, or creates it and returns
 it.

 An extra line, an extra comparison in one case, but the `not` is gone and
 most importantly, just one place to describe the actual `MatrixSpace` call
 (instead of two that are identical).  Anyway, a toss-up, I'd guess, so
 just a suggestion.

 In the meantime, I am going to run the full test suite right now.

 Rob

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