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/JEigen2D.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 44 of file JEigenValues2D.cc.

45 {
46  using namespace std;
47  using namespace JPP;
48 
49  string inputFile;
50  int debug;
51 
52  try {
53 
54  JParser<> zap("Example program to print eigen values in 2D.");
55 
56  zap['f'] = make_field(inputFile);
57  zap['d'] = make_field(debug) = 1;
58 
59  zap(argc, argv);
60  }
61  catch(const exception& error) {
62  FATAL(error.what() << endl);
63  }
64 
65 
66  cout.tie(&cerr);
67 
68 
69  vector<JVector2D> buffer;
70 
71  if (inputFile != "") {
72 
73  ifstream in(inputFile.c_str());
74 
75  for (double x, y; in >> x >> y; ) {
76 
77  buffer.push_back(JVector2D(x,y));
78  }
79 
80  in.close();
81  }
82 
83  const JEigenValues2D eigen(buffer.begin(), buffer.end());
84 
85  for (JEigenValues2D::const_iterator i = eigen.begin(); i != eigen.end(); ++i) {
86  cout << FIXED(7,3) << i->first << ' ' << i->second << endl;
87  }
88 }
Utility class to parse command line options.
Definition: JParser.hh:1500
Auxiliary data structure for floating point format specification.
Definition: JManip.hh:445
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:1961
int debug
debug level
Definition: JSirene.cc:63
#define FATAL(A)
Definition: JMessage.hh:67
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY source JAcoustics sh $DETECTOR_ID typeset A TRIPODS get_tripods $WORKDIR tripod txt TRIPODS for EMITTER in
Definition: JCanberra.sh:36