Learn R Programming

polyMatrix (version 0.3.1)

pVsk: The scalar product of two polynomial vectors

Description

If pMy is NULL, then the result is the sum of squares of the elements of pMx. Otherwise equals the scalar product ot the two given polynomial vectors.

Usage

pVsk(pMx, pMy=NULL)

Arguments

pMx

a polyMatrix class row or column vector

pMy

a polyMatrix class row or column vector

Value

A polynomial class object, which is the sum of the elementwise product of the two vectors.

Details

The two vectors must have the same length.

See Also

pMprod

Examples

Run this code
# NOT RUN {
A <- polyMgen.d(2,2,rawData=ch2pn(c("-3","2+4*z","-z^2","1"),"z"))
A

pMcol(A,1) # ("-3" , "2 + 4*x")
pVsk(pMcol(A,1)) # "13 + 16*x + 16*x^2"

pMrow(A,2) # ("2 + 4*x" , "1")
pVsk(pMcol(A,1),pMrow(A,2)) # "-4 - 8*x"

# clean up
# rm(A)
# }

Run the code above in your browser using DataLab