Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it

563642 views
1
\\ compute factors of poly defined by coeffs over Q_f
2
f = subst(f,variable(f),'varA);
3
pol = Pol(vector(#coeffs-1,i,Polrev(coeffs[i],'varA)));
4
n = poldegree(f);
5
gettime();
6
fac = lift(nffactor(f, pol ));
7
zeit = gettime();
8
9
p2v(n,b)=vector(n,j,polcoeff(b,j-1));
10
f2v(n,v)=vector(#v,i,p2v(n,v[i]));
11
12
\\ print result
13
print("[ ");
14
{
15
for(i=1,#fac[,1],
16
for(j=1,fac[i,2],
17
print(f2v(n, Vec(fac[i,1]) ),",");
18
)
19
);
20
}
21
print1(zeit);
22
print("];");
23
24