Description Usage Arguments Details Value Note See Also Examples
View source: R/SimplicialCubature.R
Utility functions to work with a multivariate polynomial.
1 2 3 |
coef |
a vector of coefficients, one for each term of p(x) |
k |
a matrix of (non-negative, integer) powers |
p |
a polynomial, defined by definePoly |
num.digits |
number of digits to print for the coefficients of the polynomial |
x |
a (n x m) matrix, with columns containing the vectors where the polynomial should be evaluated |
useTerm |
vector of boolean values: if useTerm[i]=TRUE, term i is included in the evaluation; if useTerm[i]=FALSE, term i is not included. |
These are utility functions for use with integrateSimplexPolynomial. definePoly is used to define a polynomial:
p(x)=sum(coef[i] * x[1]^k[i,1]* x[2]^k[i,2] * ... * x[n]^k[i,n]), where the sum is over i=1,...,length(coef).
printPoly prints a polynomial in human readable form.
evalPoly evaluates a polynomial at each of the vectors x[,1],x[,2],...,x[,m]. The optional argument useTerm is for internal use.
See example below.
For definePoly, a list is returned. That list can be used by integrateSimplexPolynomial, printPoly, or evalPoly.
For printPoly, nothing is returned, but a human readable format is printed on the console.
For evalPoly, a vector of m values: y[i] = p(x[,i]).
The internal definition of a polynomial may change in the future.
1 2 3 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.