use monomials of all degrees <= max; use @spawnat

main
Francesco Minnocci 1 year ago
parent 2492fe3a33
commit 0284de9d28
No known key found for this signature in database
GPG Key ID: 76DA3AF9BAED1A32

@ -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

@ -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))

Loading…
Cancel
Save