From 0284de9d28d12613e2f9dd933d1b20cd8638c39e Mon Sep 17 00:00:00 2001 From: Francesco Minnocci Date: Tue, 26 Dec 2023 22:56:40 +0100 Subject: [PATCH] use monomials of all degrees <= max; use @spawnat --- random-poly.jl | 2 +- solve.jl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/random-poly.jl b/random-poly.jl index 21d0d2e..bcd93d5 100644 --- a/random-poly.jl +++ b/random-poly.jl @@ -10,7 +10,7 @@ module RandomPoly x = [TypedPolynomials.Variable{Symbol("x[$i]")}() for i in 1:m] monomial_powers=collect(Iterators.product([0:n for _ in 1:m]...)) - monomials = [prod(x.^i) for i in monomial_powers if sum(i) == n] + monomials = [prod(x.^i) for i in monomial_powers if sum(i) <= n && sum(i) != 0] return sum(map(m -> rand(Normal()) * m, monomials)) end diff --git a/solve.jl b/solve.jl index 6142304..4659d3e 100644 --- a/solve.jl +++ b/solve.jl @@ -46,7 +46,7 @@ function solve(F, G, roots) result = Array{Future}(undef, length(roots)) for i in eachindex(roots) - result[i] = @spawn compute_root(H, roots[i]) + result[i] = @spawnat :any compute_root(H, roots[i]) end sols = Array{ComplexF64,2}(undef, length(roots), length(F))