The Solver struct
HomotopyContinuation.Solver
— TypeSolver(pathtracker::PathTracker)
A Solver
is a wrapper around a given pathtracker
to track multiple paths. It provides on top of the given pathtracker
parallelization and an optional path jumping check. To construct a Solver
it is convenient to use the solver
or solver_startsolutions
functions. Given a solver one can use the solve
function to solve a system. This struct is constructed for any call to solve
unless already explicitly provided.
Example
Assume we want to solve a polynomial system repeatedly for many different values of the parameters p
. The following example shows how to use a Solver
to avoid some computational overhead compared to naively calling solve
.
@polyvar x y z p[1:3]
F = [
x + 3 + 2y + 2 * y^2 - p[1],
(x - 2 + 5y) * z + 4 - p[2] * z,
(x + 2 + 4y) * z + 5 - p[3] * z,
]
q = randn(ComplexF64, 3)
S = solutions(solve(subs(F, p => q)))
# create some fake parameter values
params = [randn(3) for _ = 1:1000]
# create a `Solver` to reuse for the path tracking
F_solver = solver(F; parameters = p, generic_parameters = q)
# solve the system F for all paramaters p in params
params_solutions = map(params) do p
solutions(solve(F_solver, S; target_parameters = p))
end
HomotopyContinuation.solver
— FunctionHomotopyContinuation.solver_startsolutions
— Function