#include <faast.hpp>
#include <cstdlib>
using namespace std;
using namespace FAAST;
int main(int argv, char* argc[]) {
double cputime;
gfp::Infrastructure::BigInt p;
long d, l, t;
if (cin.peek() != EOF) {
cin >> p; cin >> d; cin >> l; cin >> t;
} else {
p = 2; d = 3; l = 4; t = 0;
}
cout << "Using " << gfp::Infrastructure::name << endl << endl;
cputime = -NTL::GetTime();
cputime += NTL::GetTime();
cout << *K << " in " << cputime << endl;
#ifdef FAAST_TIMINGS
cout << "Time spent building the irreducible polynomial : "
<< gfp::TIME.BUILDIRRED << endl;
#endif
cout << endl;
cout << "\t\tFrob\tPTr\tPrePTr\tNFrob\tNProj" << endl;
for (int i = 1 ; i <= l ; i++) {
cputime = -NTL::GetTime();
cputime += NTL::GetTime();
cout << i << "\t" << cputime << endl;
for (int j = 0 ; j < i+t ; j++) {
long n = (j>=i) ?
d + RandomBnd(K->
d - d) : d*power_long(p, j);
double frobtime, pseudotime, naivetime;
frobtime = -NTL::GetTime();
frobtime += NTL::GetTime();
cout << "\t" << n << "\t"
<< frobtime << "\t";
pseudotime = -NTL::GetTime();
pseudotime += NTL::GetTime();
cout << pseudotime << "\t";
#ifdef FAAST_TIMINGS
cout << gfp::TIME.PSEUDOTRACES << "\t";
#endif
naivetime = -NTL::GetTime();
for (long i = 0 ; i < 10 ; i++)
naivetime += NTL::GetTime();
double average = naivetime / 10;
cout << average << "\t" <<
average * n << endl;
}
}
return 0;
}