Polynomial

Types

Polynomial(p::MultivariatePolynomials.AbstractPolynomial [, variables [, homogenized=false]])

A structure for fast evaluation of multivariate polynomials. The terms are sorted first by total degree, then lexicographically. Polynomial has first class support for homogenous polynomials. This field indicates whether the first variable should be considered as the homogenization variable.

Polynomial{T}(p::MultivariatePolynomials.AbstractPolynomial [, variables [, homogenized=false]])

You can force a coefficient type T. For optimal performance T should be same type as the input to with which it will be evaluated.

Polynomial(exponents::Matrix{Int}, coefficients::Vector{T}, variables, [, homogenized=false])

You can also create a polynomial directly. Note that in exponents each column represents the exponent of a term.

Example

Poly([3 1; 1 1; 0 2 ], [-2.0, 3.0], [:x, :y, :z]) == 3.0x^2yz^2 - 2x^3y
source

Accessors

exponents(p::Polynomial)

Returns the exponents matrix of p. Each column represents the exponents of a term of p.

source
coefficients(p::Polynomial)

Returns the coefficient vector of p.

source
nterms(p::Polynomial)

Returns the number of terms of p

source
variables(p::Polynomial)

Returns the variables of p.

source
nvariables(p::Polynomial)

Returns the number of variables of p

source
degree(p::Polynomial)

Returns the (total) degree of p.

source
ishomogenous(p::Polynomial)

Checks whether p is a homogenous polynomial. Note that this is unaffected from the value of homogenized(p).

source
ishomogenized(p::Polynomial)

Checks whether p was homogenized.

source

Modification

differentiate(p::Polynomial, varindex::Int)

Differentiate p w.r.t the varindexth variable.

differentiate(p::Polynomial)

Differentiate p w.r.t. all variables.

source
FixedPolynomials.∇Function.
∇(p::Polynomial)

Returns the gradient vector of p. This is the same as differentiate.

source
homogenize(p::Polynomial [, variable = :x0])

Makes p homogenous, if ishomogenized(p) is true this is just the identity. The homogenization variable will always be considered as the first variable of the polynomial.

source
dehomogenize(p::Polynomial)

Substitute 1 as for the first variable p, if ishomogenized(p) is false this is just the identity.

source
scale_coefficients!(f::Polynomial, λ)

Scale the coefficients of f with the factor λ.

source

Misc

weyldot(f::Polynomial, g::Polynomial)

Compute the Bombieri-Weyl dot product. Note that this is only properly defined if f and g are homogenous.

weyldot(f::Vector{Polynomial}, g::Vector{Polynomial})

Compute the dot product for vectors of polynomials.

source
weylnorm(f::Polynomial)

Compute the Bombieri-Weyl norm. Note that this is only properly defined if f is homogenous.

source