FixedPolynomials.GradientConfigType
GradientConfig(f::Polynomial{T}, [x::AbstractVector{S}])

A data structure with which the gradient of a Polynomialf can be evaluated efficiently. Note that x is only used to determine the output type of f(x).

GradientConfig(f::Polynomial{T}, [S])

Instead of a vector x a type can also be given directly.

FixedPolynomials.GradientDiffResultType
GradientDiffResult(cfg::GradientConfig)

During the computation of $∇g(x)$ we compute nearly everything we need for the evaluation of $g(x)$. GradientDiffResult allocates memory to hold both values. This structure also signals gradient! to store $g(x)$ and $∇g(x)$.

Example

cfg = GradientConfig(g, x)
r = GradientDiffResult(cfg)
gradient!(r, g, x, cfg)

value(r) == g(x)
gradient(r) == gradient(g, x, cfg)
GradientDiffResult(grad::AbstractVector)

Allocate the memory to hold the gradient by yourself.

FixedPolynomials.JacobianConfigType
JacobianConfig(F::Vector{Polynomial{T}}, [x::AbstractVector{S}])

A data structure with which the jacobian of a VectorF of Polynomials can be evaluated efficiently. Note that x is only used to determine the output type of F(x).

JacobianConfig(F::Vector{Polynomial{T}}, [S])

Instead of a vector x a type can also be given directly.

FixedPolynomials.JacobianDiffResultType
JacobianDiffResult(cfg::GradientConfig)

During the computation of the jacobian $J_F(x)$ we compute nearly everything we need for the evaluation of $F(x)$. JacobianDiffResult allocates memory to hold both values. This structure also signals jacobian! to store $F(x)$ and $J_F(x)$.

Example

cfg = JacobianConfig(F, x)
r = JacobianDiffResult(cfg)
jacobian!(r, F, x, cfg)

value(r) == map(f -> f(x), F)
jacobian(r) == jacobian(F, x, cfg)
JacobianDiffResult(value::AbstractVector, jacobian::AbstractMatrix)

Allocate the memory to hold the value and the jacobian by yourself.

FixedPolynomials.PolynomialType
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
FixedPolynomials.SystemType
System(polys [, variables])

Construct a system of polynomials from the given polynomials polys.

FixedPolynomials.configMethod
config(F::Polynomial, x)

Construct a GradientConfig for the evaluation of f with values like x.

FixedPolynomials.configMethod
config(F::System, x)

Construct a JacobianConfig for the evaluation of F with values like x.

FixedPolynomials.dehomogenizeMethod
dehomogenize(p::Polynomial)

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

FixedPolynomials.differentiateMethod
differentiate(p::Polynomial, varindex::Int)

Differentiate p w.r.t the varindexth variable.

differentiate(p::Polynomial)

Differentiate p w.r.t. all variables.

FixedPolynomials.evaluate!Function
evaluate!(u, F, x, cfg::JacobianConfig [, precomputed=false])

Evaluate the system F at x using the precomputated values in cfg and store the result in u. Note that this is usually signifcant faster than map!(u, f -> evaluate(f, x), F).

Example

cfg = JacobianConfig(F)
evaluate!(u, F, x, cfg)

With precomputed=true we rely on the previous intermediate results in cfg. Therefore the result is only correct if you previouls called evaluate, or jacobian with the same x.

FixedPolynomials.evaluateMethod
evaluate(g, x, cfg::GradientConfig [, precomputed=false])

Evaluate g at x using the precomputated values in cfg. Note that this is usually signifcant faster than evaluate(g, x).

Example

cfg = GradientConfig(g)
evaluate(g, x, cfg)

With precomputed=true we rely on the previous intermediate results in cfg. Therefore the result is only correct if you previouls called evaluate, or gradient with the same x.

FixedPolynomials.evaluateMethod
evaluate(F, x, cfg::JacobianConfig [, precomputed=false])

Evaluate the system F at x using the precomputated values in cfg. Note that this is usually signifcant faster than map(f -> evaluate(f, x), F). The return vector is constructed using similar(x, T).

Example

