Jpp  18.0.1-rc.1
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Namespaces | Functions | Variables
JGroup.cc File Reference

Example program to test JLANG::JGroup class. More...

#include <string>
#include <iostream>
#include <iomanip>
#include "JLang/JGroup.hh"
#include "Jeep/JParser.hh"
#include "Jeep/JMessage.hh"

Go to the source code of this file.

Namespaces

 JLANG
 Auxiliary classes and methods for language specific functionality.
 

Functions

int main (int argc, char **argv)
 

Variables

static const JGroup< double > & JLANG::getElement = JGroup<double>::getInstance()
 

Detailed Description

Example program to test JLANG::JGroup class.

Author
mdejong

Definition in file JGroup.cc.

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 31 of file JGroup.cc.

32 {
33  using namespace std;
34  using namespace JPP;
35 
36  int debug;
37 
38  try {
39 
40  JParser<> zap("Example program to test groups.");
41 
42  zap['d'] = make_field(debug) = 3;
43 
44  zap(argc, argv);
45  }
46  catch(const exception &error) {
47  FATAL(error.what() << endl);
48  }
49 
50  DEBUG("Size of group " << JGroup<double>::size << endl);
51 
52  const int N = 4;
53 
54  for (int i = 0; i != N; ++i) {
55  DEBUG(i << ' ' << getElement(i) << endl);
56  }
57 
58  ASSERT(JGroup<double>::size == N, "Test size of group.");
59 
60  for (int i = 0; i != N; ++i) {
61  ASSERT(getElement(i) == (double) i, "Test element access.");
62  }
63 
64  return 0;
65 }
Utility class to parse command line options.
Definition: JParser.hh:1514
static const JGroup< double > & getElement
Definition: JGroup.cc:21
#define ASSERT(A,...)
Assert macro.
Definition: JMessage.hh:90
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:1989
#define FATAL(A)
Definition: JMessage.hh:67
then usage $script< input file >[option[primary[working directory]]] nWhere option can be N
Definition: JMuonPostfit.sh:40
int debug
debug level
#define DEBUG(A)
Message macros.
Definition: JMessage.hh:62