Reference
Input
We support any polynomials which follow the MultivariatePolynomials interface. By default we export the routines @polyvar
, PolyVar
, differentiate
and variables
from the DynamicPolynomials implementation. With these you can simply create variables
# Create variables x, y, z
@polyvar x y z
f = x^2+y^2+z^2
# You can also create an array of variables
@polyvar x[1:3] # This creates x1, x2, x3 accessed by x[1], x[2], x[3]
f = dot(x, x) # = x[1]^2+x[2]^2+x[3]^2
# Also you can create matrices of variables
# This creates x1_1, x1_2, x2_1, x2_2 accessed by
# x[1,1], x[1,2], x[2,1], x[2,2]
@polyvar x[1:2, 1:2]
Utilities
HomotopyContinuation.Utilities.ishomogenous
— Function.ishomogenous(f::MP.AbstractPolynomialLike)
Checks whether f
is homogenous.
ishomogenous(polys::Vector{MP.AbstractPolynomialLike})
Checks whether each polynomial in polys
is homogenous.
ishomogenous(f::MP.AbstractPolynomialLike, v::Vector{<:MP.AbstractVariable})
Checks whether f
is homogenous in the variables v
.
ishomogenous(polys::Vector{<:MP.AbstractPolynomialLike}, v::Vector{<:MP.AbstractVariable})
Checks whether each polynomial in polys
is homogenous in the variables v
.
HomotopyContinuation.Utilities.uniquevar
— Function.uniquevar(f::MP.AbstractPolynomialLike, tag=:x0)
uniquevar(F::Vector{<:MP.AbstractPolynomialLike}, tag=:x0)
Creates a unique variable.
HomotopyContinuation.Utilities.homogenize
— Function.homogenize(f::MP.AbstractPolynomial, variable=uniquevar(f))
Homogenize the polynomial f
by using the given variable variable
.
homogenize(F::Vector{<:MP.AbstractPolynomial}, variable=uniquevar(F))
Homogenize each polynomial in F
by using the given variable variable
.
homogenize(f::MP.AbstractPolynomial, v::Vector{<:MP.AbstractVariable}, variable=uniquevar(f))
Homogenize the variables v
in the polynomial f
by using the given variable variable
.
homogenize(F::Vector{<:MP.AbstractPolynomial}, v::Vector{<:MP.AbstractVariable}, variable=uniquevar(F))
Homogenize the variables v
in each polynomial in F
by using the given variable variable
.
AffinePatches
Affine patches are there to augment projective system such that they can be considered as (locally) affine system. By default the following patches are defined
OrthogonalPatch()
EmbeddingPatch()
Holds an AbstractProjectiveVector
onto its affine patch. With this the effect is basically the same as tracking in affine space.
RandomPatch()
A random patch. The vector has norm 1.
FixedPatch()
Interface
Each patch has to follow the following interface.
AbstractAffinePatch
An affine patch is a hyperplane defined by $v⋅x-1=0$.
HomotopyContinuation.AffinePatches.state
— Function.state(::AbstractAffinePatch, x)::AbstractAffinePatchState
Construct the state of the path from x
.
HomotopyContinuation.AffinePatches.precondition!
— Function.precondition!(v::AbstractAffinePatchState, x)
Modify both such that v
is properly setup and v⋅x-1=0
holds.
HomotopyContinuation.AffinePatches.update!
— Function.update_patch!(::AbstractAffinePatchState, x)
Update the patch depending on the local state.