Jpp
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
examples
JGeometry3D
JEigenValues3D.cc
Go to the documentation of this file.
1
#include <string>
2
#include <iostream>
3
#include <fstream>
4
#include <iomanip>
5
#include <vector>
6
7
#include "
JGeometry3D/JVector3D.hh
"
8
#include "
JGeometry3D/JEigenValues3D.hh
"
9
10
#include "
Jeep/JPrint.hh
"
11
#include "
Jeep/JParser.hh
"
12
#include "
Jeep/JMessage.hh
"
13
14
15
/**
16
* \file
17
*
18
* Example program to print eigen values in 3D.
19
* \author mdejong
20
*/
21
int
main
(
int
argc,
char
**argv)
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 3D."
);
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<JVector3D>
buffer;
48
49
if
(inputFile !=
""
) {
50
51
ifstream
in
(inputFile.c_str());
52
53
for
(
double
x, y, z;
in
>> x >> y >> z; ) {
54
55
buffer.push_back(JVector3D(x,y,z));
56
}
57
58
in
.close();
59
}
60
61
JEigenValues3D 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
cout <<
FIXED
(7,3) << eigen.getZ() << endl;
67
}
JPARSER::JParser
Utility class to parse command line options.
Definition:
JParser.hh:1493
JEigenValues3D.hh
in
esac print_variable DETECTOR INPUT_FILE OUTPUT_FILE CDF for TYPE in
Definition:
JSirene.sh:45
FIXED
Auxiliary data structure for floating point format specification.
Definition:
JPrint.hh:481
std::vector
Definition:
JSTDTypes.hh:12
JPrint.hh
I/O formatting auxiliaries.
make_field
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition:
JParser.hh:1954
JVector3D.hh
debug
int debug
debug level
Definition:
JSirene.cc:61
JMessage.hh
General purpose messaging.
FATAL
#define FATAL(A)
Definition:
JMessage.hh:67
JParser.hh
Utility class to parse command line options.
main
int main(int argc, char *argv[])
Definition:
Main.cpp:15
Generated by
1.8.5