Learn R Programming

polyMatrix (version 0.3.1)

degree.polyMatrix: The degree of a polynomial or a polynomial matrix

Description

The degree of the highest non-zero coefficient of the given polynomials.

Usage

# S3 method for polynomial
degree(p, …)
  # S3 method for polyMatrix
degree(p, …)

Arguments

p

a polynomial or polyMatrix class object

~~~~

Value

When the input is a polynomial class object, then value is the degree of the polynom.

When the input is a polyMatrix class object, then is the maximum of the degree of all polynoms.

Method degree_matrix returns a matrix by the same size as the input, containing the degrees of the polynomials.

And methods degree_column and degree_row returns of the columns or rows of the polynom matrix degrees.

See Also

lead

Examples

Run this code
# NOT RUN {
p <- polynom::polynomial(0:12)
class(p) # polynom
degree(p)

pM <- polyMgen.d(3,3,rawData=ch2pn(c(
    "-3+x^3", "2+4*x",  "x^2",
         "1",     "2", "3+x",
       "2*x",     "0", "2-3*x"
)))
pM

degree(pM) #  the maximum degree
degree(pM,"c") # column wise maximum degree
degree(pM,"r") # row wise maximum degree
degree(pM,"m") # matrix: element wise degree

degree(polyMconvert(pM,"polyMarray"),"m") # polyMarray class
degree(polyMconvert(pM,"polyMbroad"),"m") # polyMbroad class
degree(polyMconvert(pM,"polyMcells"),"m") # polyMcells class
degree(polyMconvert(pM,"polyMdlist"),"m") # polyMdlist class

# clean up
# rm(p, pM)
# }

Run the code above in your browser using DataLab