Various functions to deal with mpoly and mpolyList objects.

is.constant(x)

is.mpoly(x)

is.unipoly(x)

is.bernstein(x)

is.bezier(x)

is.chebyshev(x)

is.mpolyList(x)

is.linear(x)

Arguments

x

object to be tested

Value

Vector of logicals.

Examples

p <- mp("5") is.mpoly(p)
#> [1] TRUE
is.constant(p)
#> [1] TRUE
is.constant(mp(c("x + 1", "7", "y - 2")))
#> [1] FALSE TRUE FALSE
p <- mp("x + y") is.mpoly(p)
#> [1] TRUE
is.mpolyList(mp(c("x + 1", "y - 1")))
#> [1] TRUE
is.linear(mp("0"))
#> [1] TRUE
is.linear(mp("x + 1"))
#> [1] TRUE
is.linear(mp("x + y"))
#> [1] TRUE
is.linear(mp(c("0", "x + y")))
#> [1] TRUE TRUE
is.linear(mp("x + x y"))
#> [1] FALSE
is.linear(mp(c("x + x y", "x")))
#> [1] FALSE TRUE
(p <- bernstein(2, 5))
#> 10 x^2 - 30 x^3 + 30 x^4 - 10 x^5
is.mpoly(p)
#> [1] TRUE
is.bernstein(p)
#> [1] TRUE
(p <- chebyshev(5))
#> 5 x - 20 x^3 + 16 x^5
is.mpoly(p)
#> [1] TRUE
is.chebyshev(p)
#> [1] TRUE
str(p)
#> List of 3 #> $ : Named num [1:2] 1 5 #> ..- attr(*, "names")= chr [1:2] "x" "coef" #> $ : Named num [1:2] 3 -20 #> ..- attr(*, "names")= chr [1:2] "x" "coef" #> $ : Named num [1:2] 5 16 #> ..- attr(*, "names")= chr [1:2] "x" "coef" #> - attr(*, "class")= chr [1:2] "chebyshev" "mpoly" #> - attr(*, "chebyshev")=List of 4 #> ..$ degree : num 0 #> ..$ kind : chr "t" #> ..$ indeterminate: chr "x" #> ..$ normalized : logi FALSE