[SciPy-dev] sparse deletion and sparse random matrices.

Viral Shah vshah@interactivesupercomputing....
Sat Apr 19 12:31:52 CDT 2008


>> The two things I believe could be immediately useful are some simple
>> routines for deleting rows and columns, and routines to create sparse
>> random matrices. The latter would be greatly useful for examples,
>> exploration, debugging etc.
>>
>> The routines might look something like below. If there's interest, I
>> can help with whatever needs to be done to put them in the tree:
>
> sprand() would be useful however deleterowcol() is too special  
> purpose IMO.

I meant that something like deleterowcol() could be used to implement  
the delete() routines for sparse matrices. Currently, you can't delete  
rows/cols from sparse matrices. I believe it is basic functionality  
that would be nice to have, even if early implementations were not the  
best.

> Two comments on your sprand()
> 1) leads to values outside [0,1) when an (i,j) entry occured more  
> than once.

You are right. I did find that bug earlier this week, and fixed it.

> 2) fix(rand()) may be better implemented with  
> numpy.random.random_integers()

Still familiarizing myself with all the stuff thats in numpy. That  
would definitely be a better function to use.

> With a docstring + unittests this would make a nice addition to
> sparse/construct.py

Ok, I will dig into the source and figure out what all needs to be  
done to put this in.

Thanks,

-viral





More information about the Scipy-dev mailing list