}
}
- Couple tmp[nb_samples];
+ Couple *tmp = new Couple[nb_samples];
for(int n = 0; n < nb_samples; n++) {
tmp[n].index = n;
tmp[n].value = x[n];
qsort(tmp, nb_samples, sizeof(Couple), compare_couple);
for(int n = 0; n < nb_samples; n++)
- cout << tmp[n].value << " " << double(n)/double(nb_samples) << endl;
+ cout << tmp[n].value << " " << double(n+1)/double(nb_samples) << endl;
+ delete[] tmp;
delete[] x;
}
}
}
- Couple tmp[nb_samples];
+ Couple *tmp = new Couple[nb_samples];
int nb_rn = 0, nb_rp = 0, nb_fp = 0, nb_fn = 0;
bool binary = true;
}
}
- delete[] x; delete[] y;
+ delete[] tmp;
+ delete[] x;
+ delete[] y;
}
}
}
- int nb[nb_bins];
+ int *nb = new int[nb_bins];
for(int n = 0; n < nb_bins; n++) nb[n] = 0;
int nb_total = 0;
cout << xmin + ((xmax - xmin) * n) / double(nb_bins) << " "
<< nb[n] / double(nb_total) << endl;
}
+
+ delete[] nb;
}
break;
}
}
- Couple tmp[nb_samples];
+ Couple *tmp = new Couple[nb_samples];
for(int n = 0; n < nb_samples; n++) {
tmp[n].index = n;
tmp[n].value = x[n];
<< " QUANTILE0.9 " << tmp[int(nb_samples * 0.9)].value
<< endl;
+ delete[] tmp;
}
break;