companion: Generate Companion Matrices

Description Usage Arguments Details Value

View source: R/ddmatrix_special.r

Description

Methods for constructing companion matrices of an n-degree polynomial.

Usage

1
2
3
4
5
6
7
companion(
  coef,
  type = "matrix",
  ...,
  bldim = .pbd_env$BLDIM,
  ICTXT = .pbd_env$ICTXT
)

Arguments

coef

Vector of polynomial coefficients, listed in increasing order (by index; see details below).

type

"matrix" or "ddmatrix".

...

Additional arguments.

bldim

blocking dimension.

ICTXT

BLACS context number.

Details

For a degree n polynomial,

x^n + a_{n-1}x^{n-1} + … + a_1x + a_0

its associated companion matrix is a matrix of the form

≤ft[\begin{array}{cccccc} 0 & 0 & 0 & … & 0 & -a_0\\ 1 & 0 & 0 & … & 0 & -a_1\\ 0 & 1 & 0 & … & 0 & -a_2\\ \vdots & \vdots & \vdots & \ddots & \vdots & \vdots\\ 0 & 0 & 0 & … & 1 & -a_{n-1} \end{array}\right]

In the function call, we assume that the argument 'coef' is ordered from a_0 to a_{n-1}.

NOTE that we assume that the leading coefficient is 1.

Value

Returns a matrix or a distributed matrix.


RBigData/pbdDMAT documentation built on Oct. 29, 2021, 6:20 p.m.