scalanlp / breeze

Breeze is a numerical processing library for Scala.
www.scalanlp.org
Apache License 2.0
3.44k stars 691 forks source link

CSCMatrix element-wise division bug #844

Closed pgimalac closed 2 years ago

pgimalac commented 2 years ago

Hello,

There is an issue with the element-wise division with CSCMatrix:

val a = CSCMatrix((1.0,0.0,0.0),(0.0,0.0,0.0),(1.0,0.0,0.0))
a /:/ a
3 x 3 CSCMatrix
(0,0) Infinity
(1,0) NaN
(2,0) 1.0
(0,1) NaN
(1,1) NaN
(2,1) NaN
(0,2) NaN
(1,2) NaN
(2,2) NaN

The value at index (0,0) should be 1.0 but is Infinity.

Scala version: 2.13.4 Breeze version: 2.0