Jpp  15.0.5
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Functions
JEigenValues3D.cc File Reference

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

#include <string>
#include <iostream>
#include <fstream>
#include <iomanip>
#include <vector>
#include "JGeometry3D/JVector3D.hh"
#include "JGeometry3D/JEigen3D.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 3D.

Author
mdejong

Definition in file JEigenValues3D.cc.

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 45 of file JEigenValues3D.cc.

46 {
47  using namespace std;
48  using namespace JPP;
49 
50  string inputFile;
51  int debug;
52 
53  try {
54 
55  JParser<> zap("Example program to print eigen values in 3D.");
56 
57  zap['f'] = make_field(inputFile);
58  zap['d'] = make_field(debug) = 1;
59 
60  zap(argc, argv);
61  }
62  catch(const exception& error) {
63  FATAL(error.what() << endl);
64  }
65 
66 
67  cout.tie(&cerr);
68 
69 
70  vector<JVector3D> buffer;
71 
72  if (inputFile != "") {
73 
74  ifstream in(inputFile.c_str());
75 
76  for (double x, y, z; in >> x >> y >> z; ) {
77 
78  buffer.push_back(JVector3D(x,y,z));
79  }
80 
81  in.close();
82  }
83 
84  const JEigenValues3D eigen(buffer.begin(), buffer.end());
85 
86  for (JEigenValues3D::const_iterator i = eigen.begin(); i != eigen.end(); ++i) {
87  cout << FIXED(7,3) << i->first << ' ' << i->second << endl;
88  }
89 }
Utility class to parse command line options.
Definition: JParser.hh:1500
Auxiliary data structure for floating point format specification.
Definition: JManip.hh:446
#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 CHECK_EXIT_CODE typeset A TRIPODS get_tripods $WORKDIR tripod txt TRIPODS for EMITTER in
Definition: JCanberra.sh:41