Types
FixedPolynomials.Polynomial
— Type.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
Accessors
FixedPolynomials.exponents
— Function.exponents(p::Polynomial)
Returns the exponents matrix of p
. Each column represents the exponents of a term of p
.
FixedPolynomials.coefficients
— Function.coefficients(p::Polynomial)
Returns the coefficient vector of p
.
FixedPolynomials.nterms
— Function.nterms(p::Polynomial)
Returns the number of terms of p
FixedPolynomials.variables
— Function.variables(p::Polynomial)
Returns the variables of p
.
FixedPolynomials.nvariables
— Function.nvariables(p::Polynomial)
Returns the number of variables of p
FixedPolynomials.degree
— Function.degree(p::Polynomial)
Returns the (total) degree of p.
FixedPolynomials.ishomogenous
— Function.ishomogenous(p::Polynomial)
Checks whether p
is a homogenous polynomial. Note that this is unaffected from the value of homogenized(p)
.
FixedPolynomials.ishomogenized
— Function.ishomogenized(p::Polynomial)
Checks whether p
was homogenized.
Modification
FixedPolynomials.differentiate
— Function.differentiate(p::Polynomial, varindex::Int)
Differentiate p
w.r.t the varindex
th variable.
differentiate(p::Polynomial)
Differentiate p
w.r.t. all variables.
FixedPolynomials.∇
— Function.∇(p::Polynomial)
Returns the gradient vector of p
. This is the same as differentiate
.
FixedPolynomials.homogenize
— Function.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.
FixedPolynomials.dehomogenize
— Function.dehomogenize(p::Polynomial)
Substitute 1
as for the first variable p
, if ishomogenized(p)
is false
this is just the identity.
FixedPolynomials.scale_coefficients!
— Function.scale_coefficients!(f::Polynomial, λ)
Scale the coefficients of f
with the factor λ
.
Misc
FixedPolynomials.weyldot
— Function.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.
FixedPolynomials.weylnorm
— Function.weylnorm(f::Polynomial)
Compute the Bombieri-Weyl norm. Note that this is only properly defined if f
is homogenous.