#4648: [with patch, with positive review] sparse linear algebra: 
nonzero_positions
is slow
----------------------------+-----------------------------------------------
 Reporter:  boothby         |        Owner:  boothby   
     Type:  defect          |       Status:  new       
 Priority:  minor           |    Milestone:  sage-3.4.1
Component:  linear algebra  |   Resolution:            
 Keywords:  sparse          |  
----------------------------+-----------------------------------------------
Changes (by craigcitro):

  * summary:  [with patch, needs review] sparse linear algebra:
              nonzero_positions is slow => [with patch, with
              positive review] sparse linear algebra:
              nonzero_positions is slow

Comment:

 Code looks good. Merge!

 However, I think that the fact that all three versions of this code are
 nearly identical means that a new enhancement ticket should be opened to
 clean up the classes here. In particular, I think the following might be a
 reasonable plan:

  * in `matrix_integer_sparse`, rename `_matrix` to `_rows` for consistency
 (and clarity -- you're getting a list of rows, not a pointer to the whole
 matrix)
  * clean up the associated vector classes (in fact, `vector_modn_sparse`
 isn't even a class right now!), and have them all inherit from an abstract
 class with the same methods they all share (which could all raise
 `NotImplementedError`s, for all that matters)
  * make each of the sparse matrix classes have a member `_rows` of type
 `vector_sparse_generic` or whatever, and then move the
 `_nonzero_positions_by_row` down to the generic class.

 It would get rid of this code duplication, clean things up, etc.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/4648#comment:3>
Sage <http://sagemath.org/>
Sage - Open Source Mathematical Software: Building the Car Instead of 
Reinventing the Wheel
--~--~---------~--~----~------------~-------~--~----~
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