|
|
@ -1,5 +1,6 @@
|
|
|
|
# External dependencies
|
|
|
|
# External dependencies
|
|
|
|
using TypedPolynomials
|
|
|
|
using TypedPolynomials
|
|
|
|
|
|
|
|
using LinearAlgebra
|
|
|
|
|
|
|
|
|
|
|
|
# Local dependencies
|
|
|
|
# Local dependencies
|
|
|
|
include("random_poly.jl")
|
|
|
|
include("random_poly.jl")
|
|
|
@ -44,8 +45,8 @@ function solve(F, (G, roots) = start_system(F), maxsteps = 1000)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
# Input polynomial system
|
|
|
|
# Input polynomial system
|
|
|
|
dimension = 4
|
|
|
|
dimension = 2
|
|
|
|
max_degree = 3
|
|
|
|
max_degree = 2
|
|
|
|
R = random_system(dimension, max_degree)
|
|
|
|
R = random_system(dimension, max_degree)
|
|
|
|
# @polyvar x y
|
|
|
|
# @polyvar x y
|
|
|
|
# C = [x^3 - y + 5x^2 - 10, 2x^2 - y - 10]
|
|
|
|
# C = [x^3 - y + 5x^2 - 10, 2x^2 - y - 10]
|
|
|
@ -60,7 +61,9 @@ R = random_system(dimension, max_degree)
|
|
|
|
# (sT, stepsT) = solve(T)
|
|
|
|
# (sT, stepsT) = solve(T)
|
|
|
|
|
|
|
|
|
|
|
|
println("R: ", stepsR)
|
|
|
|
println("R: ", stepsR)
|
|
|
|
println("solutions:" sR)
|
|
|
|
println("solutions:", sR)
|
|
|
|
|
|
|
|
vars = variables(R)
|
|
|
|
|
|
|
|
println([LinearAlgebra.norm([f(vars=>s) for f in R]) for s in sR])
|
|
|
|
|
|
|
|
|
|
|
|
# println("C: ", stepsC)
|
|
|
|
# println("C: ", stepsC)
|
|
|
|
# println("Q: ", stepsQ)
|
|
|
|
# println("Q: ", stepsQ)
|
|
|
|