Learn R Programming

polyMatrix (version 0.3.1)

constConv: Conversion of constant matrices

Description

Conversion between the 'matrix' and 'polyMatrix' class representation of constant matrices.

Usage

M2pM(m, class=CLASS_MARRAY)
  pM2M(pM)

Arguments

m

a matrix class object

class

the required class of the value: CLASS_MARRAY, CLASS_MBROAD, CLASS_MCELLS, and CLASS_MDLIST

pM

a polyMatrix class object

Value

The M2pM(m) returns the given 'm' matrix in 'polyMatrix' class form. The pM2M(pM) returns the given 'pM' polynomial matrix in 'matrix' class form, if it is a constant matrix, otherwise gives an error message.

Details

M2pM converts the matrix class objets to an polyMatrix class object. pM2M converts the zero degree polyMatrix class objects to an matrix object.

See Also

coefs, lead, degree

Examples

Run this code
# NOT RUN {
m <- matrix(1:12, 3,4)
m
pM <- M2pM(m)
class(pM)
pM

M2pM(m, "polyMarray")
M2pM(m, "polyMbroad")
M2pM(m, "polyMcells")
M2pM(m, "polyMdlist")

# clean up
# rm(m, pM)

# }

Run the code above in your browser using DataLab