1.2.3 testing
Modérateur : xcasadmin
1.2.3 testing
Je viens de mettre un package debian 64 bits de la toute premiere version de la 1.2.3 dans testing. J'y ai fait quelques optimisations qui necessitent d'etre un peu testees avant de remplacer la 1.2.2 stable (mise a jour en 1.2.2-105 pour debian et windows).
Re: 1.2.3 testing
Mise a jour 1.2.3-3, toujours des optimisations.
Par exemple (tire de http://nemocas.org/benchmarks.html) le polynome minimal ou caracteristique d'une matrice a coefficients polynomiaux:
Par exemple (tire de http://nemocas.org/benchmarks.html) le polynome minimal ou caracteristique d'une matrice a coefficients polynomiaux:
Code : Tout sélectionner
n1:=10; n:=2*n1; m:=matrix(n1,n1,(j,k)->ranv(3,-21)*[x^2,x,1]); M:=blockmatrix(2,2,[m,0*m,0*m,m]):;
for j from 1 to 10 do p:=idn(n); q:=p; r:=rand(n); d:=ranv(1,-4)[0]; p[r]:=seq(d,n); p[r,r]:=1; q[r]:=seq(-d,n); q[r,r]:=1; M:=normal(q*M*p); od:;
time(p:=pmin(M)); size(p); horner(horner(p,y),M,y);
time(b:=pcar(M,y,lagrange)); normal(b-horner(p,y)^2);
Re: 1.2.3 testing
La liste complete des benchmarks
Fateman
n:=30; f:=1+x+y+z+t; f:=symb2poly(f,[x,y,z,t]); p:=f^n:; time(q:=p*(p+1)); size(q);
Pearce
n:=12; f := symb2poly((1 + x + y + 2*z^2 + 3*t^3 + 3*u^5)^n,[x,y,z,t,u]):; g := symb2poly((1 + u + t + 2*z^2 + 3*y^3 + 3*x^5)^n,[x,y,z,t,u]):; size(f); time(p:=f*g); size(p);
Bernoulli polynomials
n:=1000;series("t"); u := t + O(t^n); time(r:=(u*exp(symb2poly(x,[x])*u))*inv(exp(u)-1));
Polynomials over number fields:
x:=rootof(cyclotomic(20));f:=(3x^7 + x^4 - 3x + 1)*y^3 + (2x^6-x^5+4x^4-x^3+x^2-1)*y +(-3x^7+2x^6-x^5+3x^3-2x^2+x);p:=symb2poly(f,y,[]); time(s:=p^300);
Determinant over a field:
n:=80;a:=rootof(x^3+3x+1); m:=ranm(n,n,a):; time(d:=det(m)); evalf(d);det(evalf(m,20));
Determinant of a matrix over a polynomial ring
n:=40; m:=matrix(n,n,(j,k)->randpoly(x,3,-21)-x^3):; time(d:=det(m));
Linear solving over a polynomial ring
n:=20; m:=matrix(n,n+1,(j,k)->y^2*ranv(3,-21)*[x^2,x,1]+y*ranv(3,-21)*[x^2,x,1]+ranv(3,-21)*[x^2,x,1]):; time(t:=rref(m,keep_pivot)); normal((m[0..n-1,0..n-1]*t[0..n-1,n..n])-t[0..n-1,0..n-1]*m[0..n-1,n..n]);
Determinant over a commutative ring:
p := 2003*1009; n:=80; f(j,k):={ k:=rand(6); return randpoly(x,k) % p; }; m:=matrix(n,n,f); det(m);
Resultant:
GF(7,11,x); p:=factor(j^3+3*x*j+1); rootof(p):=y;f := (3y^2 + y + x)*z^2 + ((x + 2)*y^2 + x + 1)*z + 4x*y + 3;g := (7y^2 - y + 2x + 7)*z^2 + (3y^2 + 4x + 1)*z + (2x + 1)*y + 1;F:=symb2poly(f,[[z]]);G:=symb2poly(g,[[z]]);n:=12; Fn:=F^n:; GFn:=(G+Fn)^n:; resultant(Fn,GFn);
Minimal polynomial of a matrix over the integers
n1:=80; n:=2*n1; m:=ranm(n1,n1,-21):; M:=blockmatrix(2,2,[m,0*m,0*m,m]):; for j from 1 to 10 do p:=idn(n); q:=p; r:=rand(n); d:=ranv(1,-4)[0]; p[r]:=seq(d,n); p[r,r]:=1; q[r]:=seq(-d,n); q[r,r]:=1; M:=q*M*p; od:; M:; time(a:=pmin(M)); time(b:=pcar(m)); a-b;
Characteristic polynomial of a matrix over the integers
n:=80; m:=ranm(n,n,-21):; time(charpoly(m));
Minpoly over a finite field
n1:=40; n:=2*n1; GF(103,2); m:=ranm(n1,n1,g):; M:=blockmatrix(2,2,[m,0*m,0*m,m]):; for j from 1 to 10 do p:=idn(n); q:=p; r:=rand(n); d:=ranv(1,-4)[0]; p[r]:=seq(d,n); p[r,r]:=1; q[r]:=seq(-d,n); q[r,r]:=1; M:=q*M*p; od:; M:; time(a:=pmin(M)); time(b:=pcar(m)); a; a-b;
Minpoly over a gcd domain
n1:=10; n:=2*n1; m:=matrix(n1,n1,(j,k)->ranv(3,-21)*[x^2,x,1]); M:=blockmatrix(2,2,[m,0*m,0*m,m]):; for j from 1 to 10 do p:=idn(n); q:=p; r:=rand(n); d:=ranv(1,-4)[0]; p[r]:=seq(d,n); p[r,r]:=1; q[r]:=seq(-d,n); q[r,r]:=1; M:=normal(q*M*p); od:; time(p:=pmin(M)); size(p); horner(horner(p,y),M,y); time(b:=pcar(M,y,lagrange)); normal(b-horner(p,y)^2);
Fateman
n:=30; f:=1+x+y+z+t; f:=symb2poly(f,[x,y,z,t]); p:=f^n:; time(q:=p*(p+1)); size(q);
Pearce
n:=12; f := symb2poly((1 + x + y + 2*z^2 + 3*t^3 + 3*u^5)^n,[x,y,z,t,u]):; g := symb2poly((1 + u + t + 2*z^2 + 3*y^3 + 3*x^5)^n,[x,y,z,t,u]):; size(f); time(p:=f*g); size(p);
Bernoulli polynomials
n:=1000;series("t"); u := t + O(t^n); time(r:=(u*exp(symb2poly(x,[x])*u))*inv(exp(u)-1));
Polynomials over number fields:
x:=rootof(cyclotomic(20));f:=(3x^7 + x^4 - 3x + 1)*y^3 + (2x^6-x^5+4x^4-x^3+x^2-1)*y +(-3x^7+2x^6-x^5+3x^3-2x^2+x);p:=symb2poly(f,y,[]); time(s:=p^300);
Determinant over a field:
n:=80;a:=rootof(x^3+3x+1); m:=ranm(n,n,a):; time(d:=det(m)); evalf(d);det(evalf(m,20));
Determinant of a matrix over a polynomial ring
n:=40; m:=matrix(n,n,(j,k)->randpoly(x,3,-21)-x^3):; time(d:=det(m));
Linear solving over a polynomial ring
n:=20; m:=matrix(n,n+1,(j,k)->y^2*ranv(3,-21)*[x^2,x,1]+y*ranv(3,-21)*[x^2,x,1]+ranv(3,-21)*[x^2,x,1]):; time(t:=rref(m,keep_pivot)); normal((m[0..n-1,0..n-1]*t[0..n-1,n..n])-t[0..n-1,0..n-1]*m[0..n-1,n..n]);
Determinant over a commutative ring:
p := 2003*1009; n:=80; f(j,k):={ k:=rand(6); return randpoly(x,k) % p; }; m:=matrix(n,n,f); det(m);
Resultant:
GF(7,11,x); p:=factor(j^3+3*x*j+1); rootof(p):=y;f := (3y^2 + y + x)*z^2 + ((x + 2)*y^2 + x + 1)*z + 4x*y + 3;g := (7y^2 - y + 2x + 7)*z^2 + (3y^2 + 4x + 1)*z + (2x + 1)*y + 1;F:=symb2poly(f,[[z]]);G:=symb2poly(g,[[z]]);n:=12; Fn:=F^n:; GFn:=(G+Fn)^n:; resultant(Fn,GFn);
Minimal polynomial of a matrix over the integers
n1:=80; n:=2*n1; m:=ranm(n1,n1,-21):; M:=blockmatrix(2,2,[m,0*m,0*m,m]):; for j from 1 to 10 do p:=idn(n); q:=p; r:=rand(n); d:=ranv(1,-4)[0]; p[r]:=seq(d,n); p[r,r]:=1; q[r]:=seq(-d,n); q[r,r]:=1; M:=q*M*p; od:; M:; time(a:=pmin(M)); time(b:=pcar(m)); a-b;
Characteristic polynomial of a matrix over the integers
n:=80; m:=ranm(n,n,-21):; time(charpoly(m));
Minpoly over a finite field
n1:=40; n:=2*n1; GF(103,2); m:=ranm(n1,n1,g):; M:=blockmatrix(2,2,[m,0*m,0*m,m]):; for j from 1 to 10 do p:=idn(n); q:=p; r:=rand(n); d:=ranv(1,-4)[0]; p[r]:=seq(d,n); p[r,r]:=1; q[r]:=seq(-d,n); q[r,r]:=1; M:=q*M*p; od:; M:; time(a:=pmin(M)); time(b:=pcar(m)); a; a-b;
Minpoly over a gcd domain
n1:=10; n:=2*n1; m:=matrix(n1,n1,(j,k)->ranv(3,-21)*[x^2,x,1]); M:=blockmatrix(2,2,[m,0*m,0*m,m]):; for j from 1 to 10 do p:=idn(n); q:=p; r:=rand(n); d:=ranv(1,-4)[0]; p[r]:=seq(d,n); p[r,r]:=1; q[r]:=seq(-d,n); q[r,r]:=1; M:=normal(q*M*p); od:; time(p:=pmin(M)); size(p); horner(horner(p,y),M,y); time(b:=pcar(M,y,lagrange)); normal(b-horner(p,y)^2);
Re: 1.2.3 testing
Mise a jour (la derniere de l'annee!) 1.2.3-7 avec encore quelques accelerations.