Closed RobinHankin closed 5 years ago
A better example, showing (I think) that there is an allocation issue:
> a <- as.mvp(mp("1+x"))
> a*(a*a)
mvp object algebraically equal to
coef + 2 x + x^2 + 6.896486e-314 x^3
>
After more thought, this issue must be dealt with on the C side, because of the possibility that two mvp
objects, both of which have zero constant term might have a product with a nonzero constant term.
didn't mean to close this, reopening as it is not resolved
It's not just the constant:
> a <- as.mvp(mp("x+y"))
> (a*a)*a
mvp object algebraically equal to
4 x y^2 + 5 x^2 y + 2 x^3 + y^3
> a*(a*a)
mvp object algebraically equal to
x y^2 + 2 x^2 y + x^3 + 7.0374e-314 y^3
>
So there is something deeply deeply wrong somewhere
currently broken:
Currently weighing up whether it is better to deal with the constant one the C side or the R side. Probably the R side is easier to deal with, without breaking the nice use of the STL