62 JParser<> zap(
"Example program to test multi-dimensional map.");
69 catch(
const exception &error) {
70 FATAL(error.what() << endl);
75 const double xmin = -1.0;
76 const double xmax = +1.0;
81 JMap>::maplist JMaplist_t;
90 buffer[
x][y][z] =
f1(
x, y, z);
95 const JFormat_t format(6, 1, std::ios::fixed);
97 setFormat< JMultiKey<3, const double> >(format);
98 setFormat< JMultiKey<2, const double> >(format);
99 setFormat< JMultiKey<1, const double> >(format);
101 DEBUG(
"i->[second]*->(first|second)" << endl);
103 for (JMultimap_t::super_const_iterator i = buffer.super_begin(); i != buffer.super_end(); ++i) {
105 << format << i->first <<
' '
106 << format << i->second->first <<
' '
107 << format << i->second->second->first <<
' '
108 << format << i->second->second->second << endl);
112 i->second->second->first) - i->second->second->second) <= precision,
"Test iterator equality");
115 DEBUG(
"i->[second]*->(first|second)" << endl);
117 for (JMultimap_t::super_const_reverse_iterator i = buffer.super_rbegin(); i != buffer.super_rend(); ++i) {
119 << format << i->first <<
' '
120 << format << i->second->first <<
' '
121 << format << i->second->second->first <<
' '
122 << format << i->second->second->second << endl);
126 i->second->second->first) - i->second->second->second) <= precision,
"Test iterator equality");
129 DEBUG(
"*i.[second]*.(first|second)" << endl);
131 for (JMultimap_t::super_const_reverse_iterator i = buffer.super_rbegin(); i != buffer.super_rend(); ++i) {
133 << format << (*i).first <<
' '
134 << format << (*i).second.first <<
' '
135 << format << (*i).second.second.first <<
' '
136 << format << (*i).second.second.second << endl);
140 i->second->second->first) - i->second->second->second) <= precision,
"Test iterator equality");
143 DEBUG(
"i.getKey() i.getValue()" << endl);
145 for (JMultimap_t::super_const_iterator i = buffer.super_begin(); i != buffer.super_end(); ++i) {
147 DEBUG(i.getKey() <<
' ' << format << i.getValue() << endl);
149 ASSERT(fabs(
f1(i.getKey()) - i.
getValue()) <= precision,
"Test iterator equality");
Utility class to parse command line options.
const JPolynome f1(1.0, 2.0, 3.0)
Function.
#define ASSERT(A,...)
Assert macro.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
#define DEBUG(A)
Message macros.
double getValue(const double x) const
Function value.