Learn R Programming

polyMatrix (version 0.3.1)

degree: The degree of a polynomial or a polynomial matrix

Description

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

Usage

degree(p, ...)

Arguments

p

a polynomial or polyMatrix class object

supplementary options (see degree.polyMatrix)

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 in case of method="matrix" the value is a matrix by the same size as the input, containing the degrees of the polynomials. In case of method="column" or ="row" the value are maximums of the columns or rows of the polynom matrix degrees. In case of method="default" it is the maximum of the degree of all polynoms.

See Also

lead, degree.polyMatrix, degree.polynomial

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