114     JParser<> zap(
"Example program to test performance of merge sort.");
 
  121   catch(
const exception &error) {
 
  122     FATAL(error.what() << endl);
 
  128   if (rate_Hz <= 0.0) {
 
  129     FATAL(
"Rate " << rate_Hz << 
" < 0 Hz." << endl);
 
  132   const double period = 1.0e9 / rate_Hz;      
 
  134   const double Tmin   = 0.0;                  
 
  135   const double Tmax   = 1.0e8;                
 
  138   const int NUMBER_OF_MODULES = 115 * 18;
 
  153   size_t number_of_hits = 0;
 
  157     for (
double t1 = Tmin + gRandom->Exp(period); t1 < Tmax; t1 += gRandom->
Exp(period), ++number_of_hits) {
 
  161     NOTICE(
"PMT[" << setw(2) << i << 
"]  " << input[i].size() << endl);
 
  169     JTimer(
"std::inplace_merge"),
 
  177     for (
int i = 0; i != NUMBER_OF_MODULES; ++i) {
 
  184         copy(input[i].begin(), input[i].end(), back_inserter(buffer));
 
  187       std::sort(buffer.begin(), buffer.end());
 
  191       ASSERT(buffer.size() == number_of_hits,         
"Test std::sort.");
 
  192       ASSERT(is_sorted(buffer.begin(), buffer.end()), 
"Test std::sort.");
 
  201     for (
int i = 0; i != NUMBER_OF_MODULES; ++i) {
 
  208         n += input[i].size();
 
  213       JBuffer1D::iterator out = buffer.begin();      
 
  219         out = 
copy(input[i].begin(), input[i].end(), out);
 
  221         delimiter[i+1] = 
distance(buffer.begin(), out);
 
  224       inplace_merge(buffer.begin(), delimiter.size(), delimiter.data());
 
  228       ASSERT(buffer.size() == number_of_hits,         
"Test std::inplace_merge.");
 
  229       ASSERT(is_sorted(buffer.begin(), buffer.end()), 
"Test std::inplace_merge.");
 
  237     for (
int i = 0; i != NUMBER_OF_MODULES; ++i) {
 
  243       merge(input, buffer);
 
  247       ASSERT(buffer.size() == number_of_hits,         
"Test JMergeSort.");
 
  248       ASSERT(is_sorted(buffer.begin(), buffer.end()), 
"Test JMergeSort.");
 
  253   for (
int i = 0; i != 
sizeof(timer)/
sizeof(timer[0]); ++i) {
 
  254     timer[i].
print(cout, 
false);
 
#define ASSERT(A,...)
Assert macro.
 
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
 
std::vector< T >::difference_type distance(typename std::vector< T >::const_iterator first, typename PhysicsEvent::const_iterator< T > second)
Specialisation of STL distance.
 
Auxiliary class for CPU timing and usage.
 
void print(std::ostream &out, const JScale_t scale=milli_t) const
Print timer data.
 
Utility class to parse command line options.
 
void copy(const Head &from, JHead &to)
Copy header from from to to.
 
void putEndMarker(std::vector< JElement_t, JAllocator_t > &buffer, const JElement_t &value)
Put end marker.
 
static const JGroup< double > & getElement
 
JExp< JF1_t > Exp(const JF1_t &f1)
Exponent of function.
 
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
 
static const int NUMBER_OF_PMTS
Total number of PMTs in module.