Closed RobinHankin closed 5 years ago
Related problems:
> a
mvp object algebraically equal to
1 + x
> constant(a) <- 0
> a
mvp object algebraically equal to
0 + x
> dput(a)
structure(list(names = list(character(0), "x"), power = list(
integer(0), 1L), coeffs = c(0, 1)), class = "mvp")
This is a bug in constant<-.mvp()
: the value returned was not "cleaned" by mvp()
, so the returned value has a zero-coefficient term. It's a relatively benign bug because the extra term is mathematically equal to zero. But it causes problems with mvp_to_spray()
.
If there is a constant in a mvp object,
mvp_to_spray()
should work as expected, but returns an error:NB:
mvp_to_spray(as.mvp("x+y"))
works fine.