Results
A call to solve returns a Result:
HomotopyContinuation.Result — TypeResultThe result of solve. This is a wrapper around the results of each single path (PathResult) and it contains some additional information like a random seed to replicate the result.
HomotopyContinuation.seed — Methodseed(::Result)Returns the seed to replicate the result.
HomotopyContinuation.path_results — Methodpath_results(::Result)Returns the stored PathResults.
Filtering results and solutions
HomotopyContinuation.results — Functionresults(
result;
only_real = false,
real_tol = 1e-6,
only_nonsingular = false,
only_singular = false,
only_finite = true,
multiple_results = false,
)
results(f, result; options...)Return all PathResults for which satisfy the given conditions and apply, if provided, the function f.
results(result::MonodromyResult)Returns the computed PathResults.
results(W::WitnessSet)Get the results stored in W.
HomotopyContinuation.solutions — Functionsolutions(result; only_nonsingular = true, conditions...)Returns all solutions for which the given conditions apply, see results for the possible conditions.
Example
julia> @var x y
julia> F = System([(x-2)y, y+x+3]);
julia> solutions(solve(F))
2-element Array{Array{Complex{Float64},1},1}:
[2.0 + 0.0im, -5.0 + 0.0im]
[-3.0 + 0.0im, 0.0 + 0.0im]solutions(result::MonodromyResult)Return all solutions.
solutions(W::WitnessSet)Get the solutions stored in W.
Base.real — Methodreal(result, tol=1e-6)Get all results where the solutions are real with the given tolerance tol. See is_real for details regarding the determination of 'realness'.
HomotopyContinuation.real_solutions — Functionreal_solutions(result; tol=1e-6, conditions...)Return all real solution for which the given conditions apply. For the possible conditions see results. Note that only_real is always true and real_tol is now tol.
Example
julia> @var x y;
julia> F = System([(x-2)y, y+x+3]);
julia> real_solutions(solve(F))
2-element Array{Array{Float64,1},1}:
[2.0, -5.0]
[-3.0, 0.0]HomotopyContinuation.nonsingular — Functionnonsingular(result; conditions...)Return all PathResults for which the solution is non-singular. This is just a shorthand for results(R; only_nonsingular=true, conditions...). For the possible conditions see results.
HomotopyContinuation.singular — Functionsingular(result; multiple_results=false, kwargs...)Return all [PathResult]s for which the solution is singular. If multiple_results=false only one point from each cluster of multiple solutions is returned. If multiple_results = true all singular solutions in R are returned. For the possible kwargs see results.
HomotopyContinuation.at_infinity — Functionat_infinity(result)Get all results where the solutions is at infinity.
HomotopyContinuation.failed — Functionfailed(result)Get all results where the path tracking failed.
Counting
HomotopyContinuation.nresults — Functionnresults(
result;
only_real = false,
real_tol = 1e-6,
only_nonsingular = false,
only_singular = false,
only_finite = true,
multiple_results = false,
)Count the number of results which satisfy the corresponding conditions. See also results.
nresults(result::MonodromyResult)Returns the number of results computed.
HomotopyContinuation.nsolutions — Functionnsolutions(result; only_nonsingular = true, options...)The number of solutions. See results for the possible options.
nsolutions(result::MonodromyResult)Returns the number solutions of the result.
HomotopyContinuation.nreal — Functionnreal(result; tol=1e-6)The number of real solutions. See also is_real.
HomotopyContinuation.nnonsingular — Functionnnonsingular(result)The number of non-singular solutions. See also is_singular.
HomotopyContinuation.nsingular — Functionnsingular(
result;
counting_multiplicities = false,
kwargs...,
)The number of singular solutions. A solution is considered singular if its winding number is larger than 1 or the condition number is larger than tol. If counting_multiplicities=true the number of singular solutions times their multiplicities is returned.
HomotopyContinuation.nat_infinity — Functionnat_infinity(result)The number of solutions at infinity.
HomotopyContinuation.nexcess_solutions — Functionnexcess_solutions(result)The number of exess solutions. See also excess_solution_check.
HomotopyContinuation.nfailed — Functionnfailed(result)The number of failed paths.
PathResult
HomotopyContinuation.PathResult — TypePathResultA PathResult is the result of tracking of a path with track using an AbstractPathTracker ( e.g. EndgameTracker)
Fields
General solution information:
return_code: See the list of return codes below.solution::V: The solution vector.t::Float64: The value oftat whichsolutionwas computed. Note that ifreturn_codeis:at_infinity, thentis the value when this was decided.accuracy::Float64: An estimate the (relative) accuracy of the computed solution.residual::Float64: The infinity norm ofH(solution,t).condition_jacobian::Float64: This is the condition number of the Jacobian at the solution. A high condition number indicates a singular solution or a solution on a positive dimensional component.singular::Bool: Whether the solution is considered singular.winding_number:Union{Nothing, Int}: The computed winding number. This is a lower bound on the multiplicity of the solution. It is $nothing$ if the Cauchy endgame was not used.extended_precision::Bool: Indicate whether extended precision is necessary to achieve the accuracy of thesolution.path_number::Union{Nothing,Int}: The number of the path (optional).start_solution::Union{Nothing,V}: The start solution of the path (optional).
Performance information:
accepted_steps::Int: The number of accepted steps during the path tracking.rejected_steps::Int: The number of rejected steps during the path tracking.extended_precision_used::Bool: Indicates whether extended precision was necessary to track the path.
Additional path and solution informations
valuation::Vector{Float64}: An approximation of the valuation of the Puiseux series expansion of $x(t)$.last_path_point::Tuple{V,Float64}: The last pair $(x,t)$ before the solution was computed. If the solution was computed with the Cauchy endgame, then the pair $(x,t)$ can be used to rerun the endgame.
Return codes
Possible return codes are:
:success: TheEndgameTrackerobtained a solution.:at_infinity: TheEndgameTrackerstopped the tracking of the path since it determined that that path is diverging towards infinity.:at_zero: TheEndgameTrackerstopped the tracking of the path since it determined that that path has a solution where at least one coordinate is 0. This only happens if the optionzero_is_at_infinityistrue.:excess_solution: For the solution of the system, the system had to be modified which introduced artificial solutions and this solution is one of them.- various return codes indicating termination of the tracking
HomotopyContinuation.solution — Methodsolution(r::PathResult)Get the solution of the path.
HomotopyContinuation.is_success — Methodis_success(r::PathResult)Checks whether the path is successfull.
HomotopyContinuation.is_at_infinity — Methodis_at_infinity(r::PathResult)Checks whether the path goes to infinity.
HomotopyContinuation.is_excess_solution — Methodis_excess_solution(r::PathResult)Checks whether gives an excess solution that was artificially introduced by the homotopy continuation from the modified system.
HomotopyContinuation.is_failed — Methodis_failed(r::PathResult)Checks whether the path failed.
HomotopyContinuation.is_finite — Methodis_finite(r::PathResult)Checks whether the path result is finite.
HomotopyContinuation.is_singular — Methodis_singular(r::PathResult)Checks whether the path result r is singular.
HomotopyContinuation.is_nonsingular — Methodis_nonsingular(r::PathResult)Checks whether the path result is non-singular. This is true if it is not singular.
HomotopyContinuation.is_real — Methodis_real(r::PathResult; tol::Float64 = 1e-6)We consider a result as real if the infinity-norm of the imaginary part of the solution is at most tol.
HomotopyContinuation.accuracy — Methodaccuracy(r::PathResult)Get the accuracy of the solution. This is an estimate of the (relative) distance to the true solution.
HomotopyContinuation.residual — Methodresidual(r::PathResult)Get the residual of the solution.
HomotopyContinuation.steps — Methodsteps(r::PathResult)Total number of steps the path tracker performed.
HomotopyContinuation.accepted_steps — Methodaccepted_steps(r::PathResult)Total number of steps the path tracker accepted.
HomotopyContinuation.rejected_steps — Methodrejected_steps(r::PathResult)Total number of steps the path tracker rejected.
HomotopyContinuation.winding_number — Methodwinding_number(r::PathResult)Get the winding number of the solution of the path. Returns nothing if it wasn't computed.
HomotopyContinuation.path_number — Methodpath_number(r::PathResult)Get the number of the path. Returns nothing if it wasn't provided.
HomotopyContinuation.start_solution — Methodstart_solution(r::PathResult)Get the start solution of the path.
HomotopyContinuation.multiplicity — Methodmultiplicity(r::PathResult)Get the multiplicity of the solution of the path.
HomotopyContinuation.last_path_point — Methodlast_path_point(r::PathResult)Returns a tuple (x,t) containing the last zero of H(x, t) before the Cauchy endgame was used. Returns nothing if the endgame strategy was not invoked.
HomotopyContinuation.valuation — Methodvaluation(r::PathResult)Get the computed valuation of the path.