39 std::inplace_merge(__begin + delimiter[0],
40 __begin + delimiter[1],
41 __begin + delimiter[2]);
47 const size_t n = (N - 1) >> 1;
52 std::inplace_merge(__begin + delimiter[ 0 ],
53 __begin + delimiter[
n ],
54 __begin + delimiter[N-1]);
93 return std::numeric_limits<T>::max();
115 JParser<> zap(
"Example program to test performance of merge sort.");
122 catch(
const exception &error) {
131 const double period = 1.0e9 /
rate_Hz;
133 const double Tmin = 0.0;
134 const double Tmax = 1.0e8;
136 const int NUMBER_OF_PMTS = 31;
141 typedef double hit_type;
143 const JElement_t getElement;
154 for (
int i = 0; i != NUMBER_OF_PMTS; ++i) {
157 input[i].push_back(getElement(t1));
160 NOTICE(
"PMT[" <<
setw(2) << i <<
"] " << input[i].size() <<
endl);
162 putEndMarker(input[i], JElement_t::getEndMarker());
168 JTimer(
"std::inplace_merge"),
182 for (
int i = 0; i != NUMBER_OF_PMTS; ++i) {
183 copy(input[i].begin(), input[i].end(),
back_inserter(buffer));
186 std::sort(buffer.begin(), buffer.end());
206 for (
int i = 0; i != NUMBER_OF_PMTS; ++i) {
207 n += input[i].size();
212 JBuffer1D::iterator out = buffer.begin();
216 for (
int i = 0; i != NUMBER_OF_PMTS; ++i) {
218 out = copy(input[i].begin(), input[i].end(), out);
228 ASSERT(
is_sorted(buffer.begin(), buffer.end()),
"Test std::inplace_merge.");
242 merge(input, buffer);
252 for (
int i = 0; i !=
sizeof(timer)/
sizeof(timer[0]); ++i) {
int main(int argc, char **argv)
General purpose messaging.
#define ASSERT(A,...)
Assert macro.
Utility class to parse command line options.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Auxiliary class for CPU timing and usage.
void print(std::ostream &out, const JScale_t scale=milli_t) const
Print timer data.
Template definition of a multi-dimensional oscillation probability interpolation table.
Utility class to parse command line options.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).