From 391ded87df71a7cbec1b400a202ba95743b63bb4 Mon Sep 17 00:00:00 2001 From: Hanno Reents Date: Tue, 26 Dec 2023 18:41:28 +0100 Subject: [PATCH] =?UTF-8?q?bak-nullstellen.sage=20gel=C3=B6scht?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bak-nullstellen.sage | 37 ------------------------------------- 1 file changed, 37 deletions(-) delete mode 100755 bak-nullstellen.sage diff --git a/bak-nullstellen.sage b/bak-nullstellen.sage deleted file mode 100755 index 8587d3f..0000000 --- a/bak-nullstellen.sage +++ /dev/null @@ -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)