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

This commit is contained in:
2023-12-26 22:56:40 +01:00
parent 2492fe3a33
commit 0284de9d28
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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))