(^-^) is implemented using unionWith from the Map data type. This is wrong, because if the matrices have disjoint indices, then the function (-) is never used, and the values are simply copied.
The default implementation (x ^+^ negateV y) is correct.
(^-^)
is implemented usingunionWith
from theMap
data type. This is wrong, because if the matrices have disjoint indices, then the function(-)
is never used, and the values are simply copied.The default implementation (
x ^+^ negateV y
) is correct.(^-^)
is implemented here: https://github.com/ocramz/sparse-linear-algebra/blob/c2f26735d95c742ccc0e33160c7c29910fdb9410/src/Data/Sparse/SpMatrix.hs#L88