Closed bezineb5 closed 4 years ago
Looking at this now
Any new progress on this? Thanks.
My bad. SubScalar was broken and I was halfway fixing it and then life got in the way
Will be fixed tomorrow
There is some infelicities when UseUnsafe
is used.... looking into it and fixing it.
Here's a good example:
func TestIssue72(t *testing.T) {
a := New(FromScalar(3.14))
b := 0.0
bsa, err := Sub(b, a)
if err != nil {
t.Fatal(err)
}
t.Logf("%v", bsa)
ret, err := Sub(b, bsa, UseUnsafe())
if err != nil {
t.Fatal(err)
}
t.Logf("%v %v", ret, bsa)
}
Closing this, and using #73 instead.
Fix for #70 The issue was that the operation is performed in place on the first operand, but the output is passed as second operand. The solution was to always use the output as first operand, filling it with the scalar if needed.
I fear that the problem might still exist with iterators.