#include #include #include "JTools/JMultiKey.hh" #include "Jeep/JParser.hh" #include "Jeep/JMessage.hh" #define PRINT(OUT, A, B, OP) do { OUT << A << ' ' << std::setw(2) << left << #OP << ' ' << B << " ?= " << (A OP B) << std::endl; } while (0) /** * \file * * Example program to test JTOOLS::JMultiKey class. * \author mdejong */ int main(int argc, char **argv) { using namespace std; int debug; try { JParser<> zap("Example program to test multi-dimensional key."); zap['d'] = make_field(debug) = 0; zap(argc, argv); } catch(const exception &error) { FATAL(error.what() << endl); } using namespace JPP; { const int N = 3; typedef JMultiKey JMultiKey1_t; JMultiKey1_t a, b; a.first = 1; a.second.first = 2; a.second.second.first = 3; b.first = 1; b.second.first = 2; b.second.second.first = 4; PRINT(cout, a, b, ==); PRINT(cout, a, b, <); PRINT(cout, a, b, <=); PRINT(cout, a, b, >); PRINT(cout, a, b, >=); } }