// System.out.println("Computing b's and k's for KNOWN N");
//else
// System.out.println("Computing b's and k's for UNKNOWN N");
System.out.println("mem [Math.round(elements/1000.0)]");
System.out.println("***********************************");
Timer timer = new Timer().start();
for (int q=0; q<quantiles.length; q++) {
int p = quantiles[q];
System.out.println("------------------------------");
System.out.println("computing for p = "+p);
for (int s=0; s<sizes.length; s++) {
long N = sizes[s];
System.out.println(" ------------------------------");
System.out.println(" computing for N = "+N);
for (int e=0; e<epsilons.length; e++) {
double epsilon = epsilons[e];
System.out.println(" ------------------------------");
System.out.println(" computing for e = "+epsilon);
for (int d=0; d<deltas.length; d++) {
double delta = deltas[d];
for (int knownCounter=0; knownCounter<2; knownCounter++) {
boolean known_N;
if (knownCounter ==0) known_N = true;
else known_N = false;
DoubleQuantileFinder finder = QuantileFinderFactory.newDoubleQuantileFinder(known_N, N, epsilon, delta, p, null);
//System.out.println(finder.getClass().getName());
/*
double[] returnSamplingRate = new double[1];
long[] result;
if (known_N) {
result = QuantileFinderFactory.known_N_compute_B_and_K(N, epsilon, delta, p, returnSamplingRate);
}
else {
result = QuantileFinderFactory.unknown_N_compute_B_and_K(epsilon, delta, p);
long b1 = result[0];
long k1 = result[1];
if (N>=0) {
long[] resultKnown = QuantileFinderFactory.known_N_compute_B_and_K(N, epsilon, delta, p, returnSamplingRate);
long b2 = resultKnown[0];
long k2 = resultKnown[1];
if (b2 * k2 < b1 * k1) { // the KnownFinder is smaller
result = resultKnown;
}
}
}
long b = result[0];
long k = result[1];
*/
String knownStr = known_N ? " known" : "unknown";
long mem = finder.totalMemory();
if (mem==0) mem = N;
//else if (mem==0 && !known_N && N<0) mem = Long.MAX_VALUE; // actually infinity
//else if (mem==0 && !known_N && N>=0) mem = N;
//System.out.print(" (e,d,N,p)=("+epsilon+","+delta+","+N+","+p+") --> ");
System.out.print(" (known, d)=("+knownStr+", "+delta+") --> ");
//System.out.print("(mem,b,k,memF");
System.out.print("(MB,mem");
//if (known_N) System.out.print(",sampling");
//System.out.print(")=("+(Math.round(b*k/1000.0))+","+b+","+k+", "+Math.round(b*k*8/1024.0/1024.0));
//System.out.print(")=("+b*k/1000.0+","+b+","+k+", "+b*k*8/1024.0/1024.0+", "+Math.round(b*k*8/1024.0/1024.0));
System.out.print(")=("+mem*8.0/1024.0/1024.0+", "+mem/1000.0+", "+Math.round(mem*8.0/1024.0/1024.0));
//if (known_N) System.out.print(","+returnSamplingRate[0]);
System.out.println(")");
}
}
}
}
}
timer.stop().display();
}