# Results

A call to solve returns a Result:

## Filtering results and solutions

HomotopyContinuation.resultsFunction
results(
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.

source
results(result::MonodromyResult)

Returns the computed PathResults.

source
results(W::WitnessSet)

Get the results stored in W.

source
HomotopyContinuation.solutionsFunction
solutions(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]
source
solutions(result::MonodromyResult)

Return all solutions.

source
solutions(W::WitnessSet)

Get the solutions stored in W.

source
Base.realMethod
real(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'.

source
HomotopyContinuation.real_solutionsFunction
real_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]
source
HomotopyContinuation.singularFunction
singular(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.

source

## Counting

HomotopyContinuation.nresultsFunction
nresults(
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.

source
nresults(result::MonodromyResult)

Returns the number of results computed.

source
HomotopyContinuation.nsingularFunction
nsingular(
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.

source

## PathResult

HomotopyContinuation.PathResultType
PathResult

A 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 of t at which solution was computed. Note that if return_code is :at_infinity, then t is the value when this was decided.
• accuracy::Float64: An estimate the (relative) accuracy of the computed solution.
• residual::Float64: The infinity norm of H(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 the solution.
• 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.

• 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: The EndgameTracker obtained a solution.
• :at_infinity: The EndgameTracker stopped the tracking of the path since it determined that that path is diverging towards infinity.
• :at_zero: The EndgameTracker stopped 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 option zero_is_at_infinity is true.
• :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
source
HomotopyContinuation.is_realMethod
is_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.

source
HomotopyContinuation.last_path_pointMethod
last_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.

source