> a <- rform()
> a + 6
Error in Ops.kform(a, 6) :
Binary operator '+' is not implemented for kform <op> other
> coeffs(a) <- coeffs(a)/2
> a + 6
val
1 2 4 = 0.5
3 5 6 = 1.0
0 0 0 = 6.0
1 6 7 = 4.5
1 3 5 = 5.5
4 5 7 = -2.0
3 4 6 = -2.5
1 3 4 = 3.0
4 6 7 = 3.5
>
Above, the first call to a+6 gives an error as it should, but the second one does not give an error: after coeffs(a) <- coeffs(a)/2, object a is a spray object and has lost its kform class. So a+6 is interpreted as a spray addition of sparse arrays.
Look:
Above, the first call to
a+6
gives an error as it should, but the second one does not give an error: aftercoeffs(a) <- coeffs(a)/2
, objecta
is aspray
object and has lost itskform
class. Soa+6
is interpreted as aspray
addition of sparse arrays.