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