cfg = JacobianConfig(F)
evaluate(F, x, cfg)

With precomputed=true we rely on the previous intermediate results in cfg. Therefore the result is only correct if you previouls called evaluate, or jacobian with the same x.

FixedPolynomials.evaluateMethod
evaluate(p::Polynomial{T}, x::AbstractVector{T})

Evaluates p at x, i.e. $p(x)$. Polynomial is also callable, i.e. you can also evaluate it via p(x).

FixedPolynomials.evaluate_and_jacobian!Method
evaluate_and_jacobian!(u, U, F, x, cfg::JacobianConfig)

Evaluate F and its Jacobian at x using the precomputated values in cfg and store the result in u and U (Jacobian).

Example

evaluate_and_jacobian!(u, U, F, x, config(F, x))
FixedPolynomials.exponentsMethod
exponents(p::Polynomial)

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

FixedPolynomials.gradient!Method
gradient!(u, g, x, cfg::GradientConfig [, precomputed=false])

Compute the gradient of g at x using the precomputated values in cfg and store thre result in u.

Example

cfg = GradientConfig(g)
gradient(u, g, x, cfg)

With precomputed=true we rely on the previous intermediate results in cfg. Therefore the result is only correct if you previouls called evaluate, or gradient with the same x.

FixedPolynomials.gradient!Method
gradient!(r::GradientDiffResult, g, x, cfg::GradientConfig)

Compute $g(x)$ and the gradient of g at x at once using the precomputated values in cfg and store thre result in r. This is faster than calling both values separetely.

Example

cfg = GradientConfig(g)
r = GradientDiffResult(r)
gradient!(r, g, x, cfg)

value(r) == g(x)
gradient(r) == gradient(g, x, cfg)
FixedPolynomials.homogenizeFunction
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.ishomogenousMethod
ishomogenous(p::Polynomial)

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

FixedPolynomials.jacobian!Function
jacobian!(u, F, x, cfg::JacobianConfig [, precomputed=false])

Evaluate the jacobian of F at x using the precomputated values in cfg and store the result in u.

Example

cfg = JacobianConfig(F)
jacobian!(u, F, x, cfg)

With precomputed=true we rely on the previous intermediate results in cfg. Therefore the result is only correct if you previouls called evaluate, or jacobian with the same x.

FixedPolynomials.jacobian!Method
jacobian!(r::JacobianDiffResult, F, x, cfg::JacobianConfig)

Compute $F(x)$ and the jacobian of F at x at once using the precomputated values in cfg and store thre result in r. This is faster than computing both values separetely.

Example

cfg = GradientConfig(g)
r = GradientDiffResult(cfg)
gradient!(r, g, x, cfg)

value(r) == g(x)
gradient(r) == gradient(g, x, cfg)
FixedPolynomials.jacobianMethod
jacobian(u, F, x, cfg::JacobianConfig [, precomputed=false])

Evaluate the jacobian of F at x using the precomputated values in cfg. The return matrix is constructed using similar(x, T, m, n).

Example

cfg = JacobianConfig(F)
jacobian(F, x, cfg)

With precomputed=true we rely on the previous intermediate results in cfg. Therefore the result is only correct if you previouls called evaluate, or jacobian with the same x.

FixedPolynomials.substituteMethod
substitute(p::Polynomial, i, x)

In p substitute for the variable with index i the value x. You can use this for partial evaluation of polynomial.

Example

julia> substitute(x^2+3y, 2, 5)
x^2+15
FixedPolynomials.weyldotMethod
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.gradientMethod
gradient(g, x, cfg::GradientConfig[, precomputed=false])

Compute the gradient of g at x using the precomputated values in cfg. The return vector is constructed using similar(x, T).

Example

cfg = GradientConfig(g)
gradient(g, x, cfg)

With precomputed=true we rely on the previous intermediate results in cfg. Therefore the result is only correct if you previouls called evaluate, or gradient with the same x.

FixedPolynomials.gradient_row!Method
gradient_row!(u::AbstractMatrix, x::AbstractVector, cfg::PolyConfig{T}, i)

Store the gradient in the i-th row of 'u'.