I am conducting a dot product operation of two sparse vectors and found out that there is no separation between NA and 0.0. For example, the below code output is 0.0
val a = new SparseVector(Array(1, 2), Array(1.0, 1.0), 3)
val b = new SparseVector(Array(1, 2), Array(1.0, -1.0), 3)
a.dot(b)
However, I feel the below output should not be 0.0, but something else that can express there is no matching element. Any consideration for this case?
val a = new SparseVector(Array(1, 2), Array(1.0, 1.0), 3)
val b = new SparseVector(Array(0), Array(1.0), 3)
a.dot(b)
Sorry for being slow, but no, i don't like this. this would be quite different from how "normal" vectors work and I don't think other libraries do things like this?
I am conducting a dot product operation of two sparse vectors and found out that there is no separation between NA and 0.0. For example, the below code output is 0.0
However, I feel the below output should not be 0.0, but something else that can express there is no matching element. Any consideration for this case?