Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Functions
JEigenValues2D.cc File Reference

Example program to print eigen values in 2D. More...

#include <string>
#include <iostream>
#include <fstream>
#include <iomanip>
#include <vector>
#include "JGeometry2D/JVector2D.hh"
#include "JGeometry2D/JEigenValues2D.hh"
#include "Jeep/JPrint.hh"
#include "Jeep/JParser.hh"
#include "Jeep/JMessage.hh"

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Detailed Description

Example program to print eigen values in 2D.

Author
mdejong

Definition in file JEigenValues2D.cc.

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 21 of file JEigenValues2D.cc.

22 {
23  using namespace std;
24 
25  string inputFile;
26  int debug;
27 
28  try {
29 
30  JParser<> zap("Example program to print eigen values in 2D.");
31 
32  zap['f'] = make_field(inputFile);
33  zap['d'] = make_field(debug) = 1;
34 
35  zap(argc, argv);
36  }
37  catch(const exception& error) {
38  FATAL(error.what() << endl);
39  }
40 
41 
42  using namespace JPP;
43 
44  cout.tie(&cerr);
45 
46 
47  vector<JVector2D> buffer;
48 
49  if (inputFile != "") {
50 
51  ifstream in(inputFile.c_str());
52 
53  for (double x, y; in >> x >> y; ) {
54 
55  buffer.push_back(JVector2D(x,y));
56  }
57 
58  in.close();
59  }
60 
61  JEigenValues2D eigen(buffer.begin(), buffer.end());
62 
63  cout << "Number of eigen values " << eigen.getN() << endl;
64  cout << FIXED(7,3) << eigen.getX() << endl;
65  cout << FIXED(7,3) << eigen.getY() << endl;
66 }
Utility class to parse command line options.
Definition: JParser.hh:1493
esac print_variable DETECTOR INPUT_FILE OUTPUT_FILE CDF for TYPE in
Definition: JSirene.sh:45
Auxiliary data structure for floating point format specification.
Definition: JPrint.hh:481
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:1954
int debug
debug level
Definition: JSirene.cc:61
#define FATAL(A)
Definition: JMessage.hh:67