William Stein wrote:
> On Tue, Jun 2, 2009 at 7:22 PM, davidp <dav...@reed.edu> wrote:
>> I tried adding a delete_row method to matrix_integer_sparse.pyx but
>> stopped after getting the error message:
> 
> Just def your method -- do not cpdef it.  You can still use Cython
> code in a cpdef's method and it will be just as fast.
> 
> Make sure that your "delete row" method returns a *new* matrix by the way...


You might fold your functionality into matrix_from_rows_and_columns. 
That way slicing will automatically use it.

Maybe you could intelligently guess from the rows and columns requested 
whether it is faster to just copy the matrix, then delete some 
rows/columns, or to build the new matrix up.  For example, if I'm asking 
for every row and column in the matrix except one, almost surely it is 
faster to copy the dictionary and delete the appropriate row/column keys.

Then again, I can see the advantage of just having a delete_rows or 
delete_columns method; it's definitely clear what you are doing.

Jason


--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to