bak-nullstellen.sage gelöscht

This commit is contained in:
Hanno Reents 2023-12-26 18:41:28 +01:00
parent 66116fa13d
commit 391ded87df
1 changed files with 0 additions and 37 deletions

View File

@ -1,37 +0,0 @@
import os
def coeffGenerator(deg=1):
if deg==1:
return[[1]]
else:
l=[]
p=coeffGenerator(deg-1)
for i in p:
a=i+[1]
b=i+[-1]
l.append(a)
l.append(b)
return l
def polyGenerator(deg=1):
var('x')
l=[]
for p in coeffGenerator(deg):
l.append(sum([b*x^a for (a,b) in enumerate(p)]))
return l
def numericalSolutionsWithSaves(deg=1,batch_sz=10000):
path="polynomials"+str(deg)
if os.path.isfile(path+".sobj") is False:
polynomials=polyGenerator(deg)
save(polynomials,path)
polynomials=load(path)
while len(polynomials)!=0:
solutions=[]
for p in polynomials[:batch_sz]:
solutions.append([s[x].n(20) for s in solve(p,var('x'),solution_dict=True,to_polysolve=True)])
save(solutions,"deg"+str(deg)+""+str(floor(len(polynomials)/batch_sz)))
polynomials=polynomials[batch_sz:]
save(polynomials,path)
numericalSolutionsWithSaves(22,50000)