Closed karenfeng closed 4 years ago
@karenfeng So, unfortunately the DenseMatrix class isn't a case class
, so a == b
will return false because its comparing the instances instead of the value.
I'd say just compare the toString values of the matrices, unfortunately.
@aliakhtar that's not right. DenseMatrix implements equals.
I'm surprised a bug like this is still present. I will try to fix soon.
Hi - this is also a pressing issue for us. What is the best workaround for using .copy? Is this fixed?
I am using Scala 2.12.0
fixed in 2d0c483d63011b816c72be549f4f5390cd07550a. dumb bug . I'll push a release tomorrow (Sunday 8/2)
Thanks a lot!
(released 1.1)
The following assertion is false. Is this the intended behavior of the copy functionality?
Above, the string value of
sm
is as expected,9.0 10.0
. Unexpectedly, the string value ofsm.copy
is1.0 2.0
. It appears that the underlying array data is not copied properly:sm.data == Array(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0)
andsm.copy.data == Array(1.0, 2.0)
.