# [SciPy-dev] sparse comments and questions

Peter Skomoroch peter.skomoroch@gmail....
Fri Jul 13 13:36:51 CDT 2007

```Nathan,

Thanks for putting this in, I'll give it a try.

-Pete

On 7/13/07, Nathan Bell <wnbell@gmail.com> wrote:
>
> On 7/9/07, Peter Skomoroch <peter.skomoroch@gmail.com> wrote:
> > In Matlab and some C++ libraries, I've used the following "sparse
> division"
> > functionality :
> >
> > When you attempt to divide one sparse matrix by another of the same
> size,
> > return the result of elementwise division of the entries in the
> matrices.
> > This assumes that the two input matrices have the same sparsity
> structure.
> >
> > This is useful when implementing some algorithms like NMF using sparse
> > matrices.  Right now in scipy, only division of a sparse matrix by a
> scalar
> > is supported.
>
> I've added support for elementwise division in the latest SVN.  I
> designed it so you get the same result as a dense A/B on the union of
> the sparsity structures.  For example, if A[i.j] is nonzero while
> B[i.j] is zero, you get +/- inf.  If A[i,j] is zero while B[i,j] is
> nonzero you'll get an implicit 0 in the result (i.e. it will not
> appear in the output matrix).  This holds true for explicit zeros in
> the matrices as well.  I think this is the most faithful analog of the
> dense case.
>
> Let me know if you discover any problems.
>
> --
> Nathan Bell wnbell@gmail.com
> _______________________________________________
> Scipy-dev mailing list
> Scipy-dev@scipy.org
> http://projects.scipy.org/mailman/listinfo/scipy-dev
>

--
Peter N. Skomoroch
peter.skomoroch@gmail.com
http://www.datawrangling.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/scipy-dev/attachments/20070713/710d6aa5/attachment.html
```