Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

lead

The leading coefficient of a polynom or polynomial matrix


Description

Returns the leading coefficients of the input polynom or polynomial matrix.

Usage

lead(p,method=c("matrix","column","row","element"))

Arguments

p

a polynomial or polyMatrix-package class object

method

controls the interpretation of the word: "leading", see the details

Details

The four possible interpretation of the lead for a polynomial matrix are:

  • matrix: the highest matrix coefficient of the polynomial matrix.

  • column: taken the polynomial matrix column-wise, the row vector of the highest coefficient of each column.

  • row: taken the polynomial matrix row-wise, the column vector of the highest coefficient of each row.

  • element: a matrix formed by the highest coefficients of the polynomial elements of the polynomial matrix.

Value

Returns a matrix by the same size as the polynomial matrix.

See Also

Examples

lead(polynom::polynomial(0:12))
pm <- polyMgen.a()
pa <- polyMconvert(pm,"polyMarray")
pb <- polyMconvert(pm,"polyMbroad")
pc <- polyMconvert(pm,"polyMcells")
pd <- polyMconvert(pm,"polyMdlist")
lead(pa)
lead(pb)
lead(pc)
lead(pd)

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

# clean up
# rm(rawAdat)

px

lead(px)
lead(px,method="matrix")
lead(px,method="row")
lead(px,method="column")
lead(px,method="element")

# clean up
# rm(pm, pa, pb, pc, pd, px)

polyMatrix

Infrastructure for Manipulation Polynomial Matrices

v0.3.1
MIT + file LICENSE
Authors
Tamas Prohle [aut], Peter Prohle [aut], Nikolai Ryzhkov [aut, cre], Ildiko Laszlo [aut] (<https://orcid.org/0000-0003-2324-8183>), Ulas Onat Alakent [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.