load 'witt_gen.m';
load 'etas.m';

p:=5;
n:=4;

P:=PolynomialRing(GF(p),(2*n+2));
AssignNames(~P,
  [ "x" cat IntegerToString(i) : i in [0..n] ] cat
  [ "y" cat IntegerToString(i) : i in [0..n] ] );


ResetMaximumMemoryUsage();

time v1:=newWittSumPol(n,p);

print "Memory Usage (in MB): ", GetMaximumMemoryUsage()/((1024.0)^2);

delete v1;



ResetMaximumMemoryUsage();

time pols:=etapols(p,n);

print "Memory Usage (in MB): ", GetMaximumMemoryUsage()/((1024.0)^2);

ResetMaximumMemoryUsage();

time v2:=newWittSum([ P.i : i in [1..(n+1)] ], [P.i : i in [(n+2)..(2*n+2)] ] : pols:=pols);

print "Memory Usage (in MB): ", GetMaximumMemoryUsage()/((1024.0)^2);


[ P!v1[i] : i in [1..(n+1)] ] eq v2;

