Generate a polyMatrix class polynomial matrix
A complex tool to generate a polynomial matrix in ‘polyMatrix’ form.
The ‘polyMatrix’ object contains the following three
invariant elements: the $dim, $degree and $symb
independently of the sub-class of the object.
The $dim is the size of the matrix.
The $degree is a matrix of non-negetive numbers, the degree of the
polynomial elements of the polynomial matrix.
The $symb the symbol to print and identify the reference to
the algebraic set over which the polynom defined – sorry, this option
not fully works.
polyMgen(nrow,ncol,rawData,symb,rand,degree,byrow,sm="polyMarray",...)
nrow |
the desired number of rows |
ncol |
the desired number of columns |
degree |
the desired degrees of polynomials when it is filled randomly |
rawData |
the data to fill with the polynomial matrix.
In case of |
symb |
the desired polynom symbol |
rand |
the name of the random generator used to generate the coefficients of a random polynomial matrix |
byrow |
logical. If |
sm |
storage method: |
... |
additional arguments |
The four possible methods to generate the polynomial matrix from the given material rawData or (the default) or random values:
‘array’, when the coefficient matrices of the polinomial matrix are stored in two
independent element of the list of the polyMatrix: the constant matrix in
$const, and the coefficients of the first, second... degree of the polynomial
in the first, second,... element of the $array.
In this case the sub-class of the generated polyMatrix object is polyMarray.
‘broad-matrix’,
when the coefficients are stored in one broad matrix in the $broad
element of the polyMatrix object.
The size of this broad matrix is: nrow x (ncol*(d+1)),
when the degree of the nrow x ncol size polynomial matrix is d.
In this case the sub-class of the generated polyMatrix object is polyMbroad.
‘list of cells’, when the nrow x ncol size coefficient matrices are stored
in d+1 element of the $cells list element of the polyMatrix object.
In this case the sub-class of the generated polyMatrix object is polyMcells.
‘double list’, when the elements of the polynomial matrix are stored in the form
of polynomial class objects in a nrow x ncol element double list.
In this case the sub-class of the generated polyMatrix object is polyMdlist.
A polyMatrix class object with a sub-class polyMarray, polyMbroad, polyMcells or polyMdlist.
polyMgen.a() # default size & coefficients & rank
polyMgen.a(2,3,1:6) # given coefficients & default rank
polyMgen.a(2,3,1:6,degree=1) # given coefficients & rank
polyMgen.a(2,3,1:36,degree=matrix(0:5,2,3)) # given coefficients & ranks
polyMgen.a(2,3,1:12,degree=matrix(2:0,2,3)) # given coefficients & ranks
polyMgen.a(rand=TRUE) # normally distributed coefficients
polyMgen.a(rand=rexp) # exponentially distributed coefficients
pois.vg.fv <- function(x) rpois(x,1)
polyMgen.a(rand=pois.vg.fv) # Poisson(1) distributed coefficients
rm(pois.vg.fv)
polyMgen.b() # class="polyMbroad", broad matrix form
polyMgen.c() # class="polyMcells", list of coefficient matrices
polyMgen.d() # class="polyMdlist", dubble list
polyMgen.d(2,2,
rawData=list(polynom::polynomial(1),
polynom::polynomial(c(0,0,1)),
polynom::polynomial(c(0,1)),
polynom::polynomial(0)))
px <- polyMgen.d(3,3,rawData=ch2pn(
c("-3 + z^2","2 + 4*z","-z^2",
"1","2","3 + z",
"2*z","0","2 - 3*z"),"z"))
class(px) # "polyMdlist" "polyMatrix"
px
px <- polyMgen.d(3,3,rawData=ch2pn(
c("-3 + z^2","2 + 4*z","-z^2",
"1","2","3 + z",
"2*z","0","2 - 3*z"),"z"),byrow=TRUE)
class(px) # "polyMdlist" "polyMatrix"
px
polyMgen.d()
polyMgen.d(rand=TRUE)
polyMgen.d(rand=TRUE,degree=2)
polyMgen.d(degree=3)
polyMgen.d(degree=NULL)
# clean up
# rm(px)Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.