Elements
5.10
A C++ base framework for the Euclid Software.
ElementsExamples
src
program
EigenExample.cpp
Go to the documentation of this file.
1
21
#include <iostream>
22
23
#include <map>
// for map
24
#include <string>
// for string
25
#include <boost/program_options.hpp>
// for program options from configuration file of command line arguments
26
27
#include <Eigen/Dense>
28
29
#include "
ElementsKernel/ProgramHeaders.h
"
// for including all Program/related headers
30
#include "
ElementsKernel/Unused.h
"
// for ELEMENTS_UNUSED
31
32
using
std::map
;
33
using
std::string
;
34
using
boost::program_options::variable_value;
35
36
namespace
Elements
{
37
namespace
Examples {
38
39
class
EigenExample
:
public
Program
{
40
41
public
:
42
43
44
ExitCode
mainMethod
(
ELEMENTS_UNUSED
map<string, variable_value>
& args)
override
{
45
46
using
Eigen::MatrixXd;
47
48
auto
log
=
Logging::getLogger
(
"EigenExample"
);
49
50
MatrixXd
m
(2, 2);
51
m
(0, 0) = 3;
52
m
(1, 0) = 2.5;
53
m
(0, 1) = -1;
54
m
(1, 1) =
m
(1, 0) +
m
(0, 1);
55
std::cout
<<
m
<<
std::endl
;
56
57
log
.info() <<
"This is the end of the test"
;
58
59
return
ExitCode::OK
;
60
61
}
62
63
};
64
65
}
// namespace Examples
66
}
// namespace Elements
67
68
73
MAIN_FOR
(
Elements::Examples::EigenExample
)
Elements::ExitCode::OK
@ OK
Everything is OK.
std::string
STL class.
Elements::Units::m
constexpr double m
Definition:
SystemOfUnits.h:79
Elements::ExitCode
ExitCode
Strongly typed exit numbers.
Definition:
Exit.h:98
std::cout
std::map
STL class.
ProgramHeaders.h
Elements::Examples::log
auto log
Definition:
BackTraceExample.cpp:38
Elements::Logging::getLogger
static Logging getLogger(const std::string &name="")
Definition:
Logging.cpp:63
std::endl
T endl(T... args)
Elements::Examples::EigenExample
Definition:
EigenExample.cpp:39
Elements::Program
Abstract class for all Elements programs.
Definition:
Program.h:51
Elements::Examples::EigenExample::mainMethod
ExitCode mainMethod(ELEMENTS_UNUSED map< string, variable_value > &args) override
Definition:
EigenExample.cpp:44
MAIN_FOR
#define MAIN_FOR(ELEMENTS_PROGRAM_NAME)
Definition:
Main.h:117
Unused.h
Macro to silence unused variables warnings from the compiler.
ELEMENTS_UNUSED
#define ELEMENTS_UNUSED
Definition:
Unused.h:39
Elements
Definition:
ClassExample.h:38
Generated by
1.8.18